SbClip(3)
π 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
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms