Table of contents: Node Reference

Contour2D
CoordinateDeformer
NurbsCurve
NurbsCurve2D
NurbsGroup
NurbsPositionInterpolator
NurbsSurface
NurbsTextureSurface
Polyline2D
TrimmedSurface


 

Contour2D

Contour2D { 
  eventIn      MFNode  addChildren
  eventIn      MFNode  removeChildren
  exposedField MFNode  children          []
}

The Contour2D node groups a set of curve segments to a composite contour. The children have to form a closed loop with the first point of the first child repeated as the last point of the last child and the last point of a segmet repeated as the first point of the consecutive one. The segments must be of the type NurbsCurve2D or Polyline2D and must be enumerated in the child field in consecutive order according to the topology of the contour. The parent node must be a TrimmedSurface (see also 1.2 Trimmed NURBS).

 

 

CoordinateDeformer

CoordinateDeformer { 

  eventIn      MFNode   addChildren
  eventIn      MFNode   removeChildren
  exposedField MFNode   children          []
  field        SFVec3f  bboxCenter        0 0 0     # (-,)
  field        SFVec3f  bboxSize          -1 -1 -1  # (0,) or -1,-1,-1

  field        SFInt32  uDimension       0 
  field        SFInt32  vDimension       0
  field        SFInt32  wDimension       0
  field        MFFloat  uKnot            []     
  field        MFFloat  vKnot            []
  field        MFFloat  wKnot            []
  field        SFInt32  uOrder           2 
  field        SFInt32  vOrder           2
  field        SFInt32  wOrder           2
  exposedField MFVec3f  controlPoint     []
  exposedField MFFloat  weight           []
  exposedField MFNode  inputCoord        NULL
  exposedField MFNode  inputTransform    NULL
  exposedField MFNode  outputCoord       NULL
}
CoordinateDeformer allows a free form deformation on a set of MFVec3f Coordinate node list by using a NURBS volume. The input to the Interpolator is a list of Coordinate Nodes, each Coordinate node point entry defines a 3D parameter (u,v,w) for evaluation. The corresponding cartesian output value is computed from the NURBS control grid. The children are containing a scene graph which typically contains IndexedFaceSet nodes referring to a deformed Coordinate node in outputCoords.

uDimension, vDimension, wDimension, controlPoint, weight, uKnot, vKnot, wKnot, uOrder, vOrder, wOrder defining the NURBS in the 3 dimensions. The definition is similar to the NurbsSurface node.

The inputCoord field, if specified, shall contain a set of Coordinate nodes.

The outputCoord field, shall contain a set of Coordinate nodes. The number of nodes must be equal to the number of nodes in inputCoord. The nodes itself should be distinct from nodes in inputCoords.

The inputTransform field, if specified, shall contain a set of Transform nodes, the number of nodes must be equal to the number of nodes in inputCoord.

By animating the controlPoint field IndexedFaceSet - Meshes using a Coordinate node from outputCoords are deformed over time. Similar the point field in a input Coordinate node can be animated. By animating a Transform node in the inputTransforms, Meshes can be moved through the deformation space. (Space warp)

CoordinateDeformer is a group node and must be part of the Transform hierarchy if evaluations is required. Points in the Coordinate node contained in outputCoords are recomputed and updated whenever the points of the inputCoords Coordinate are changed, any exposedField of the CoordinateDeformer itself is changed, or if present the Transform in any of the inputTransforms is changed.
Implementations may defer or even skip evaluation, until the CoordinateDeformerGroup is traversed and need to be displayed. I.e. if the node is currently not part of the traversed scene graph or the node is not being rendered because the boundingBox of the node or the boundingBox computed from controlPoint falls outside the view frustum.

In some respect CoordinateDeformer is a special version of a VRML CoordinateInterpolator. We haven choosen to wrap this potential expensive function in a Group node in order to make the animation locatable in the scene graph at a certain 3d positition. Interpolations in VRML are having normally no boundig box and so are not cullable based on visibility if the author doesn't cull the behaviour by using an explicit VisibilitySensor and routing the output of that to the controlling TimeSensor.
 
 

