SBSPHERE(3iv)
π SbSphere β bestie, it's a whole class for representing a sphere π
Okay so real talk, this is the SbSphere(3IV) manual page, and it's genuinely one of the cutest little classes in the Inventor toolkit. It's giving main character energy but make it a 3D sphere. Let's get into it π¦
πΈ INHERITS FROM πΈ
SbSphereβ that's it bestie, she inherits from herself, she's self-made, periodt π
β¨ SYNOPSIS β¨
First thing first, you gotta pull her in:
#include <Inventor/SbLinear.h>
Then here's every single method from class SbSphere, laid out exactly as the header file does it:
SbSphere()
SbSphere(const SbVec3f ¢er, float radius)
void setValue(const SbVec3f ¢er, float radius)
void setCenter(const SbVec3f ¢er)
void setRadius(float radius)
const SbVec3f & getCenter() const
float getRadius() const
void circumscribe(const SbBox3f &box)
SbBool intersect(const SbLine &l, SbVec3f &intersection)
const
SbBool intersect(const SbLine &l, SbVec3f &enter, SbVec3f
&exit) const
Likeβ¦ look at her. Organized. Efficient. No cap. π
π DESCRIPTION π
So SbSphere represents a sphere in 3D. That's the whole vibe. She is a lightweight datatype β think of her as the girl who shows up, does her job, and doesn't need a whole rendering pipeline to feel fulfilled. She's used for arguments or return values in the Inventor toolkit, which is very "I'm a supporting character but I carry the plot" of her.
Now β and this is important, bestie β if you want an actual database sphere, like one that gets rendered, picked, all of that, you want SoSphere instead. SbSphere is the math-y friend; SoSphere is the one who shows up on screen. Different queens, different jobs. Don't mix them up π
π METHODS π
π«Ά Constructors
SbSphere()
SbSphere(const SbVec3f ¢er, float radius)
Two ways to be born: the no-arg one, and the one where you hand her a center and a radius right away. Iconic behavior.
β Setting her up
void setValue(const SbVec3f ¢er, float radius)β change both the center and the radius at once. One call, whole glow-up.void setCenter(const SbVec3f ¢er)void setRadius(float radius)
These two let you set just the center or just the radius. Pick your lane, bestie π
π Reading her mind
const SbVec3f & getCenter() constfloat getRadius() const
Hand these back and you get the center and the radius. That's the tea. β
π¦ circumscribe
void circumscribe(const SbBox3f &box)
Give her a box and she'll return a sphere containing that box. She's a giver, she contains multitudes, literally. π
π₯ intersect
SbBool intersect(const SbLine &l, SbVec3f &intersection)
const
SbBool intersect(const SbLine &l, SbVec3f &enter, SbVec3f
&exit) const
This is the moment, the crossover episode: intersect a line and a sphere, and she returns TRUE if there is an intersection. π
β οΈ Heads up bestie, this one matters: the line is treated as a ray. Not an infinite line, a ray. Don't come for me when your intersection math is off because you forgot that part. Periodt.
Two flavors, btw:
- the one that gives you back a single
intersection - the one that gives you
enterandexitβ the whole entrance and exit of the drama π
π SEE ALSO π
Go be nosy, she runs with a good crowd:
SbVec3fSbLineSoSphere
That's the whole page, bestie β every flag, every signature, every vibe, nothing skipped. Go build something cute with it. π
With love, from the SbSphere(3IV) manual page β that's the source/version stamp this one ships with, and yeah, no date was ever printed on it, so we're keeping it mysterious. πβ¨
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms