Creating Primitive NURBS Objects
GenNURBSLatheSurface()
The GenNURBSLatheSurface() function generates a NURBS surface of revolution given an input curve, origin, up
axis, and start and end angles. The output of this function is a NURBS CV Surface
that matches the definition, not a relational surface.
Parameters:
- NURBSCurve& curve - This is the NURBS curve that is revolved.
- Point3& origin - Specifies the origin of the revolution.
- Point3& north - This is the axis that specified the up direction.
- float start - This is the start angle of the revolution in radians.
- float end - This is the end angle of the revolution in radians.
- NURBSSurface& surf - The surface definition is returned here.
GenNURBSSphereSurface()
The GenNURBSSphereSurface() Generates a NURBS sphere as a non-closed NURBS Surface. Note that this is a CV surface
that matches the definition, not a relational surface.
Parameters:
- float radius - The radius of the sphere.
- Point3& center - The center point of origin of the sphere.
- Point3& northAxis - This specifies the up axis. Use Point3(0,0,1) for the Z axis for example.
- Point3& refAxis - This is the direction of the seam. The sphere primitive uses Point3(0,-1,0) as
this value.
- float startAngleU - The start angle for the sphere in the U direction, specified in radians.
- float endAngleU - The end angle for the sphere in the U direction, specified in radians.
- float startAngleV - The start angle for the sphere in the V direction, specified in radians.
- float endAngleV - The end angle for the sphere in the V direction, specified in radians.
- NURBSSurface& surf - The surface definition is returned here. This is a CV surface that matches the
definition, not a relational surface.
GenNURBSCylinderSurface()
The GenNURBSCylinderSurface() function generates a NURBS cylinder as a non-closed NURBS Surface. Note that this
is a CV surface that matches the definition, not a relational surface.
Parameters:
- float radius - The radius of the cylinder.
- float height - The height of the cylinder.
- Point3& origin - The origin of the cylinder.
- Point3& symAxis - The axis of symmetry. The standard cylinder primitive specifies Point3(0,0,1).
- Point3& refAxis - This is the direction of the seam. The standard cylinder primitive specifies Point3(0,1
,0).
- float startAngle - The start angle in radians.
- float endAngle - The end angle in radians.
- NURBSSurface& surf - The surface definition is returned here.
GenNURBSConeSurface()
The GenNURBSConeSurface() function generates a NURBS cone surface as a non-closed NURBS Surface. Note that
this is a CV surface that matches the definition, not a relational surface.
Parameters:
- float radius1 - One of the radii of the cone.
- float radius2 - The other radius of the cone.
- float height - The height of the cone.
- Point3& origin - The origin of the cone.
- Point3& symAxis - The axis of symmetry.
- Point3& refAxis - This is the direction of the seam.
- float startAngle - The start angle in radians.
- float endAngle - The end angle in radians.
- NURBSSurface& surf - The surface definition is returned here.
GenNURBSTorusSurface()
This GenNURBSTorusSurface() function generates a NURBS torus surface as a non-closed NURBS Surface. Note that
this is a CV surface that matches the definition, not a relational surface.
Parameters:
- float majorRadius - This is the radius of the entire 'donut' shape.
- float minorRadius - The is the radius of the 'tube'.
- Point3& origin - The origin of the cone.
- Point3& symAxis - The axis of symmetry.
- Point3& refAxis - This is the direction of the seam.
- float startAngleU - The start angle of the torus in the U direction.
- float endAngleU - The end angle of the torus in the U direction.
- float startAngleV - The start angle of the torus in the V direction.
- float endAngleV - The end angle of the torus in the V direction.
- NURBSSurface& surf - The surface definition is returned here.
CreateNURBSLatheShape()
The CreateNURBSLatheShape() function generates a NURBS object based on the specified lathe (surface of revolution)
definition and returns a pointer to it. This is used by the lathe modifier.
Parameters:
- IObjParam* ip - The 3ds Max interface pointer. If non-NULL, this is used to get at the 3ds Max
function to do unique naming. If a NULL is specified the names are not made unique.
- TSTR name - The name for the object. If the pointer above is non-NULL this name is made unique.
- TimeValue t - The time at which to revolve the shape.
- ShapeObject *shape - Points to the shape object to revolve. Note that if the ShapeObject pointed to
is a bezier spline then capping won't work properly.
- Matrix3& axis - This specifies the axis of revolution.
- float degrees - The angle for the surface of revolution in degrees.
- int capStart - Specifies if the surface should be capped at the beginning: TRUE to cap; FALSE
to leave open. Note that this is only used if the ShapeObject is a NURBS curve.
- int capEnd - Specifies if the surface should be capped at the ending: TRUE to cap; FALSE to
leave open. Note that this is only used if the ShapeObject is a NURBS curve.
- int capType - This parameter is not currently used and the value passed is ignored.
- BOOL weldCore - TRUE to collapse any coincident vertices at the center of the surface; otherwise
FALSE.
- BOOL flipNormals - TRUE to invert the orientation of surface normals; otherwise FALSE.
- BOOL texturing - TRUE to generate mapping coordinates; otherwise FALSE.
- int segs - This parameter is not currently used and the value passed is ignored.
- BOOL matIds - If TRUE special material Ids are assigned to the surfaces and caps.
- BOOL shapeIDs - If TRUE shape IDs are used. When on, this function uses the material ID values
assigned to segments in the spline to be lathed, or curve sub-objects in the NURBS
curve to be lathed. This is available only when matIds is TRUE.
CreateNURBSExtrudeShape()
The CreateNURBSExtrudeShape() function generates a NURBS object based on the specified extrusion definition and
returns a pointer to it. This is used by the extrude modifier.
Parameters:
- IObjParam* ip - The 3ds Max interface pointer. If non-NULL, this is used to get at the 3ds Max
function to do unique naming. If a NULL is specified the names are not made unique.
- TSTR name - The name for the surface. If the pointer above is non-NULL this name is made unique.
- TimeValue t - The time at which to extrude the shape.
- ShapeObject *shape - Points to the shape object to extrude. Note that if the ShapeObject pointed to is a bezier spline then capping won't work properly.
- float amount - Specifies the height of the extrusion.
- int capStart - Specifies if the surface should be capped at the bottom: TRUE to cap; FALSE to
leave open. Note that this is only used if the ShapeObject is a NURBS curve.
- int capEnd - Specifies if the surface should be capped at the top: TRUE to cap; FALSE to leave
open. Note that this is only used if the ShapeObject is a NURBS curve.
- int capType - This parameter is not currently used and the value passed is ignored.
- BOOL texturing - If TRUE texture coordinates are assigned; otherwise they are not.
- BOOL matIds - If TRUE special material Ids are assigned to the surfaces and caps.
- BOOL shapeIDs - If TRUE shape IDs are used. When on, this function uses the material ID values
assigned to segments in the spline to be extruded, or curve sub-objects in the NURBS
curve to be extruded. This is available only when the matIds parameter is TRUE.