SONURBSCURVE(3iv)

🌸 SoNurbsCurve(3IV) β€” NURBS curve shape node ✨

okay bestie, buckle up, because we're about to talk about curves β€” and not the kind on your fave's Instagram. this is the SoNurbsCurve page from the SoNurbsCurve(3IV) manual and it's genuinely one of the cutest little nodes in Open Inventor. let's get into it πŸ’…


πŸ¦‹ NAME πŸ¦‹

SoNurbsCurve β€” NURBS curve shape node

like. that's it. that's the whole name. it's a node. it shapes a curve. iconic behaviour honestly.


πŸ‘‘ INHERITS FROM πŸ‘‘

SoBase > SoFieldContainer > SoNode > SoShape > SoNurbsCurve

so the whole family tree is giving main character lineage β€” SoNurbsCurve is the baby of the family and it inherited everything from SoBase all the way down. it did NOT skip leg day, it inherited the whole gym 🫢


✨ SYNOPSIS ✨

first things first, you gotta let your code know it exists:

#include <Inventor/nodes/SoNurbsCurve.h>

the fields that belong to SoNurbsCurve

SoSFInt32           numControlPoints
SoMFFloat           knotVector

the methods that belong to SoNurbsCurve

                     SoNurbsCurve()
static SoType        getClassTypeId()

methods it got from SoNode

void                 setOverride(SbBool state)
SbBool               isOverride() const
SoNode *             copy(SbBool copyConnections = FALSE) const
virtual SbBool       affectsState() const
static SoNode *      getByName(const SbName &name)
static int           getByName(const SbName &name, SoNodeList &list)

methods it got from SoFieldContainer

void                 setToDefaults()
SbBool               hasDefaultValues() const
SbBool               fieldsAreEqual(const SoFieldContainer *fc) const
void                 copyFieldValues(const SoFieldContainer *fc, SbBool
                          copyConnections = FALSE)
SbBool               set(const char *fieldDataString)
void                 get(SbString &fieldDataString)
virtual int          getFields(SoFieldList &resultList) const
virtual SoField *    getField(const SbName &fieldName) const
SbBool               getFieldName(const SoField *field, SbName &fieldName)
                          const
SbBool               isNotifyEnabled() const
SbBool               enableNotify(SbBool flag)

methods it got from SoBase

void                 ref()
void                 unref() const
void                 unrefNoDelete() const
void                 touch()
virtual SoType       getTypeId() const
SbBool               isOfType(SoType type) const
virtual void         setName(const SbName &name)
virtual SbName       getName() const

look at that inheritance. it's giving generational wealth πŸ’–


πŸ’– DESCRIPTION πŸ’–

so, SoNurbsCurve is a whole class that represents a NURBS curve, and it's built entirely off the knot vector and the control points that you specify. you're the main character here, the node just does what you say.

the knotVector field is a floating-point array of values. those values are the coordinates of the knot points in the curve, and bestie, you must enter them in non-decreasing order. like, ascending. do not come in here with your chaos. πŸ™ˆ

the curve uses the first numControlPoints values in the current coordinates as its control points.

now here's the math tea β˜• β€” if you specify n knots, you can specify up to n-8 control points. the number of knots minus the number of control points is known as the order of the curve. and a NURBS curve can have an order of up to 8. that's the ceiling. that's the limit. periodt.

the control points of the curve get transformed by the current transformation matrix. the curve is drawn with the current lighting model and drawing style β€” and heads up, a drawing style of FILLED is treated as LINES, because it's a curve, babe, it's not a filled shape, be so serious. the coordinates, normals, and texture coordinates of a NURBS curve are generated, so you cannot bind explicit normals or texture coordinates to a NURBS curve. no. stop. not allowed. πŸ’€

and lastly, the approximation of the curve by line segments is affected by the current complexity value. so if it's looking a little chunky, you know what knob to twist. πŸ”₯


πŸŽ€ FIELDS πŸŽ€

  • SoSFInt32 numControlPoints β€” the number of control points. how many points are we controlling? this many. πŸ’…
  • SoMFFloat knotVector β€” the knot vector. that's the whole description. it's the knot vector. it vectors the knots. slay.

🧚 METHODS 🧚

  • SoNurbsCurve() β€” creates a NURBS curve node with default settings. fresh out the box, defaults and all. ✨
  • static SoType getClassTypeId() β€” returns the type identifier for this class. it's the little name tag this class wears to the party. πŸŽ€

🌈 ACTION BEHAVIOR 🌈

this is where the node actually does stuff when the actions come knocking:

  • SoGLRenderAction β€” draws the curve based on the current coordinates, material, and so on. render o'clock, bestie. πŸ”₯
  • SoRayPickAction β€” picks the curve based on the current coordinates and transformation. yes, you can click on it. it responds. 🫢
  • SoGetBoundingBoxAction β€” computes the bounding box that encloses all control points of the curve, with the current transformation applied to them. and it sets the center to the average of the control points. cute little midpoint moment. πŸ’–
  • SoCallbackAction β€” if any line segment callbacks are registered with the action, they will be invoked for each successive segment approximating the curve. every single segment gets its callback. no segment left behind. 😭

⭐ FILE FORMAT/DEFAULTS ⭐

here's what it looks like written out, and what you get if you don't touch anything:

NurbsCurve {
   numControlPoints  0
   knotVector        0
}

yep. 0 and 0. it starts out as an empty little nothing and then you build it into a masterpiece. character development honestly. 🌸


πŸ¦‹ SEE ALSO πŸ¦‹

go check out its siblings, they're also iconic:

  • SoIndexedNurbsCurve
  • SoNurbsSurface

heads up bestie: the order can't go above 8, the knot values gotta be non-decreasing, and you cannot bind explicit normals or texture coordinates to a NURBS curve. these are not vibes, these are rules. πŸ’…

okay that's the whole page, you're officially a NURBS girlie now πŸ‘‘

this was the SoNurbsCurve(3IV)() manual page, straight from the SoNurbsCurve(3IV) source β€” so go forth and curve, and remember: non-decreasing order, always. mwah πŸ’–πŸŽ€πŸ¦‹