AutoCAD offers two basic types of surfaces: Procedural surfaces and NURBS surfaces. A Procedural surface is a surface object with no control vertices which is defined from its relationship to other graphic objects. Therefore, a procedural surface is associative by default, meaning that it is modified automatically when editing the geometry used in its definition or any other associated surface. The SURFACEASSOCIATIVITY system variable when set to its default value 1 determines that associative surfaces will be created.
The term NURBS refers to curves and surfaces generated from the position of points. A NURBS curve is generated from a series of points and a NURBS surface is generated from a series of curves. Each NURBS curve or surface has a specific parametric equation that defines its shape. Both NURBS curves and surfaces have control vertices that can be manipulated to edit their shape. This type of surface is never associative.
The type of surface that is created is determined by the SURFACEMODELINGMODE system variable . Procedural surfaces are created If its value is 0 and NURBS surfaces if 1. SURFACEMODELINGMODE overrides SURFACEASSOCIATIVITY, meaning that if the creation of NURBS surfaces is enabled, the resulting surfaces will not be associative even if SURFACEASSOCIATIVITY is also enabled.
Creating surfaces.
As with 3DSolids, the information contained in the list returned by entget for a Surface entity includes encrypted binary information that does not allow creating them from entmake. Neither are ActiveX methods that enable their creation exposed. However, we can create MESH entities or 3DSolids and convert them into surfaces using the _CONVTOSURFACE command, taking advantage of the editing options they allow. This command also converts into surfaces the 2D Solids, 3DFaces, Regions, closed Polylines, Circles and Ellipses, as well as open linear entities (Lines, 2D Polylines, Arcs) having thickness. And as usual in AutoLISP/Visual LISP, any of the AutoCAD commands can be called from our programs in order to create surfaces.
We have considered in this Chapter the programming options for Procedure and NURBS surfaces.
- In the case of Procedural surfaces which are defined from linear cross-sections it is possible to retain the association between the surface and them. The cross sections can be assigned geometric and dimensional constraints so that they can be modified by parameters. Parameter modification can be implemented in a program. This way we can have surfaces whose shape changes by manually or programmatically modifying these parameters. A very practical way for using these surfaces is the creation of dynamic blocks with the aid of the Block Editor.
Associative procedural surface. |
- The most widely used surfaces in industrial design are the NURBS surfaces. This is due to their great advantages, which include rich interactive design capabilities and accurate representation of closed shapes such as conics and quadrics. In fact, many CAD/CAM, virtual reality, visualization and animation applications use models built with NURBS surfaces.
- The SPLINE entities explained in Chapter 14 are especially suitable for creating NURBS surfaces. These surfaces cannot be modified through Visual LISP programming. They can only be modified interactively using their control vertices and gizmos.
NURBS surfaces. |
This Chapter includes the following sections:
20.1. Creating surfaces.
20.2.Properties exposed by Surfaces.
20.3.Sample Program: NURBS surfaces.
20.4. Creating a Procedural surface.
20.5. Sample Program: Associative Surface with Parametric Profiles.
20.6. Modifying the cross-section’s constraint parameters.
20.7. Creating a dynamic block from the associative surface.
20.8. Summary.
Chapter 20 Source code.
Your questions or comments about this Chapter's contents are welcome!
Buy this book from Amazon
No comments:
Post a Comment