Click or drag to resize
SoExtrusion Class

Geometric shape formed by extruding a 2D cross section along a 3D spine.

Inheritance Hierarchy

Namespace: OIV.Inventor.Nodes
Assembly: OIV.Inventor (in OIV.Inventor.dll) Version: 10.12.3.0 (10.12.3.0)
Syntax
public class SoExtrusion : SoBaseExtrusion

The SoExtrusion type exposes the following members.

Constructors
  NameDescription
Public methodSoExtrusion

Constructor.

Top
Methods
  NameDescription
Public methodAffectsState

Overrides default method on OIV.Inventor.Nodes.SoNode.

(Inherited from SoShape.)
Public methodBeginShape(SoAction, SoShapeTriangleShapes)
Calls BeginShape(action, shapeType, (OIV.Inventor.Details.SoFaceDetail ^)nullptr).
(Inherited from SoShape.)
Public methodBeginShape(SoAction, SoShapeTriangleShapes, SoFaceDetail)

These methods can be used by subclasses to generate triangles more easily when those triangles are part of a larger structure, such as a triangle strip, triangle fan, or triangulated polygon, according to the TriangleShape enumerated type.

(Inherited from SoShape.)
Public methodCallback

Implements primitive generation for all shapes.

(Overrides SoShapeCallback(SoCallbackAction).)
Public methodComputeBBox(SoAction, SbBox3f, SbVec3f)

Compute axis aligned bounding box (AABB) for subclass using information in the given action (which may not necessarily be an OIV.Inventor.Actions.SoGetBoundingBoxAction).

(Overrides SoShapeComputeBBox(SoAction, SbBox3f, SbVec3f).)
Public methodComputeBBox(SoAction, SbXfBox3d, SbVec3d)

Compute axis aligned bounding box (AABB) for subclass using information in the given action (which may not necessarily be an OIV.Inventor.Actions.SoGetBoundingBoxAction).

(Overrides SoShapeComputeBBox(SoAction, SbXfBox3d, SbVec3d).)
Public methodCopy
Calls Copy(false).
(Inherited from SoNode.)
Public methodCopy(Boolean)

Creates and returns an exact copy of the node.

(Inherited from SoNode.)
Public methodCopyFieldValues(SoFieldContainer)
Calls CopyFieldValues(fc, false).
(Inherited from SoFieldContainer.)
Public methodCopyFieldValues(SoFieldContainer, Boolean)

Copies the contents of fc's fields into this object's fields.

(Inherited from SoFieldContainer.)
Public methodDispose
Releases all resources used by SoDisposable.
(Inherited from SoDisposable.)
Public methodDistribute
(Inherited from SoNode.)
Public methodDoAction
Public methodEnableNotify

Notification at this Field Container is enabled (if flag == true) or disabled (if flag == false).

(Inherited from SoFieldContainer.)
Public methodEndShape

end shape previously started with OIV.Inventor.Nodes.SoShape.BeginShape(OIV.Inventor.Actions.SoAction, OIV.Inventor.Nodes.SoShape.TriangleShapes, OIV.Inventor.Details.SoFaceDetail).

