SbLine(3)
β¨ SbLine(3) β¨
okay bestie, welcome to SbLine β it's a Coin manpage, it's giving 3D geometry, and honestly? it ate. π
πΈ NAME πΈ
SbLine β the SbLine class represents a line in 3D space. yes, that's it. that's the whole vibe. a line. in 3D. iconic. β¨
π SYNOPSIS π
#include <Inventor/SbLine.h>
π¦ Public Member Functions π¦
SbLine (void)
SbLine (const SbVec3f &origin, const SbVec3f &point)
void setValue (const SbVec3f &origin, const SbVec3f &point)
void setPosDir (const SbVec3f &position, const SbVec3f &direction)
SbBool getClosestPoints (const SbLine &line2, SbVec3f &ptOnThis, SbVec3f
&ptOnLine2) const
SbVec3f getClosestPoint (const SbVec3f &point) const
const SbVec3f & getPosition (void) const
const SbVec3f & getDirection (void) const
void print (FILE *file) const
π Detailed Description π
The SbLine class represents a line in 3D space. (yes we said it twice, the manpage said it twice, we're matching energy.)
SbLine gives you a whole way of specifying a directed line β you build it out of a 3D point (the origin) plus a vector direction out there in 3D space. so it's not just a line, it's a line with intentions. main character energy fr. π
Now, here's the tea: it is context dependent whether or not an SbLine counts as a ray β extending from the starting point in only one direction β or as a line that intersects the origin point and extends infinitely from it in both directions. so likeβ¦ it depends on who's asking, and that's valid. π«Ά
SbLine is used by many other classes in Coin. it's the social butterfly of the geometry world, no cap.
See also
SbVec3f
π Constructor & Destructor Documentation π
β SbLine::SbLine (void )
The default constructor does nothing. like, literally nothing. the line will be uninitialized until the first assignment or setValue() call. so don't come for it before you've set it up, bestie. π
β SbLine::SbLine (const SbVec3f & origin, const SbVec3f & point)
Constructor where origin specifies the line origin point, and point specifies another point on the line that gets used to figure out the line's direction.
β οΈpointshould not be the same asorigin! if it is, the line ends up with a null vector as its direction vector, and that causes division by zero problems in some of the other methods on this class. not cute. not slay. don't do it. π
Also be aware that the direction vector will be normalized β so it will not be the same as point - origin. like, close your eyes and accept it, it's been normalized for your own good. β¨
See also
setValue,setPosDir,getOrigin,getDirection
π Member Function Documentation π
πΈ void SbLine::setValue (const SbVec3f & origin, const SbVec3f & point)
Sets a new position and direction for the line, by specifying the line origin and another point on the line that's used to determine the line's direction.
β οΈ Again:pointshould not be the same asorigin. same reason, same drama β you'd get a null vector as the direction vector, which causes division by zero problems in some of the other methods on this class. π
And remember: the direction vector will be normalized, and will not be the same as point - origin. it's a glow-up, not a copy. π
Also, lowkey important: setPosDir(position, direction) should be preferred over calling setValue(position, position + direction) β because the latter causes numerical problems when position has a very large magnitude and direction is a normalized direction vector. so like, just use the good one. π₯
See also
setPosDir,getOrigin,getDirection
πΈ void SbLine::setPosDir (const SbVec3f & position, const SbVec3f & direction)
Sets position and direction. that's the whole job, and it does it well.
Be aware that the direction vector will be normalized and will not be the same as what you provided to this method. the algorithm said "I can fix her" and it did. β¨
See also
setValue,getOrigin,getDirection
Since
- Coin 4.0
πΈ SbBool SbLine::getClosestPoints (const SbLine & line2, SbVec3f & ptOnThis, SbVec3f & ptOnLine2) const
Returns the two closest points on the lines. so like, the meet-cute point. π₯Ί
- If the lines are parallel, all points are equally close, and we return
FALSE. everyone's equally close, nobody's special, it's giving friendzone. π - If the lines are not parallel, the point positions get stored in
ptOnThisandptOnLine2, and we returnTRUE. now THAT'S a ship. π«Ά
Note that both SbLine instances are considered to be infinite in both directions from their definition points, as far as this function is concerned. so no edge cases hiding at the ends, bestie. π
See also
getClosestPoint().
πΈ SbVec3f SbLine::getClosestPoint (const SbVec3f & point) const
Returns the point on the line which is closest to point. and here's the diagram, because visuals are everything:
_
Q D
SP x-----x------->
\ |
\ |
\ |
\ |
\|
x P
P= argument pointSP= line starting point, andD= line direction of this lineQ= point to find and return from function
The vector defined by point and the returned point will be normal to the line. perpendicular, if you will. it's giving right angles. πβ¨
Note that the SbLine instance is considered to be infinite in both directions from its definition point, as far as this function is concerned. same energy as above, fr fr.
See also
getClosestPoints().
πΈ const SbVec3f & SbLine::getPosition (void ) const
Returns a vector representing the origin point on the line. where it all began. the origin story, if you will. π±
See also
setValue
πΈ const SbVec3f & SbLine::getDirection (void ) const
Returns a vector representing the direction of the line. and bestie, the direction vector will always be normalized. always. it does not skip leg day. πͺ
πΈ void SbLine::print (FILE * fp) const
Dumps the state of this object to the fp file stream. Only works in debug version of library β in an optimized build, this method does nothing. so if you're out here printing nothing, check your build, not your code. π
π Author π
Generated automatically by Doxygen for Coin from the source code. no humans were harmed, the robots did it. π
and that's the whole page bestie!! thanks for reading my SbLine manifesto, you're doing amazing sweetie πβ¨π¦
this was Version 4.0.10, dated Thu Jun 25 2026 00:00:00, and yeah, it's page SbLine(3) β mwah, periodt. π
πΈ
π¦ 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