Example: 
DEF FFD CoordinateDeformer  { 
        controlPoint [ ..... ]         
        inputCoord   DEF inputCoord  Coordinate  { point [ ...] } 
        outputCoord  DEF outputCoord Coordinate  { point [] }
        children Shape { 
                geometry IndexedFaceSet { 
                        coord USE outputCoord
                   coordIndex [ .... ] 
                } 
        } 
}
additional code to animate the FFDGrid
DEF Timer TimeSensor {}
DEF FFDGridInterpolator CoordinateInterpolator { ..... } 
ROUTE FFDGridInterpolator.value_changed TO FFD.set_controlPoint 
ROUTE Timer.fraction_changed O FFDGridInterpolator.set_fraction
If a given input coordinate value (optionally transformed  by the Matrix of the corresponding Transform node) exceeds the parametric range of one of the knot vectors, the corresponding output coordinate value will be left unchanged. This is useful to deform only a subset of the coordinates or to animated different parts of the coordinate node by different CoordinateDeformerGroup nodes.

Pseudo code to formulate the operation of this node :
 

function PerformDeformation() {
for (n=0; n<inputCoords.length;i++) {
    Deform(inputCoord[i].point,MatrixOf(inputTransform[i]),outputCoord[i].point);
}
}
function Deform(MFVec3f input, Matrix m, MFVec3f output)
{

if (output.length < input.length) output.length = input.length;
for (i=0; i<input.length;i++) {
    SFVec3f parameter = m * input[i];
    if (ParameterInRange(parameter)) {
        output[i] = NurbsEvaluate3(parameter);

    }
}
}

SFVec3f NurbsEvaluate3(SFVec3f parameter)
 -- evaluate standard NURBS formula
 

NurbsCurve

NurbsCurve {
  field             MFFloat   knot             []    # (-,)
  field             SFInt32   order            3     # [2,)

  exposedField      MFVec3f   controlPoint     []    # (-,)
  exposedField      MFFloat   weight           []    # (0,)
  exposedField      SFInt32   tessellation           # (-,) 
} 

Figure 1: The red points mark the conrol points, the black lines outline a corresponding IndexedLineSet. The blue curve shows the resulting NurbsCurve

The NurbsCurve node defines a 3-dimensional curve that is approximating the control points. For a detailed description refer to 1.1.1 Fields of NURBS Nodes.

NurbsCurve2D

NurbsCurve2D  {

  field        MFFloat  knot            []   field        SFInt32  order           3   exposedField MFVec2f  controlPoint    []   exposedField MFFloat  weight          []   exposedField SFInt32  tessellation    0 }

The NurbsCurve2D node defines a trimming segment that is part of a trimming contour in the u-v domain of the surface. If the curve is not closed, the parent node has to be a Contour2D. If the NurbsCurve2D forms a closed contour, it may be used instead of Contour2D node (see also 1.2 Trimmed NURBS).

For a description of the fields refer to 1.1.1 Fields of NURBS Nodes. The controlPoint field defines a set of control points in the u-v domain of the parent TrimmedNurbsSurface. The values have to be within the knot span of the surface.

NurbsGroup

NurbsGroup { 
  eventIn      MFNode  addChildren
  eventIn      MFNode  removeChildren
  exposedField MFNode  children          []
  field        SFVec3f bboxCenter        0 0 0     # (-,)
  field        SFVec3f bboxSize          -1 -1 -1  # (0,) or -1,-1,-1
  exposedField SFFloat tessellationScale 1.0
}
The NurbsGroup node groups a set of NurbsSurface and NurbsCurve nodes to a common group. This provides a hint to the browser to treat the set of NURBS nodes as a unit during tessellation to enforce tessellation continuity along borders. The tessellationScale parameter is scaling the the tessellation values in lower level NURBS nodes. If a set of NurbsSurfaces use a matching set of controlPoints along the borders, this results in a common tessellation stepping. Besides that the NurbsGroup is a normal Group node.
 
 
 

NurbsPositionInterpolator

NurbsPositionInterpolator { 
  eventIn      SFFloat  set_fraction
  exposedField SFBool   fractionAbsolute TRUE 
  exposedField MFFloat  knot             []     
  exposedField SFInt32  order            3 
  exposedField MFVec3f  keyValue         []
  exposedField MFFloat  keyWeight        []
  eventOut     SFVec3f  value_changed 

}

NurbsPositionInterpolator describes a 3D NURBS Curve using keyValue, keyWeight, knot and order . Sending a set_fraction input computes a 3D position on the curve, which is sent by value_changed.

If fractionAbsolute is set to TRUE the fraction is directly used to generate an output value. The fraction has to be within the knot vector. If set to FALSE the fraction is spanned over the knot vector.

