SOQUADMESH(3iv)

πŸ’– SoQuadMesh(3IV) β€” the quadrilateral mesh shape node πŸ’–

okay bestie, sit down, hydrate, because we're about to talk about SoQuadMesh from the Inventor manuals (you know, the 3IV section, iykyk). This is the node that builds quadrilateral meshes out of vertices, and honestly? it's giving grid. it's giving quilt. it's giving "I made a mesh and it slays." ✨


🌸 NAME 🌸

SoQuadMesh β€” quadrilateral mesh shape node πŸ¦‹


πŸ‘‘ INHERITS FROM πŸ‘‘

the whole ancestry line, no skipping generations:

SoBase > SoFieldContainer > SoNode > SoShape > SoVertexShape >
SoNonIndexedShape > SoQuadMesh

like... the family tree is long, she comes from a distinguished bloodline πŸ’…


✨ SYNOPSIS ✨

#include <Inventor/nodes/SoQuadMesh.h>

   Fields from class SoQuadMesh:

SoSFInt32           verticesPerColumn
SoSFInt32           verticesPerRow

   Fields from class SoNonIndexedShape:

SoSFInt32           startIndex

   Fields from class SoVertexShape:

SoSFNode            vertexProperty

   Methods from class SoQuadMesh:

                  SoQuadMesh()
static SoType       getClassTypeId()

   Methods from class 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 from class 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 from class 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

πŸŽ€ DESCRIPTION πŸŽ€

so basically, this shape node constructs quadrilaterals out of vertices. the vertices can be specified either in the vertexProperty field (that one's inherited from SoVertexShape) or by the current inherited coordinates. and listen β€” for optimal performance, the vertexProperty field is the recommended one. do with that what you will. πŸ’…

SoQuadMesh uses the coordinates in order, starting with the first one. the number of vertices in the columns and rows of the mesh is specified by the verticesPerColumn and verticesPerRow fields. and this is the part that trips people up every single time, so pay attention bestie: those numbers are 1 greater than the number of quadrilaterals per row and per column. not equal. greater. by one. 😭

let's do the example, because it's actually so clean:

an SoQuadMesh with verticesPerColumn of 3 and verticesPerRow of 4 would use coordinates 1, 2, 3, and 4 for the first row of vertices, coordinates 5, 6, 7, and 8 for the second row, and coordinates 9, 10, 11, and 12 for the third (last) row. the result? a mesh of 3 quadrilaterals across by 2 down. math is mathing, we love to see it. 🧚

⚠️ warning bestie: non-planar quadrilaterals formed by a quad mesh may cause interesting but unpredictable results. "interesting" here is doing a lot of heavy lifting. proceed with vibes but also with caution. πŸ’€

the coordinates of the mesh get transformed by the current cumulative transformation, and the mesh is drawn with the current light model and drawing style. so it's very much serving whatever your scene graph is serving.

now, treatment of the current material and normal binding, because this is where it gets ✨technical✨:

  • The PER_PART binding specifies a material or normal for each row of the mesh.
  • The PER_FACE binding specifies a material or normal for each quadrilateral.
  • The _INDEXED bindings are equivalent to their non-indexed counterparts.
  • The default material binding is OVERALL.
  • The default normal binding is PER_VERTEX.

and if any normals (or materials) are specified, Inventor assumes you provided the correct number of them, as indicated by the binding. if you specify fewer normals (or materials) than the shape requires, you will see unexpected results. that's not a threat, that's a promise. πŸ™ˆ if no normals are specified, they'll be generated automatically β€” so at least there's a safety net. 🫢


πŸ¦‹ FIELDS πŸ¦‹

  • SoSFInt32 verticesPerColumn
  • SoSFInt32 verticesPerRow

number of vertices per column and row. iconic. concise. exactly what it says on the tin. ⭐


πŸ’œ METHODS πŸ’œ

  • SoQuadMesh() β€” creates a quadrilateral mesh node with default settings. a fresh baby mesh, born ready. πŸ‘‘
  • static SoType getClassTypeId() β€” returns the type identifier for this class. it's the ID card. the government name. the "yes, this is who I am" of the node. πŸ”₯

🌈 ACTION BEHAVIOR 🌈

SoGLRenderAction

draws a mesh based on the current coordinates, normals, materials, drawing style, and so on. and so on. you know how it is. ✨

SoRayPickAction

picks on the mesh based on the current coordinates and transformation. details about the intersection are returned in an SoFaceDetail. very demure, very detailed. πŸŽ€

SoGetBoundingBoxAction

computes the bounding box that encloses all vertices of the mesh, with the current transformation applied to them. it also sets the center to the average of the coordinates of all vertices. yes, the average. mean girl behavior but make it math. πŸ’…

SoCallbackAction

if any triangle callbacks are registered with the action, they will be invoked for each successive triangle forming the quadrilaterals of the mesh. note: triangles, not quads. the quads are an illusion, the triangles are the truth. πŸ¦‹


πŸ“ FILE FORMAT/DEFAULTS πŸ“

QuadMesh {
   vertexProperty     NULL
   startIndex         0
   verticesPerColumn  1
   verticesPerRow     1
}

look at those defaults. NULL, 0, 1, 1. minimalism. slay. ✨


πŸ’– SEE ALSO πŸ’–

go read these next, they're all in the friend group:

  • SoCoordinate3
  • SoDrawStyle
  • SoFaceDetail
  • SoFaceSet
  • SoTriangleStripSet
  • SoVertexProperty

and that's the whole page bestie β€” SoQuadMesh(3IV) from the Inventor manual, footer date field left all empty like a mystery, exactly as the original had it. no cap, you now know everything this node knows. go build a mesh, make it non-planar, live dangerously, but maybe read the warning again first. πŸ’…πŸŒΈπŸ«Ά