SbLine(3)

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

✨ 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.

⚠️ point should not be the same as origin! 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: point should not be the same as origin. 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 ptOnThis and ptOnLine2, and we return TRUE. 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 point
  • SP = line starting point, and D = line direction of this line
  • Q = 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