SoVRMLExtrusion(3)

πŸ“¦ version 3.1.3, in fedora 43, fedora 44

✨ SoVRMLExtrusion ✨

okay so. You opened SoVRMLExtrusion(3), straight out of the Library Functions Manual section, and bestie… it's a whole vibe. Buckle up, hydrate, and let's read her together. 🫢


🌸 NAME 🌸

SoVRMLExtrusion β€” she's a geometry node for extruding a cross section along a spine. πŸ¦‹

not the manpage calling her "a a geometry node" πŸ’€ yes she said it twice, we love a queen with a stutter, moving on.

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <Inventor/VRMLnodes/SoVRMLExtrusion.h>

Inherits SoVRMLGeometry.


πŸ’… Public Member Functions πŸ’…

  • virtual SoType getTypeId (void) const β€” the "who even am I" check, type-wise. Hands you back an SoType. It's virtual, so she can be overridden by her heirs. πŸ’–
  • SoVRMLExtrusion (void) β€” the constructor. No arguments, she just arrives. πŸ‘‘
  • virtual void GLRender (SoGLRenderAction *action) β€” the render moment. Takes an SoGLRenderAction * and does the drawing thing.
  • virtual void getPrimitiveCount (SoGetPrimitiveCountAction *action) β€” counts up the primitives for you, handed an SoGetPrimitiveCountAction *.
  • virtual void computeBBox (SoAction *action, SbBox3f &bbox, SbVec3f &center) β€” works out the bounding box and drops the results into bbox and center. ✨

🫢 Public Member Functions inherited from SoVRMLGeometry

  • virtual void search (SoSearchAction *action) β€” the search behaviour, inherited and still slaying.
  • virtual void copyContents (const SoFieldContainer *from, SbBool copyConn) β€” copies the contents over, copyConn deciding about connections.

🫢 Public Member Functions inherited from SoShape

  • virtual SbBool affectsState (void) const β€” returns whether she touches the state, as an SbBool.
  • virtual void getBoundingBox (SoGetBoundingBoxAction *action) β€” the bounding box action handler.
  • virtual void rayPick (SoRayPickAction *action) β€” ray picking, SoRayPickAction * and all.
  • virtual void callback (SoCallbackAction *action) β€” the callback action handler.
  • const SoBoundingBoxCache * getBoundingBoxCache (void) const β€” hands you back the SoBoundingBoxCache *. Lowkey the receipts. 🧾

🫢 Public Member Functions inherited from SoNode

  • void setOverride (const SbBool state) β€” flips the override state.
  • SbBool isOverride (void) const β€” is she overriding? asks politely, returns SbBool.
  • void setNodeType (const NodeType type) β€” sets the node type.
  • NodeType getNodeType (void) const β€” gets the node type back.
  • virtual SoNode * copy (SbBool copyconnections=FALSE) const β€” copies the node; copyconnections defaults to FALSE.
  • virtual void doAction (SoAction *action) β€” the general "do the action" entry point.
  • virtual void GLRenderBelowPath (SoGLRenderAction *action) β€” GL render, below path.
  • virtual void GLRenderInPath (SoGLRenderAction *action) β€” GL render, in path.
  • virtual void GLRenderOffPath (SoGLRenderAction *action) β€” GL render, off path.
  • virtual void getMatrix (SoGetMatrixAction *action) β€” matrix acquisition.
  • virtual void handleEvent (SoHandleEventAction *action) β€” event handling.
  • virtual void pick (SoPickAction *action) β€” the picking entry point.
  • virtual void write (SoWriteAction *action) β€” writes her out.
  • virtual void audioRender (SoAudioRenderAction *action) β€” audio render, yes she does that too 🎧
  • virtual void grabEventsSetup (void) β€” sets up event grabbing.
  • virtual void grabEventsCleanup (void) β€” cleans up after event grabbing. always clean up after yourself bestie πŸ’…
  • virtual void startNotify (void) β€” kicks off notification.
  • uint32_t getNodeId (void) const β€” returns the node id as a uint32_t.
  • virtual void writeInstance (SoOutput *out) β€” writes an instance out to SoOutput *out.
  • virtual SoNode * addToCopyDict (void) const β€” adds herself to the copy dictionary, returns SoNode *.
  • virtual SoFieldContainer * copyThroughConnection (void) const β€” copies through a connection, returns SoFieldContainer *.

🫢 Public Member Functions inherited from SoFieldContainer

  • void setToDefaults (void) β€” resets everything to defaults. the factory reset energy 😭
  • SbBool hasDefaultValues (void) const β€” are all the values default? SbBool says hi.
  • SbBool fieldsAreEqual (const SoFieldContainer *container) const β€” compares fields against another container.
  • void copyFieldValues (const SoFieldContainer *container, SbBool copyconnections=FALSE) β€” copies field values from container; copyconnections defaults to FALSE.
  • SbBool set (const char *const fielddata) β€” sets from a fielddata string.
  • void get (SbString &fielddata) β€” gets the data into an SbString &.
  • virtual int getFields (SoFieldList &l) const β€” fills l, returns an int count.
  • virtual int getAllFields (SoFieldList &l) const β€” same energy, all the fields, returns int.
  • virtual SoField * getField (const SbName &name) const β€” grab a field by name.
  • virtual SoField * getEventIn (const SbName &name) const β€” grab an event-in by name.
  • virtual SoField * getEventOut (const SbName &name) const β€” grab an event-out by name.
  • SbBool getFieldName (const SoField *const field, SbName &name) const β€” reverse lookup: field goes in, name comes out, SbBool says whether it worked.
  • SbBool enableNotify (const SbBool flag) β€” toggles notification with flag.
  • SbBool isNotifyEnabled (void) const β€” is notification on? SbBool.
  • SbBool set (const char *fielddata, SoInput *input) β€” sets from fielddata using an SoInput *input.
  • void get (SbString &fielddata, SoOutput *out) β€” gets into fielddata using an SoOutput *out.
  • virtual SbBool validateNewFieldValue (SoField *field, void *newval) β€” sanity-checks a new value for field.
  • virtual void addWriteReference (SoOutput *out, SbBool isfromfield=FALSE) β€” adds a write reference; isfromfield defaults to FALSE.
  • SbBool getIsBuiltIn (void) const β€” built-in or not, as an SbBool.
  • virtual void getFieldsMemorySize (size_t &managed, size_t &unmanaged) const β€” reports memory sizes into managed and unmanaged.
  • void setUserData (void *userdata) const β€” stash your userdata.
  • void * getUserData (void) const β€” get your userdata back out.

🫢 Public Member Functions inherited from SoBase

  • void ref (void) const β€” bumps the reference count. iconic behaviour.
  • void unref (void) const β€” drops the reference count.
  • void unrefNoDelete (void) const β€” unrefs but does not delete. read that again 🫠
  • int32_t getRefCount (void) const β€” returns the ref count as an int32_t.
  • void touch (void) β€” touches her, notification-wise.
  • SbBool isOfType (SoType type) const β€” is she of type? SbBool.
  • virtual SbName getName (void) const β€” returns the name as an SbName.
  • virtual void setName (const SbName &newname) β€” sets a newname.
  • void addAuditor (void *const auditor, const SoNotRec::Type type) β€” adds an auditor of type.
  • void removeAuditor (void *const auditor, const SoNotRec::Type type) β€” removes that auditor.
  • const SoAuditorList & getAuditors (void) const β€” returns the auditor list.
  • SbBool shouldWrite (void) β€” should she be written? SbBool.
  • void assertAlive (void) const β€” asserts she's alive. drama, but valid πŸ’€

πŸ‘‘ Static Public Member Functions πŸ‘‘

  • static SoType getClassTypeId (void) β€” the class-level type id.
  • static void initClass (void) β€” initialises the class. the glow-up ritual ✨

🫢 Static Public Member Functions inherited from SoVRMLGeometry

  • static SoType getClassTypeId (void) β€” class type id, inherited.
  • static void initClass (void) β€” class init, inherited.

🫢 Static Public Member Functions inherited from SoShape

  • static SoType getClassTypeId (void) β€” class type id.
  • static void initClass (void) β€” class init.
  • static void getScreenSize (SoState *const state, const SbBox3f &boundingbox, SbVec2s &rectsize) β€” screen size from a state and a boundingbox, into rectsize.
  • static float getDecimatedComplexity (SoState *state, float complexity) β€” decimated complexity as a float.

