SoVRMLExtrusion(3)
β¨ 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 anSoType. It'svirtual, 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 anSoGLRenderAction *and does the drawing thing.virtual void getPrimitiveCount (SoGetPrimitiveCountAction *action)β counts up the primitives for you, handed anSoGetPrimitiveCountAction *.virtual void computeBBox (SoAction *action, SbBox3f &bbox, SbVec3f ¢er)β works out the bounding box and drops the results intobboxandcenter. β¨
π«Ά 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,copyConndeciding about connections.
π«Ά Public Member Functions inherited from SoShape
virtual SbBool affectsState (void) constβ returns whether she touches the state, as anSbBool.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 theSoBoundingBoxCache *. Lowkey the receipts. π§Ύ
π«Ά Public Member Functions inherited from SoNode
void setOverride (const SbBool state)β flips the overridestate.SbBool isOverride (void) constβ is she overriding? asks politely, returnsSbBool.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;copyconnectionsdefaults toFALSE.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 auint32_t.virtual void writeInstance (SoOutput *out)β writes an instance out toSoOutput *out.virtual SoNode * addToCopyDict (void) constβ adds herself to the copy dictionary, returnsSoNode *.virtual SoFieldContainer * copyThroughConnection (void) constβ copies through a connection, returnsSoFieldContainer *.
π«Ά 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?SbBoolsays hi.SbBool fieldsAreEqual (const SoFieldContainer *container) constβ compares fields against anothercontainer.void copyFieldValues (const SoFieldContainer *container, SbBool copyconnections=FALSE)β copies field values fromcontainer;copyconnectionsdefaults toFALSE.SbBool set (const char *const fielddata)β sets from afielddatastring.void get (SbString &fielddata)β gets the data into anSbString &.virtual int getFields (SoFieldList &l) constβ fillsl, returns anintcount.virtual int getAllFields (SoFieldList &l) constβ same energy, all the fields, returnsint.virtual SoField * getField (const SbName &name) constβ grab a field byname.virtual SoField * getEventIn (const SbName &name) constβ grab an event-in byname.virtual SoField * getEventOut (const SbName &name) constβ grab an event-out byname.SbBool getFieldName (const SoField *const field, SbName &name) constβ reverse lookup: field goes in,namecomes out,SbBoolsays whether it worked.SbBool enableNotify (const SbBool flag)β toggles notification withflag.SbBool isNotifyEnabled (void) constβ is notification on?SbBool.SbBool set (const char *fielddata, SoInput *input)β sets fromfielddatausing anSoInput *input.void get (SbString &fielddata, SoOutput *out)β gets intofielddatausing anSoOutput *out.virtual SbBool validateNewFieldValue (SoField *field, void *newval)β sanity-checks a new value forfield.virtual void addWriteReference (SoOutput *out, SbBool isfromfield=FALSE)β adds a write reference;isfromfielddefaults toFALSE.SbBool getIsBuiltIn (void) constβ built-in or not, as anSbBool.virtual void getFieldsMemorySize (size_t &managed, size_t &unmanaged) constβ reports memory sizes intomanagedandunmanaged.void setUserData (void *userdata) constβ stash youruserdata.void * getUserData (void) constβ get youruserdataback 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 anint32_t.void touch (void)β touches her, notification-wise.SbBool isOfType (SoType type) constβ is she oftype?SbBool.virtual SbName getName (void) constβ returns the name as anSbName.virtual void setName (const SbName &newname)β sets anewname.void addAuditor (void *const auditor, const SoNotRec::Type type)β adds anauditoroftype.void removeAuditor (void *const auditor, const SoNotRec::Type type)β removes thatauditor.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 astateand aboundingbox, intorectsize.static float getDecimatedComplexity (SoState *state, float complexity)β decimated complexity as afloat.
π«Ά Static Public Member Functions inherited from SoNode
static uint32_t getCompatibilityTypes (const SoType &nodetype)β compatibility types for anodetype.static SoType getClassTypeId (void)β class type id.static SoNode * getByName (const SbName &name)β look up a node byname.static int getByName (const SbName &name, SoNodeList &l)β look up bynameand collect intol, returns anint.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 fortype.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 acopyagainst itsorig.static SoFieldContainer * checkCopy (const SoFieldContainer *orig)β checks a copy fororig.static SoFieldContainer * findCopy (const SoFieldContainer *orig, const SbBool copyconnections)β finds the copy oforig, withcopyconnections.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 abasewithname.static void removeName (SoBase *const base, const char *const name)β un-names thatbase.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 oftype.static int getNamedBases (const SbName &name, SoBaseList &baselist, SoType type)β collect named bases intobaselist, returnsint.static SbBool read (SoInput *input, SoBase *&base, SoType expectedtype)β read frominputintobase, expectingexpectedtype.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 fromfromnodename/fromfieldnametotonodename/tofieldname.static SbBool readRoute (SoInput *input)β reads a route frominput.
π 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 alist.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 ofv1,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 withccwandsolid.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 afloat.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 amatrix.virtual SoDetail * createLineSegmentDetail (SoRayPickAction *action, const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2, SoPickedPoint *pp)β line segment detail fromv1andv2.virtual SoDetail * createPointDetail (SoRayPickAction *action, const SoPrimitiveVertex *v, SoPickedPoint *pp)β point detail fromv.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;detaildefaults toNULL.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 frompoint,useTexFunc,tce,s,tandnormal.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, plusnormal.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 frominwithflags.
π 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;isgroupandisenginein play.void writeFooter (SoOutput *out) constβ writes the footer.virtual const char * getFileFormatName (void) constβ the file format name, as aconst 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 honestlystatic void setNextActionMethodIndex (int index)β sets that next action method index, takes anint indexstatic int getNextActionMethodIndex (void)β reads it back out as anintstatic void incNextActionMethodIndex (void)β bumps it up, no args, just vibesstatic void setCompatibilityTypes (const SoType &nodetype, const uint32_t bitmask)β takes aconst SoType &nodetypeand aconst 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 auint32_tstatic void staticDataLock (void)β locks the static data, periodtstatic 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 ownuint32_tunique id, main character energy for real
π Protected Attributes inherited from SoFieldContainer
SbBool isBuiltInβ anSbBoolcalledisBuiltIn, telling you whether you're built-in or not
π¦ Static Protected Attributes inherited from SoNode
static uint32_t nextUniqueId = 1β starts at1, defaults are sacredstatic int nextActionMethodIndex = 0β starts at0, 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
crossSectionpiecewise linear curve (described as a series of connected vertices); - a 3D
spinepiecewise linear curve (also described as a series of connected vertices); - a list of 2D
scaleparameters; - a list of 3D
orientationparameters.
π 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]tospine[1], and for the last it is the vector fromspine[n-2]tospine[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 forspine[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
scaleparameters define the size of the cross-section along the spine. - Uniform extrusions: if the
scaleis(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
orientationparameters (given as rotations about the Y-axis) twist it around the spine, and thescaleparameters 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
- fedora 43: Coin3-devel 3.1.3-40.fc43 Β· GPL-2.0-only
- fedora 43: Coin3-devel 3.1.3-40.fc43 Β· GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.fc44 Β· GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms