SoNurbsProfile(3)

NAME
SoNurbsProfile - The SoNurbsProfile class is a node for specifying smooth profile curves.

SYNOPSIS

#include <Inventor/nodes/SoNurbsProfile.h>

Inherits SoProfile.

  Public Member Functions
virtual SoType getTypeId (void) const
SoNurbsProfile (void)
virtual void getTrimCurve (SoState *state, int32_t &numpoints, float *&points, int &floatspervec, int32_t &numknots, float *&knotvector)
virtual void getVertices (SoState *state, int32_t &numvertices, SbVec2f *&vertices)

  Static Public Member Functions
static SoType getClassTypeId (void)
static void initClass (void)
Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system.

  Public Attributes
SoMFFloat knotVector

  Protected Member Functions
virtual const SoFieldData * getFieldData (void) const
virtual ~SoNurbsProfile ()

  Static Protected Member Functions
static const SoFieldData ** getFieldDataPtr (void)

  Additional Inherited Members

Detailed Description

The SoNurbsProfile class is a node for specifying smooth profile curves. Use nodes of this type if you want to set up profiles that are smooth curves.

Use ProfileCoordinate2 for nonrational profile curves where weight is 1.0 (default), and ProfileCoordinate3 for rational profile curves to specify the weight. Weight is analogous to having magnets pulling on the curve.

A typical usage case for SoNurbsProfile is to specify NURBS trimming curves. For example:

#Inventor V2.1 ascii
ShapeHints {
  vertexOrdering COUNTERCLOCKWISE
}
Coordinate3 {
  point [
    -3 -3 -3, -3 -1 -3, -3 1 -3, -3 3 -3,
    -1 -3 -3, -1 -1  3, -1 1  3, -1 3 -3,
     1 -3 -3,  1 -1  3,  1 1  3,  1 3 -3,
     3 -3 -3,  3 -1 -3,  3 1 -3,  3 3 -3
   ]
}
ProfileCoordinate2 {
  point [ 0.0 0.0 ,
          0.75 0.0,
          0.75 0.75 ,
          0.25 0.75 ,
          0.0 0.0  ]
}
NurbsProfile {
   index [ 0 , 1 , 2 , 3, 4 ]
   linkage START_NEW
   knotVector [ 0, 0, 0, 0, 0.5, 1, 1, 1, 1 ]
}
NurbsSurface {
  numUControlPoints 4
  numVControlPoints 4
  uKnotVector [ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0 ]
  vKnotVector [ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0 ]
}

 Rendering of Example Scenegraph

Note that the coordinates of the NurbsProfile live in the parametric space of the trimmed SoNurbsSurface, and that the same complexity setting (which is calculated based on the dimensions of the bounding box of the NurbsSurface) is used to determine the sampling tolerance both for the SoNurbsSurface and the SoNurbsProfile.

This means that if you want to change the tessellation of the trimming curve itself (i.e. increase or decrease the resolution of the boundaries of the 'cut-out'), you should not change the SoComplexity setting but rather adapt the parametric scale in relation to the trimmed surface.

As an example, to increase the resolution of the curve in the above example, replace...

ProfileCoordinate2 {
  point [ 0.0 0.0, 0.75 0.0, 0.75 0.75, 0.25 0.75, 0.0 0.0 ]
}

.. with...

ProfileCoordinate2 {
  point [ 0.0 0.0, 7.5 0.0, 7.5 7.5, 2.5 7.5, 0.0 0.0 ]
}

and change the uKnotVector and vKnotVector of the NurbsSurface to be

uKnotVector [ 0.0, 0.0, 0.0, 0.0, 10, 10, 10, 10 ]
vKnotVector [ 0.0, 0.0, 0.0, 0.0, 10, 10, 10, 10 ]

However, keep in mind that increasing the accuracy of the trimming curve results in a much more complex tessellation of the trimmed surface. As a general rule of thumb, the extent of the trimming curve coordinates should never be greater than its 'real' extents in relation to the trimmed surface, and often can be much lower.

If you find the above confusing, you probably do not want to use NURBS without reading up on the general concepts first. An explanation of NURBS is beyond the scope of the Coin documentation; for detailed information, refer to the specialized literature on the topic (for example 'An Introduction to NURBS: With Historical Perspective' by David F. Rogers). A basic overview of curve and surface rendering using NURBS can also be found in chapter 8 of 'The Inventor Mentor'.

FILE FORMAT/DEFAULTS:

NurbsProfile {
    index 0
    linkage START_FIRST
    knotVector 0
}

Constructor & Destructor Documentation

  SoNurbsProfile::SoNurbsProfile (void)
Constructor.

  SoNurbsProfile::~SoNurbsProfile () [protected], [virtual]
Destructor.

Member Function Documentation

  SoType SoNurbsProfile::getClassTypeId (void) [static]
This static method returns the SoType object associated with objects of this class.

  SoType SoNurbsProfile::getTypeId (void) const [virtual]
Returns the type identification of an object derived from a class inheriting SoBase. This is used for runtime type checking and 'downward' casting.

Reimplemented from SoProfile.

  const SoFieldData ** SoNurbsProfile::getFieldDataPtr (void) [static], [protected]
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.
 Returns the SoFieldData class which holds information about fields in this node.

  const SoFieldData * SoNurbsProfile::getFieldData (void) const [protected], [virtual]
Returns a pointer to the class-wide field data storage object for this instance. If no fields are present, returns NULL.

Reimplemented from SoProfile.

  void SoNurbsProfile::getTrimCurve (SoState * state, int32_t & numpoints, float *& points, int & floatspervec, int32_t & numknots, float *& knotvector) [virtual]
Return points and knotvector of the state.

Implements SoProfile.

  void SoNurbsProfile::getVertices (SoState * state, int32_t & numvertices, SbVec2f *& vertices) [virtual]
Return vertex set of state.

Implements SoProfile.

Member Data Documentation

  SoMFFloat SoNurbsProfile::knotVector
Knot values for the NURBS curve.

Author

Generated automatically by Doxygen for Coin from the source code.