SbClip(3)

πŸ“¦
version 4.0.10 Β· 4 versions
, in fedora 43, fedora 44

πŸ’– SbClip(3) πŸ’–

okay bestie, gather round, because we're about to talk about the Coin manual page for SbClip and honestly? it's giving polygon-clipping royalty. this is a <pink>3</pink> manpage, so grab a boba and let's go πŸ§‹βœ¨


✨ NAME ✨

SbClip β€” the SbClip class is a generic polygon clipper class. periodt. that's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

#include <include/Inventor/base/SbClip.h>

πŸŽ€ Public Member Functions πŸŽ€

SbClip (SbClipCallback *callback=NULL, void *userdata=NULL)
void addVertex (const SbVec3f &v, void *vdata=NULL)
void reset (void)
void clip (const SbPlane &plane)
int getNumVertices (void) const
void getVertex (const int idx, SbVec3f &v, void **vdata=NULL) const
void * getVertexData (const int idx) const

like. look at those. all seven of them. iconic behavior fr fr πŸ”₯


πŸ¦‹ Detailed Description πŸ¦‹

so SbClip is a generic polygon clipper class, no cap.

here's the how-to, bestie: first you add all the vertices in the polygon, and then you clip against however many planes you want. that's the order, don't fight it.

now β€” if you need extra info per vertex (think texture coordinates, that kind of thing), you should supply a callback in the constructor, and then hand over a pointer to your vertex structure in addVertex(). easy.

and here's the part that's lowkey the whole plot twist: every single time a new vertex gets created, the callback gets called with the line being clipped, including the pointers to your vertex structures and the position of the new vertex (the one that got clipped against some plane). your job at that moment? create a new vertex structure, calculate your data (like, say, a new texture coordinate ✨), and return a pointer to that structure. do that and you're slaying.

⚠️ heads up though: be aware that this class is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API. so if you're out here expecting it in the O.G. API... it's not there, bestie 😭

Since

Coin 2.0 🌈 (yes she's been around, she's a legend)


πŸ‘‘ Constructor & Destructor Documentation πŸ‘‘

πŸ’œ SbClip::SbClip (SbClipCallback * callback = NULL, void * userdata = NULL)

a constructor, as one does. supply a callback if you need to handle additional data per vertex. that's it, that's the tea πŸ“


🌟 Member Function Documentation 🌟

⭐ void SbClip::addVertex (const SbVec3f & v, void * vdata = NULL)

adds a polygon vertex. and vdata? that could be a pointer to your vertex structure. yes, yours. go off πŸ’…

⭐ void SbClip::reset (void )

resets the clipper. this should be called before adding any vertices when reusing an SbClip instance. like, don't skip this one bestie, it's the reset button for a reason πŸŽ€

⭐ void SbClip::clip (const SbPlane & plane)

clip polygon against plane. this might change the number of vertices in the polygon β€” so don't be shocked when the count moves, that's literally the point.

for each time a new vertex is created, the callback supplied in the constructor (if != NULL) is called with the line being clipped and the new vertex calculated. and the callback should return a new void pointer to be stored by the clipper. so like, it hands you the deets, you hand back a pointer, everybody wins 🫢

⭐ int SbClip::getNumVertices (void ) const

returns the number of vertices in the polygon. simple. elegant. iconic. ✨

See also

SbClip::getVertex()

⭐ void SbClip::getVertex (const int idx, SbVec3f & v, void ** vdata = NULL) const

returns the vertex at index idx. yes, that exact one. πŸ¦‹

See also

SbClip::getNumVertices()

⭐ void * SbClip::getVertexData (const int idx) const

return the vertex data at index idx. that's the whole thing, and it ate πŸ”₯


πŸ’– Author πŸ’–

Generated automatically by Doxygen for Coin from the source code. (not me, not you, Doxygen did that πŸ’€)


aaaand that's the page bestie!! you made it to the end, so proud of you πŸ₯ΉπŸ’– this was Version 4.0.10, dated Thu Jun 25 2026 00:00:00, and it's filed under SbClip(3). go clip some polygons, you absolute main character πŸ‘‘βœ¨πŸŒΈ

πŸ“¦ where this page comes from