🫢 Static Public Member Functions inherited from SoNode

  • static uint32_t getCompatibilityTypes (const SoType &nodetype) β€” compatibility types for a nodetype.
  • static SoType getClassTypeId (void) β€” class type id.
  • static SoNode * getByName (const SbName &name) β€” look up a node by name.
  • static int getByName (const SbName &name, SoNodeList &l) β€” look up by name and collect into l, returns an int.
  • static void initClass (void) β€” class init.
  • static void initClasses (void) β€” all the classes. plural. she's doing overtime 😭
  • static uint32_t getNextNodeId (void) β€” the next node id.
  • static int getActionMethodIndex (const SoType type) β€” action method index for type.
  • static void getBoundingBoxS (SoAction *action, SoNode *node) β€” the static bounding box dispatcher.
  • static void GLRenderS (SoAction *action, SoNode *node) β€” static GL render dispatcher.
  • static void callbackS (SoAction *action, SoNode *node) β€” static callback dispatcher.
  • static void getMatrixS (SoAction *action, SoNode *node) β€” static get matrix dispatcher.
  • static void handleEventS (SoAction *action, SoNode *node) β€” static handle event dispatcher.
  • static void pickS (SoAction *action, SoNode *node) β€” static pick dispatcher.
  • static void rayPickS (SoAction *action, SoNode *node) β€” static ray pick dispatcher.
  • static void searchS (SoAction *action, SoNode *node) β€” static search dispatcher.
  • static void writeS (SoAction *action, SoNode *node) β€” static write dispatcher.
  • static void audioRenderS (SoAction *action, SoNode *node) β€” static audio render dispatcher.
  • static void getPrimitiveCountS (SoAction *action, SoNode *node) β€” static primitive count dispatcher.

🫢 Static Public Member Functions inherited from SoFieldContainer

  • static void initClass (void) β€” class init.
  • static SoType getClassTypeId (void) β€” class type id.
  • static void cleanupClass (void) β€” cleanup. the after-party sweep 🧹
  • static void initCopyDict (void) β€” sets up the copy dictionary.
  • static void addCopy (const SoFieldContainer *orig, const SoFieldContainer *copy) β€” registers a copy against its orig.
  • static SoFieldContainer * checkCopy (const SoFieldContainer *orig) β€” checks a copy for orig.
  • static SoFieldContainer * findCopy (const SoFieldContainer *orig, const SbBool copyconnections) β€” finds the copy of orig, with copyconnections.
  • static void copyDone (void) β€” copying is done, bestie. wrap it up.

🫢 Static Public Member Functions inherited from SoBase

  • static void initClass (void) β€” class init.
  • static SoType getClassTypeId (void) β€” class type id.
  • static void addName (SoBase *const base, const char *const name) β€” names a base with name.
  • static void removeName (SoBase *const base, const char *const name) β€” un-names that base.
  • static void incrementCurrentWriteCounter (void) β€” bumps the current write counter.
  • static void decrementCurrentWriteCounter (void) β€” drops the current write counter.
  • static SoBase * getNamedBase (const SbName &name, SoType type) β€” fetch a named base of type.
  • static int getNamedBases (const SbName &name, SoBaseList &baselist, SoType type) β€” collect named bases into baselist, returns int.
  • static SbBool read (SoInput *input, SoBase *&base, SoType expectedtype) β€” read from input into base, expecting expectedtype.
  • static void setInstancePrefix (const SbString &c) β€” sets the instance prefix.
  • static void setTraceRefs (SbBool trace) β€” turns ref tracing on or off.
  • static SbBool getTraceRefs (void) β€” is ref tracing on? SbBool.
  • static SbBool connectRoute (SoInput *input, const SbName &fromnodename, const SbName &fromfieldname, const SbName &tonodename, const SbName &tofieldname) β€” wires a route from fromnodename/fromfieldname to tonodename/tofieldname.
  • static SbBool readRoute (SoInput *input) β€” reads a route from input.

πŸŽ€ Public Attributes πŸŽ€

  • SoSFBool beginCap β€” a bool field, for the begin cap.
  • SoSFBool ccw β€” a bool field, ccw.
  • SoSFBool convex β€” a bool field, convex.
  • SoSFFloat creaseAngle β€” a float field, creaseAngle.
  • SoMFVec2f crossSection β€” the multi-value 2D vector field for the cross section. the star of the show, honestly πŸ’–
  • SoSFBool endCap β€” a bool field, for the end cap.
  • SoMFRotation orientation β€” multi-value rotations.
  • SoMFVec2f scale β€” multi-value 2D vector scales.
  • SoSFBool solid β€” a bool field, solid.
  • SoMFVec3f spine β€” the multi-value 3D vector field for the spine. extrude along her 🦴

