Chapter 19. Subdivision Surfaces

The Mesh Modeler introduced in Release 2010 is based on Subdivision Surfaces, objects that make possible a very intuitive way of 3D objects modeling through the manipulation of mesh vertices, edges or faces. Subdivision Surfaces are presented in AutoCAD as MESH entities (AcadSubDMesh objects).
These meshes or Subdivision Surfaces are defined recursively. The process begins with a coarser mesh. This initial mesh is the smoothing Level 0, with flat faces and edges at an angle. To this mesh a smoothing process can be applied, subdividing it to create smaller facets by which a better approximation to curved forms is achieved. This process creates a denser mesh corresponding to a new level of smoothness. The resulting mesh can undergo the same process again and so on, thereby increasing the smoothing attained.
A smoothed mesh can be totally or partially subjected to refining, incorporating the facets generated by smoothing as faces, edges and vertices of the Level 0 base mesh. The refined mesh becomes a new Level 0, which can be subjected to further smoothing processes. It must be noted that the surfaces are curved only in appearance, as the smoothing facets are still planar.
Having been introduced with AutoCAD Release 2010, when VBA had already been discontinued, methods to create AcadSubDMesh objects through ActiveX are not exposed. However, unlike 3DSolids or Surfaces in which information is encrypted, the values ​​for DXF group codes in the definition list of MESH entities are directly accessible from AutoLISP. This means that MESH entities can be created by entmake and modified by entmod. The information on faces, edges and vertices to which the ent... functions have access always belong to smoothing Level 0. But using ActiveX it is possible to access a series of MESH properties, including the facet vertices positions.
MESH objects can also be created using the _MESH command that creates primitives (rectangular prism, cone, cylinder, pyramid, sphere, wedge, or torus) similar to those created as 3DSolids, and also from 2D and 3D objects using the old commands _RULESURF, _TABSURF, _REVSURF and _EDGESURF. It is also possible to convert Polygon or Polyface Meshes, 3DSolids or Surfaces into MESH entities with the _MESHSMOOTH command.
Dodecahedron created through AutoLISP, with different smoothing levels.

This chapter includes a complete documentation on the implementation of Subdivision Surfaces as MESH entities in AutoCAD. Contrary to 3DSolids, which could not be created but from ActiveX methods, there are no exposed equivalent methods for the creation of AcadSubDMesh class objects.
But these meshes expose their entity definition lists in the classic AutoLISP manner. This makes their creation using entmake possible. This only requires a clear understanding of the data structure exposed as DXF group codes. The DXF reference information is not easy to understand, something which I have sought to clarify by means of a series of sample programs.
However, we have ActiveX properties to modify MESH objects in addition to the AutoLISP entmod function. The ActiveX and VBA Reference has only recently been updated to include these objects, but it must be downloaded from the ADN Open website, as it is not included in the standard installation. We hope this Chapter will compensate for this shortcoming.
MESH shaped using the SHAPE-M program defined in this Chapter.
 The concepts exposed in this Chapter are the subject of the Autodesk University 2012 class LISP your MESH into Shape!. This class includes a downloadable handout and source code.

This Chapter includes the following sections:

19.1. Programming MESH objects with Visual LISP.
19.2.Creating MESH entities with ENTMAKE.
19.3.Sample Program: Polyhedral MESH.
19.4. Sample Program: MESH approximating mathematical functions.
19.5. Creating meshes using command/vl-cmdf.
19.6. Modifying Subdivision Surfaces.
19.7. Sample Program: Modifying MESH objects.
19.8. Generalizing MESH transformations.
19.9. Sample Program: Shape up a MESH object.
19.10. Meshes created from 2D entities.
19.11. Summary.
Your questions or comments about this Chapter's contents are welcome!
Buy this book from CreateSpace eStore

Buy this book from CreateSpace eStore

No comments:

Post a Comment