The keyValue corresponds to control points, the keyWeight to weights. For a detailed description refer to 1.1.1 Fields of NURBS Nodes.
 

NurbsSurface

NurbsSurface { 
  field        SFInt32  uDimension        0     # [0,)  
  field        SFInt32  vDimension        0     # [0,)
  field        MFFloat  uKnot             []    # (-,) 
  field        MFFloat  vKnot             []    # (-,)
  field        SFInt32  uOrder            3     # [2,)  
  field        SFInt32  vOrder            3     # [2,)
  exposedField MFVec3f  controlPoint      []    # (-,)
  exposedField MFFloat  weight            []    # (0,)
  exposedField SFInt32  uTessellation     0     # (-,)  
  exposedField SFInt32  vTessellation     0     # (-,)  
  exposedField SFNode   texCoord          []
  field        SFBool   ccw               TRUE
  field        SFBool   solid             TRUE
}

Figure 2: The red points mark the control points, the red lines outline the controling mesh. The blue mesh shows the resulting tessellated NurbsSurface.

uDimension and vDimension define the number of control points in the u and v dimensions. uOrder and vOrder define the order of surface. uKnots and vKnots define the knot vectors. uTessellation and vTessellation give hints to the surface tessellator. For a detailed description refer to 1.1.1 Fields of NURBS Nodes.

controlPoint defines a set of control points of dimension uDimension * vDimension. This set of points defines a mesh similar to the grid of a ElevationGrid whereas the points do not have a uniform spacing. Depending on the weight-values and the order this hull is approximated by the resulting surface. #uDimension points define a polyline in u-direction followed by further u-polylines with the v-parameter in ascending order. The number of control points must be equal or greater than the order. A closed B-Spline surface can be specified by repeating the limiting control points.

The control  vertex corresponding to the control point P[i, j] on the control grid is :

    P[i,j].x = controlPoints[i + ( j × uDimension)].x
    P[i,j].y = controlPoints[i + ( j × uDimension)].y
    P[i,j].z = controlPoints[i + ( j × uDimension)].z
    P[i,j].w = weight[ i + (j × uDimension)]

    where 0 <= i < uDimension and 0 <= j < vDimension.

texCoord (not implemented) provide additional information on how to generate texture coordinates. By default texture coordinates in the unit square are generated automatically from the parametric subdivision. The use of a NurbsTextureSurface enables the computation of texture coordinates for a given a u/v parameter of the NurbsSurface.


ccw and solid are defined like in other VRML Geometry nodes. solid TRUE enables two-sided lighting, the surface is visible from both sides, and normals are flipped toward the viewer, prior to shading.

NurbsTextureSurface

(not implemented)
NurbsTextureSurface { 
  field        SFInt32  uDimension        0     # [0,)  
  field        SFInt32  vDimension        0     # [0,)
  field        MFFloat  uKnot             []    # (-,) 
  field        MFFloat  vKnot             []    # (-,)
  field        SFInt32  uOrder            3     # [2,)  
  field        SFInt32  vOrder            3     # [2,)
  exposedField MFVec2f  controlPoint      []    # (-,)
  exposedField MFFloat  weight            []    # (0,)

}

The NurbsTextureSurface node can be used to generate texture coordinates for a NurbsSurface. The control points exist in the parameter space of the NurbsSurface, so the values are 2-dimensional and may not exceed the knot range of the parent suface. For a detailed description of the fields refer to 1.1.1 Fields of NURBS Nodes.

Polyline2D

Polyline2D  {

  exposedField MFVec2f  point    [] }

The Polyline2D node defines a linear curve segment as a part of a trimming contour in the u-v domain of a surface.

TrimmedSurface

TrimmedSurface { 
  eventIn      MFNode  addTrimmingContour
  eventIn      MFNode  removeTrimmingContour
  exposedField MFNode  trimmingContour   []
  exposedField SFNode  surface          NULL  
}
The TrimmedSurface node defines a NURBS surface that is trimmed by a set of trimming loops (see also 1.2 Trimmed NURBS). The surface field contains the NurbsSurface that shall be trimmed. The trimmingContour field, if specified, shall contain a set of Contour2D nodes. The contours specify the area to trim out following the trimming rule aligned to the Open Inventor definition: A area inside a loop is discarded if the loop is defined in a clockwise direction. If the loop is defined in a counterclockwise direction the area inside is retained and outside is discarded. The outermost contour must be defined in a counterclockwise direction. The contours may not be self-intersecting or intersect other contours.