πŸ”’ Protected Member Functions πŸ”’

  • virtual const SoFieldData * getFieldData (void) const β€” hands over the field data.
  • virtual ~SoVRMLExtrusion () β€” the destructor. protected, so only the family gets to do this πŸ₯²
  • virtual void notify (SoNotList *list) β€” notification, with a list.
  • virtual void generatePrimitives (SoAction *action) β€” generates the primitives.
  • virtual SoDetail * createTriangleDetail (SoRayPickAction *action, const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2, const SoPrimitiveVertex *v3, SoPickedPoint *pp) β€” builds triangle detail out of v1, v2, v3.

πŸ”’ Protected Member Functions inherited from SoVRMLGeometry

  • SoVRMLGeometry (void) β€” constructor.
  • virtual ~SoVRMLGeometry () β€” destructor.
  • void setupShapeHints (SoState *state, const SbBool ccw, const SbBool solid) β€” sets up shape hints with ccw and solid.
  • virtual SbBool shouldGLRender (SoGLRenderAction *action) β€” should she GL render? SbBool.
  • virtual SoChildList * getChildren (void) const β€” returns the child list.

πŸ”’ Protected Member Functions inherited from SoShape

  • SoShape (void) β€” constructor.
  • virtual ~SoShape () β€” destructor.
  • float getComplexityValue (SoAction *action) β€” the complexity value, as a float.
  • void beginSolidShape (SoGLRenderAction *action) β€” begins a solid shape.
  • void endSolidShape (SoGLRenderAction *action) β€” ends a solid shape.
  • void GLRenderBoundingBox (SoGLRenderAction *action) β€” renders the bounding box.
  • SbBool shouldPrimitiveCount (SoGetPrimitiveCountAction *action) β€” should she count primitives? SbBool.
  • SbBool shouldRayPick (SoRayPickAction *const action) β€” should she ray pick? SbBool.
  • void computeObjectSpaceRay (SoRayPickAction *const action) β€” computes the object space ray.
  • void computeObjectSpaceRay (SoRayPickAction *const action, const SbMatrix &matrix) β€” same, but with a matrix.
  • virtual SoDetail * createLineSegmentDetail (SoRayPickAction *action, const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2, SoPickedPoint *pp) β€” line segment detail from v1 and v2.
  • virtual SoDetail * createPointDetail (SoRayPickAction *action, const SoPrimitiveVertex *v, SoPickedPoint *pp) β€” point detail from v.
  • void invokeTriangleCallbacks (SoAction *const action, const SoPrimitiveVertex *const v1, const SoPrimitiveVertex *const v2, const SoPrimitiveVertex *const v3) β€” fires the triangle callbacks.
  • void invokeLineSegmentCallbacks (SoAction *const action, const SoPrimitiveVertex *const v1, const SoPrimitiveVertex *const v2) β€” fires the line segment callbacks.
  • void invokePointCallbacks (SoAction *const action, const SoPrimitiveVertex *const v) β€” fires the point callbacks.
  • void beginShape (SoAction *const action, const TriangleShape shapetype, SoDetail *const detail=NULL) β€” begins a shape; detail defaults to NULL.
  • void shapeVertex (const SoPrimitiveVertex *const v) β€” feeds a vertex in.
  • void endShape (void) β€” ends the shape.
  • void generateVertex (SoPrimitiveVertex *const pv, const SbVec3f &point, const SbBool useTexFunc, const SoTextureCoordinateElement *const tce, const float s, const float t, const SbVec3f &normal) β€” generates a vertex from point, useTexFunc, tce, s, t and normal.
  • void generateVertex (SoPrimitiveVertex *const pv, const SbVec3f &point, const SbBool useTexFunc, const SoTextureCoordinateElement *const tce, const float s, const float t, const float r, const SbVec3f &normal) β€” the three-coordinate version: s, t, r, plus normal.
  • SbBool startVertexArray (SoGLRenderAction *action, const SoCoordinateElement *coords, const SbVec3f *pervertexnormals, const SbBool texpervertex, const SbBool colorpervertex) β€” starts a vertex array.
  • void finishVertexArray (SoGLRenderAction *action, const SbBool vbo, const SbBool normpervertex, const SbBool texpervertex, const SbBool colorpervertex) β€” finishes that vertex array.