(Inherited from SoShape.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodFieldsAreEqual

Returns true if this object's fields are exactly equal to fc's fields.

(Inherited from SoFieldContainer.)
Public methodGet

Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string.

(Inherited from SoFieldContainer.)
Public methodGetAllFields

Returns a list of fields, including the eventIn's and eventOut's.

(Inherited from SoFieldContainer.)
Public methodGetAlternateRep

This method is called by actions to allow the node to provide an "alternate representation" when appropriate (typically depending on the action type).

(Inherited from SoNode.)
Public methodGetBoundingBox

Implements bounding box method using virtual OIV.Inventor.Nodes.SoShape.ComputeBBox(OIV.Inventor.Actions.SoAction, OIV.Inventor.SbBox3f@, OIV.Inventor.SbVec3f@) method.

(Inherited from SoShape.)
Public methodGetEventIn

Returns a the eventIn with the given name.

(Inherited from SoFieldContainer.)
Public methodGetEventOut

Returns the eventOut with the given name.

(Inherited from SoFieldContainer.)
Public methodGetField

Returns a the field of this object whose name is fieldName.

(Inherited from SoFieldContainer.)
Public methodGetFieldName

Returns the name of the given field in the fieldName argument.

(Inherited from SoFieldContainer.)
Public methodGetFields

Appends references to all of this object's fields to resultList, and returns the number of fields appended.

(Inherited from SoFieldContainer.)
Public methodGetHashCode
Overrides GetHashCode().
(Inherited from SoNetBase.)
Public methodGetMatrix
(Inherited from SoNode.)
Public methodGetName

Returns the name of an instance.

(Inherited from SoBase.)
Public methodGetPrimitiveCount

Counts number of primitives produced by this shape.

(Overrides SoShapeGetPrimitiveCount(SoGetPrimitiveCountAction).)
Public methodGetRenderEngineMode

Returns the supported Render engine mode.

(Inherited from SoNode.)
Public methodGetRenderUnitID
(Inherited from SoNode.)
Public methodGetShapeType

Gets the current shape Full Scene Antialiasing type.

(Inherited from SoShape.)
Public methodGetStringName (Inherited from SoBase.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGLRender

Implements rendering by rendering each primitive generated by subclass.

(Inherited from SoShape.)
Public methodGLRenderBelowPath
(Inherited from SoNode.)
Public methodGLRenderInPath
(Inherited from SoNode.)
Public methodGLRenderOffPath
(Inherited from SoNode.)
Public methodGrabEventsCleanup
(Inherited from SoNode.)
Public methodGrabEventsSetup
(Inherited from SoNode.)
Public methodHandleEvent
(Inherited from SoNode.)
Public methodHasDefaultValues

Returns true if all of the object's fields have their default values.

(Inherited from SoFieldContainer.)
Public methodIsBoundingBoxIgnoring

Used by BoundingBoxAction to know if bounding box computation should be ignored or not.

(Inherited from SoShape.)
Public methodIsNotifyEnabled

Notification is the process of telling interested objects that this object has changed.

(Inherited from SoFieldContainer.)
Public methodIsOverride

Returns the state of the override flag.

(Inherited from SoNode.)
Public methodIsSynchronizable

Gets the ScaleViz synchronizable state of this object.

(Inherited from SoBase.)
Public methodPick
(Inherited from SoNode.)
Public methodRayPick

Implements picking along a ray by intersecting the ray with each primitive generated by subclass.

(Overrides SoShapeRayPick(SoRayPickAction).)
Public methodSearch
(Inherited from SoNode.)
Public methodSet

Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.

(Inherited from SoFieldContainer.)
Public methodSetName (Inherited from SoBase.)
Public methodSetOverride

Turns the override flag on or off.

(Inherited from SoNode.)
Public methodSetShapeType

set the antialiasing type for this shape.

(Inherited from SoShape.)
Public methodSetSynchronizable

Sets this to be a ScaleViz synchronizable object.

(Inherited from SoBase.)
Public methodSetToDefaults

Sets all fields in this object to their default values.

(Inherited from SoFieldContainer.)
Public methodShapeVertex

add a primitive vertex to the shape prevously started with OIV.Inventor.Nodes.SoShape.BeginShape(OIV.Inventor.Actions.SoAction, OIV.Inventor.Nodes.SoShape.TriangleShapes, OIV.Inventor.Details.SoFaceDetail).

(Inherited from SoShape.)
Public methodToString
Converts this SoBase structure to a human readable string.
(Inherited from SoBase.)
Public methodTouch

Marks an instance as modified, simulating a change to it.

(Inherited from SoNode.)
Public methodWrite
(Inherited from SoNode.)
Top
Properties
  NameDescription
Public propertybeginCap

If true, begin planar cap surfaces generated.

(Inherited from SoBaseExtrusion.)
Public propertyboundingBoxIgnoring

Whether to ignore this node during bounding box traversal.

(Inherited from SoShape.)
Public propertycrossSection

The shape that will be extruded, defined by a 2D piecewise linear curve in the XZ plane (described as a series of connected vertices).

Public propertyendCap

If true, end planar cap surfaces generated.

(Inherited from SoBaseExtrusion.)
Public propertyextrusionMode

Construction behavior of the extrusion.

(Inherited from SoBaseExtrusion.)
Public propertyIsDisposable
ISafeDisposable interface implementation.
(Inherited from SoDisposable.)
Public propertyorientation

The cross-section curve is rotated by this value relative to a local reference system with origin at the current spine point and X / Z axes in the plane containing the cross-section curve.

Public propertyscale

The cross-section curve is scaled by this value on the X and Z axes.

Public propertyscaleMode

Scaling behavior of the extrusion.

(Inherited from SoBaseExtrusion.)
Public propertyspine

Spine points.

(Inherited from SoBaseExtrusion.)
Public propertyUserData
Gets or sets the user data to be contained by the field container.
(Inherited from SoFieldContainer.)
Top
Remarks

The OIV.Inventor.Nodes.SoExtrusion node specifies geometric shapes based on a two-dimensional cross section extruded along a three-dimensional spine. The cross section can be scaled and rotated at each spine point to produce a wide variety of shapes.

An OIV.Inventor.Nodes.SoExtrusion is defined by:

  • OIV.Inventor.Nodes.SoExtrusion.crossSection The shape that will be extruded, defined by a 2D piecewise linear curve in the XZ plane (described as a series of connected vertices).

  • spine The cross-section is extruded along this path, defined by a 3D piecewise linear curve (described as a series of connected vertices). This field is inherited from the parent class OIV.Inventor.Nodes.SoBaseExtrusion.

  • OIV.Inventor.Nodes.SoExtrusion.scale values The cross-section curve is scaled by this value on the X and Z axes. If one value is specified it applies to every spine point, else there should be as many values as there are points in the spine. All scale values must be > 0.

  • OIV.Inventor.Nodes.SoExtrusion.orientation values, The cross-section curve is rotated by this value relative to a local reference system with origin at the current spine point and X / Z axes in the plane containing the cross-section curve. If one value is specified it applies to every spine point, else there should be as many values as there are points in the spine.

Shapes are constructed as follows - For each point in the spine, the cross-section curve, which is a curve in the XZ plane, is scaled about the origin by the corresponding OIV.Inventor.Nodes.SoExtrusion.scale parameter (first value scales in X, second value scales in Z), rotated about the origin by the corresponding OIV.Inventor.Nodes.SoExtrusion.orientation parameter and translated by the vector defined by the corresponding vertex of the spine curve. Each instance of the cross-section is then connected to the following instance.

The scaleMode field is used to select the points that will be scaled by the current transformation (for example OIV.Inventor.Nodes.SoTransform), if any. Translation and rotation are applied in all cases. The options are:

  • DEFAULT : Every point in the generated geometry is scaled.

  • SPINE_ONLY : Only the spine points are scaled. The cross section points are not scaled, so the cross section shape is undistorted even is scaling is non-uniform.

  • SECTION_ONLY : Only the cross section points are scaled. Not currently implemented.

  • NONE : OIV.Inventor.Nodes.SoExtrusion ignores the scaling state. Not currently implemented.

A transformed cross section is found for each joint (that is, at each vertex of the spine curve, where segments of the extrusion connect), and the joints and segments are connected to form the surface. No check is made for self-penetration. Each transformed cross section is determined as follows:

1. Start with the cross section as specified, in the XZ plane.

2. Scale it about (0, 0, 0) by the value for OIV.Inventor.Nodes.SoExtrusion.scale given for the current joint.

3. Apply a rotation so that when the cross section is placed at its proper location on the spine it will be oriented properly. Essentially, this means that the cross section's Y axis ( up vector coming out of the cross section) is rotated to align with an approximate tangent to the spine curve.

For all points other than the first or last: The tangent for spine[ i ] is found by normalizing the vector defined by (spine[ i +1] - spine[ i -1]).

If the spine curve is closed: The first and last points need to have the same tangent. This tangent is found as above, but using the points spine[0] for spine[ i ], spine[1] for spine[ i +1] and spine[ n -2] for spine[ i -1], where spine[ n -2] is the next to last point on the curve. The last point in the curve, spine[ n -1], is the same as the first, spine[0].

If the spine curve is not closed: The tangent used for the first point is just the direction from spine[0] to spine[1], and the tangent used for the last is the direction from spine[ n -2] to spine[ n -1].

In the simple case where the spine curve is flat in the XY plane, these rotations are all just rotations about the Z axis. In the more general case where the spine curve is any 3D curve, you need to find the destinations for all 3 of the local X, Y, and Z axes so you can completely specify the rotation. The Z axis is found by taking the cross product of:

(spine[ i -1] - spine[ i ]) and (spine[ i +1] - spine[ i ]).

If the three points are collinear then this value is zero, so take the value from the previous point. Once you have the Z axis (from the cross product) and the Y axis (from the approximate tangent), calculate the X axis as the cross product of the Y and Z axes.

4. Given the plane computed in step 3, apply the OIV.Inventor.Nodes.SoExtrusion.orientation to the cross-section relative to this new plane. Rotate it counterclockwise about the axis and by the angle specified in the OIV.Inventor.Nodes.SoExtrusion.orientation field at that joint.

5. Finally, the cross section is translated to the location of the spine point.

Surfaces of revolution: If the cross section is an approximation of a circle and the spine is straight, then the OIV.Inventor.Nodes.SoExtrusion is equivalent to a surface of revolution, where the OIV.Inventor.Nodes.SoExtrusion.scale parameters define the size of the cross section along the spine.

Cookie-cutter extrusions: If the scale is 1, 1 and the spine is straight, then the cross section acts like a cookie cutter, with the thickness of the cookie equal to the length of the spine.

Bend/twist/taper objects: These shapes are the result of using all fields. The spine curve bends the extruded shape defined by the cross section, the orientation parameters twist it around the spine, and the scale parameters taper it (by scaling about the spine).

OIV.Inventor.Nodes.SoExtrusion has three parts: the sides, the beginCap (the surface at the initial end of the spine) and the endCap (the surface at the final end of the spine). The caps have an associated SFBool field that indicates whether it exists (true) or doesn't exist (false).

When the beginCap or endCap fields are specified as true, planar cap surfaces will be generated regardless of whether the OIV.Inventor.Nodes.SoExtrusion.crossSection is a closed curve. (If OIV.Inventor.Nodes.SoExtrusion.crossSection isn't a closed curve, the caps are generated as if it were equivalent to adding a final point to OIV.Inventor.Nodes.SoExtrusion.crossSection that's equal to the initial point. Note that an open surface can still have a cap, resulting (for a simple case) in a shape something like a soda can sliced in half vertically.) These surfaces are generated even if spine is also a closed curve. If a field value is false, the corresponding cap is not generated.

OIV.Inventor.Nodes.SoExtrusion automatically generates its own normals. Orientation of the normals is determined by the vertex ordering of the quads generated by OIV.Inventor.Nodes.SoExtrusion. The vertex ordering is in turn determined by the OIV.Inventor.Nodes.SoExtrusion.crossSection curve. If the OIV.Inventor.Nodes.SoExtrusion.crossSection is counterclockwise when viewed from the +Y axis, then the polygons will have counterclockwise ordering when viewed from 'outside' of the shape (and vice versa for clockwise ordered OIV.Inventor.Nodes.SoExtrusion.crossSection curves).

Texture coordinates are automatically generated by extrusions. Textures are mapped so that the coordinates range in the U direction from 0 to 1 along the OIV.Inventor.Nodes.SoExtrusion.crossSection curve (with 0 corresponding to the first point in OIV.Inventor.Nodes.SoExtrusion.crossSection and 1 to the last) and in the V direction from 0 to 1 along the spine curve (again with 0 corresponding to the first listed spine point and 1 to the last). When OIV.Inventor.Nodes.SoExtrusion.crossSection is closed, the texture has a seam that follows the line traced by the OIV.Inventor.Nodes.SoExtrusion.crossSection's start/end point as it travels along the spine. If the endCap and/or beginCap exist, the OIV.Inventor.Nodes.SoExtrusion.crossSection curve is uniformly scaled and translated so that the largest dimension of the cross-section (X or Z) produces texture coordinates that range from 0.0 to 1.0. The beginCap and endCap textures' S and T directions correspond to the X and Z directions in which the OIV.Inventor.Nodes.SoExtrusion.crossSection coordinates are defined.

Also 3D texture coordinates are automatically generated, in a similar way to 2D textures.

NOTE: If your extrusion appears to twist unexpectedly, try setting environment variable OIV_EXTRUSION_EPSILON to a value slightly smaller number than the default, which is .998.

NOTE: If your OIV.Inventor.Nodes.SoExtrusion.crossSection is not convex, you must use a OIV.Inventor.Nodes.SoShapeHints and set the faceType field to UNKNOWN_FACE_TYPE.

FILE FORMAT/DEFAULT

Extrusion {
beginCap true
endCap true
spine [ 0 0 0, 0 1 0 ]
scaleMode DEFAULT
crossSection [ 1 1, 1 -1, -1 -1, -1 1, 1 1 ]
orientation 0 0 1 0
scale 1 1
}

See Also