πŸ”’ Protected Member Functions inherited from SoNode

  • SoNode (void) β€” constructor.
  • virtual ~SoNode () β€” destructor.
  • virtual SbBool readInstance (SoInput *in, unsigned short flags) β€” reads an instance from in with flags.

πŸ”’ Protected Member Functions inherited from SoFieldContainer

  • SoFieldContainer (void) β€” constructor.
  • virtual ~SoFieldContainer () β€” destructor.

πŸ”’ Protected Member Functions inherited from SoBase

  • SoBase (void) β€” constructor.
  • virtual ~SoBase () β€” destructor.
  • virtual void destroy (void) β€” destroys.
  • SbBool hasMultipleWriteRefs (void) const β€” multiple write refs or not, SbBool.
  • SbBool writeHeader (SoOutput *out, SbBool isgroup, SbBool isengine) const β€” writes the header; isgroup and isengine in play.
  • void writeFooter (SoOutput *out) const β€” writes the footer.
  • virtual const char * getFileFormatName (void) const β€” the file format name, as a const char *.

πŸ”’ Static Protected Member Functions πŸ”’

  • static const SoFieldData ** getFieldDataPtr (void) β€” the field data pointer-pointer. yes, double pointer. she's extra like that πŸ’…

and that's literally just the synopsis bestie 😭 the lore continues…

✨ Static Protected Member Functions inherited from SoVRMLGeometry

  • static const SoFieldData ** getFieldDataPtr (void) β€” yeah she's still pulling the field data pointer, bestie, same energy as always πŸ’…

🌸 Static Protected Member Functions inherited from SoShape

  • static const SoFieldData ** getFieldDataPtr (void) β€” yep, same one, inherited down the chain, no notes ✨

πŸ¦‹ Static Protected Member Functions inherited from SoNode

  • static const SoFieldData ** getFieldDataPtr (void) β€” the classic, again, iconic behavior honestly
  • static void setNextActionMethodIndex (int index) β€” sets that next action method index, takes an int index
  • static int getNextActionMethodIndex (void) β€” reads it back out as an int
  • static void incNextActionMethodIndex (void) β€” bumps it up, no args, just vibes
  • static void setCompatibilityTypes (const SoType &nodetype, const uint32_t bitmask) β€” takes a const SoType &nodetype and a const uint32_t bitmask, sets the compat types fr fr

πŸŽ€ Static Protected Member Functions inherited from SoBase

  • static uint32_t getCurrentWriteCounter (void) β€” hands you the current write counter as a uint32_t
  • static void staticDataLock (void) β€” locks the static data, periodt
  • static void staticDataUnlock (void) β€” unlocks it, the matching slay 🫢

πŸ’– Additional Inherited Members

okay so this is the "and also everything your ancestors left you" section, lowkey the biggest glow-up inheritance in the whole page 🧚

🌈 Public Types inherited from SoShape

  • enum TriangleShape β€” the whole lineup, in this exact order:
TRIANGLE_STRIP, TRIANGLE_FAN, TRIANGLES, POLYGON, QUADS, QUAD_STRIP, POINTS, LINES, LINE_STRIP

⭐ Public Types inherited from SoNode

  • enum NodeType β€” the entire roster with all their hex values, and yes every single one matters, don't skip a single one bestie:
INVENTOR = 0x0000, VRML1 = 0x0001, VRML2 = 0x0002,
INVENTOR_1 = 0x0004, INVENTOR_2_0 = 0x0008, INVENTOR_2_1 = 0x0010,
INVENTOR_2_5 = 0x0020, INVENTOR_2_6 = 0x0040, COIN_1_0 = 0x0080,
COIN_2_0 = 0x0100, EXTENSION = 0x0200, COIN_2_2 = 0x0400,
COIN_2_3 = 0x0800, COIN_2_4 = 0x1000, INVENTOR_5_0 = 0x2000,
COIN_2_5 = 0x4000, COIN_3_0 = 0x8000, INVENTOR_6_0 = 0x10000

🌸 Protected Types inherited from SoBase

  • enum BaseFlags β€” two flags, and that's the whole menu:
IS_ENGINE = 0x01, IS_GROUP = 0x02

πŸ’œ Protected Attributes inherited from SoNode

  • uint32_t uniqueId β€” your very own uint32_t unique id, main character energy for real

πŸŽ€ Protected Attributes inherited from SoFieldContainer

  • SbBool isBuiltIn β€” an SbBool called isBuiltIn, telling you whether you're built-in or not

πŸ¦‹ Static Protected Attributes inherited from SoNode

  • static uint32_t nextUniqueId = 1 β€” starts at 1, defaults are sacred
  • static int nextActionMethodIndex = 0 β€” starts at 0, no cap

okay reminder that all of this is inherited stuff, so it comes along for free β€” you didn't have to write it, it just showed up πŸ’…

🌈 Detailed Description 🌈

okay bestie, gather round, because SoVRMLExtrusion is a geometry node for extruding a cross section along a spine. that's the whole vibe. you take a lil 2D shape, you drag it along a 3D path, and boom πŸ’₯ you got a surface. iconic behavior honestly.

the detailed class documentation is taken verbatim from the VRML97 standard (ISO/IEC 14772-1:1997). it is copyright The Web3D Consortium, and is used by permission of the Consortium:

Extrusion {
  eventIn MFVec2f    set_crossSection
  eventIn MFRotation set_orientation
  eventIn MFVec2f    set_scale
  eventIn MFVec3f    set_spine
  field   SFBool     beginCap         TRUE
  field   SFBool     ccw              TRUE
  field   SFBool     convex           TRUE
  field   SFFloat    creaseAngle      0                # [0,inf)
  field   MFVec2f    crossSection     [ 1 1, 1 -1, -1 -1, -1 1, 1  1 ]    # (-inf,inf)
  field   SFBool     endCap           TRUE
  field   MFRotation orientation      0 0 1 0          # [-1,1],(-inf,inf)
  field   MFVec2f    scale            1 1              # (0,inf)
  field   SFBool     solid            TRUE
  field   MFVec3f    spine            [ 0 0 0, 0 1 0 ] # (-inf,inf)
}

✨ Introduction ✨

the Extrusion node specifies geometric shapes based on a two dimensional cross-section extruded along a three dimensional spine in the local coordinate system. the cross-section can be scaled and rotated at each spine point to produce a wide variety of shapes. an Extrusion node is defined by:

  • a 2D crossSection piecewise linear curve (described as a series of connected vertices);
  • a 3D spine piecewise linear curve (also described as a series of connected vertices);
  • a list of 2D scale parameters;
  • a list of 3D orientation parameters.

πŸŒ€ Algorithmic description πŸŒ€

shapes are constructed as follows, and bestie this part is the whole tea 🍡. the cross-section curve, which starts as a curve in the Y=0 plane, is first scaled about the origin by the first scale parameter (first value scales in X, second value scales in Z). it is then translated by the first spine point and oriented using the first orientation parameter (as explained later). the same procedure is followed to place a cross-section at the second spine point, using the second scale and orientation values. corresponding vertices of the first and second cross-sections are then connected, forming a quadrilateral polygon between each pair of vertices. this same procedure is then repeated for the rest of the spine points, resulting in a surface extrusion along the spine. periodt.

the final orientation of each cross-section is computed by first orienting it relative to the spine segments on either side of point at which the cross-section is placed. this is known as the spine-aligned cross-section plane (SCP), and is designed to provide a smooth transition from one spine segment to the next (see Figure 6.6). the SCP is then rotated by the corresponding orientation value. this rotation is performed relative to the SCP. for example, to impart twist in the cross-section, a rotation about the Y-axis (0 1 0) would be used. other orientations are valid and rotate the cross-section out of the SCP. slay.

Figure 6.6

the SCP is computed by first computing its Y-axis and Z-axis, then taking the cross product of these to determine the X-axis. these three axes are then used to determine the rotation value needed to rotate the Y=0 plane to the SCP. this results in a plane that is the approximate tangent of the spine at each point, as shown in Figure 6.6. first the Y-axis is determined, as follows:

let n be the number of spines and let i be the index variable satisfying 0 <= i < n:

  • for all points other than the first or last: the Y-axis for spine[i] is found by normalizing the vector defined by (spine[i+1] β€’ spine[i-1]).
  • if the spine curve is closed: the SCP for the first and last points is the same and is found using (spine[1] - spine[n-2]) to compute the Y-axis.
  • if the spine curve is not closed: the Y-axis used for the first point is the vector from spine[0] to spine[1], and for the last it is the vector from spine[n-2] to spine[n-1].

the Z-axis is determined as follows:

  • for all points other than the first or last: take the following cross-product:
Z = (spine[i+1] - spine[i]) Γ— (spine[i-1] - spine[i])
  • if the spine curve is closed: the SCP for the first and last points is the same and is found by taking the following cross-product:
Z = (spine[1] - spine[0]) Γ— (spine[n-2] - spine[0])
  • if the spine curve is not closed: the Z-axis used for the first spine point is the same as the Z-axis for spine[1]. the Z-axis used for the last spine point is the same as the Z-axis for spine[n-2].
  • after determining the Z-axis, its dot product with the Z-axis of the previous spine point is computed. if this value is negative, the Z-axis is flipped (multiplied by -1). in most cases, this prevents small changes in the spine segment angles from flipping the cross-section 180 degrees. πŸ’€

once the Y- and Z-axes have been computed, the X-axis can be calculated as their cross-product.

πŸŽ€ Special Cases πŸŽ€

if the number of scale or orientation values is greater than the number of spine points, the excess values are ignored. if they contain one value, it is applied at all spine points. the results are undefined if the number of scale or orientation values is greater than one but less than the number of spine points. the scale values shall be positive. (yes bestie, shall. it's giving legal.)

if the three points used in computing the Z-axis are collinear, the cross-product is zero so the value from the previous point is used instead. if the Z-axis of the first point is undefined (because the spine is not closed and the first two spine segments are collinear) then the Z-axis for the first spine point with a defined Z-axis is used.

if the entire spine is collinear, the SCP is computed by finding the rotation of a vector along the positive Y-axis (v1) to the vector formed by the spine points (v2). the Y=0 plane is then rotated by this value. if two points are coincident, they both have the same SCP. if each point has a different orientation value, then the surface is constructed by connecting edges of the cross-sections as normal. this is useful in creating revolved surfaces. ✨

Note: combining coincident and non-coincident spine segments, as well as other combinations, can lead to interpenetrating surfaces which the extrusion algorithm makes no attempt to avoid. so like. be normal about it.

🌟 Common Cases 🌟

the following common cases are among the effects which are supported by the Extrusion node:

  • Surfaces of revolution: if the cross-section is an approximation of a circle and the spine is straight, the Extrusion is equivalent to a surface of revolution, where the scale parameters define the size of the cross-section along the spine.
  • Uniform extrusions: if the scale is (1, 1) and the spine is straight, the cross-section is extruded uniformly without twisting or scaling along the spine. the result is a cylindrical shape with a uniform cross section.
  • 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 (given as rotations about the Y-axis) twist it around the spine, and the scale parameters taper it (by scaling about the spine).

πŸ¦‹ Other Fields πŸ¦‹

Extrusion 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 each 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 crossSection is a closed curve. if crossSection is not a closed curve, the caps are generated by adding a final point to crossSection that is equal to the initial point. an open surface can still have a cap, resulting (for a simple case) in a shape analogous to 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.

texture coordinates are automatically generated by Extrusion nodes. textures are mapped so that the coordinates range in the U direction from 0 to 1 along the crossSection curve (with 0 corresponding to the first point in crossSection and 1 to the last) and in the V direction from 0 to 1 along the spine curve (with 0 corresponding to the first listed spine point and 1 to the last). if either the endCap or beginCap exists, the crossSection curve is uniformly scaled and translated so that the larger 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 crossSection coordinates are defined.

the browser shall automatically generate normals for the Extrusion node, using the creaseAngle field to determine if and how normals are smoothed across the surface. normals for the caps are generated along the Y-axis of the SCP, with the ordering determined by viewing the cross-section from above (looking along the negative Y-axis of the SCP). by default, a beginCap with a counterclockwise ordering shall have a normal along the negative Y-axis. an endCap with a counterclockwise ordering shall have a normal along the positive Y-axis.

each quadrilateral making up the sides of the extrusion are ordered from the bottom cross-section (the one at the earlier spine point) to the top. so, one quadrilateral has the points:

spine[0](crossSection[0], crossSection[1])
spine[1](crossSection[1], crossSection[0])

in that order. by default, normals for the sides are generated as described in 4.6.3, Shapes and geometry (http://www.web3d.org/x3d/specifications/vrml/ISO-IEC-14772-VRML97/part1/concepts.html#4.6.3).

for instance, a circular crossSection with counter-clockwise ordering and the default spine form a cylinder. with solid TRUE and ccw TRUE, the cylinder is visible from the outside. changing ccw to FALSE makes it visible from the inside. the ccw, solid, convex, and creaseAngle fields are described in 4.6.3, Shapes and geometry (http://www.web3d.org/x3d/specifications/vrml/ISO-IEC-14772-VRML97/part1/concepts.html#4.6.3).


🫢 Constructor & Destructor Documentation 🫢

SoVRMLExtrusion::SoVRMLExtrusion (void )

Constructor. πŸŽ€

SoVRMLExtrusion::~SoVRMLExtrusion () [protected], [virtual]

Destructor. πŸ¦‹

✨ Member Function Documentation ✨


SoType SoVRMLExtrusion::getTypeId (void ) const [virtual]

Okay bestie, this one is literally the type-ID queen. It returns the type identification of an object derived from a class inheriting SoBase. It's used for run-time type checking and "downward" casting. πŸ’…

Usage example:

void foo(SoNode * node)
{
  if (node->getTypeId() == SoFile::getClassTypeId()) {
    SoFile * filenode = (SoFile *)node;  // safe downward cast, knows the type
  }
}

For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance Inventor/nodes/SoSubNode.h (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine.h (for engine classes) and so on.

For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups.

Reimplemented from SoVRMLGeometry.

const SoFieldData * SoVRMLExtrusion::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. Lowkey simple, highkey important. 🫢

Reimplemented from SoVRMLGeometry.

void SoVRMLExtrusion::GLRender (SoGLRenderAction * action) [virtual]

Action method for the SoGLRenderAction.

This is called during rendering traversals. Nodes influencing the rendering state in any way or who wants to throw geometry primitives at OpenGL overrides this method. πŸ”₯

Reimplemented from SoShape.

void SoVRMLExtrusion::getPrimitiveCount (SoGetPrimitiveCountAction * action) [virtual]

Action method for the SoGetPrimitiveCountAction.

Calculates the number of triangle, line segment and point primitives for the node and adds these to the counters of the action. 🌈

Nodes influencing how geometry nodes calculates their primitive count also overrides this method to change the relevant state variables.

Reimplemented from SoShape.

void SoVRMLExtrusion::computeBBox (SoAction * action, SbBox3f & box, SbVec3f & center) [virtual]

Implemented by SoShape subclasses to let the SoShape superclass know the exact size and weighted center point of the shape's bounding box. ✨

The bounding box and center point should be calculated and returned in the local coordinate system.

The method implements action behavior for shape nodes for SoGetBoundingBoxAction. It is invoked from SoShape::getBoundingBox(). (Subclasses should not override SoNode::getBoundingBox().)

The box parameter sent in is guaranteed to be an empty box, while center is undefined upon function entry.

Implements SoShape.

void SoVRMLExtrusion::notify (SoNotList * l) [protected], [virtual]

Notifies all auditors for this instance when changes are made. It's giving "hey bestie, something changed" energy. πŸ””

Reimplemented from SoVRMLGeometry.

void SoVRMLExtrusion::generatePrimitives (SoAction * action) [protected], [virtual]

The method implements action behavior for shape nodes for SoCallbackAction. It is invoked from SoShape::callback(). (Subclasses should not override SoNode::callback().)

The subclass implementations uses the convenience methods SoShape::beginShape(), SoShape::shapeVertex(), and SoShape::endShape(), with SoDetail instances, to pass the primitives making up the shape back to the caller. πŸ¦‹

Implements SoShape.

SoDetail * SoVRMLExtrusion::createTriangleDetail (SoRayPickAction * action, const SoPrimitiveVertex * v1, const SoPrimitiveVertex * v2, const SoPrimitiveVertex * v3, SoPickedPoint * pp) [protected], [virtual]

Will create triangle detail for a SoPickedPoint. This method will only be called internally, when generatePrimitives() is used for picking (SoShape::rayPick() is not overridden).

This method returns NULL in Open Inventor, and subclasses will need to override this method to create details for a SoPickedPoint.

This is not necessary with Coin. Of course, if you choose to override it, it will work in the same way as Open Inventor.

For this to work, you must supply a face or line detail when generating primitives. If you supply NULL for the detail argument in SoShape::beginShape(), you'll have to override this method. πŸ•΅οΈ

Reimplemented from SoShape.

Author

Generated automatically by Doxygen for Coin from the source code. πŸ“œ


Coin, Version 3.1.3, SoVRMLExtrusion(3) β€” that's the whole page, bestie. No cap, the footer said so. πŸ’…βœ¨

πŸ“¦ where this page comes from