FormIt C++ API  v23.0.0 (2023.0.0)
WSM::Line3d Class Reference

Description

The Line3d class stores an oriented line and/or an axis, defined by a Point3d and a Vector3d.

For the Line3d object to be valid, the vector must not be null.

The parameters of the Line3d class are accessed via public data members, point and vector.

#include <Line3d.h>

Public Member Functions

 Line3d ()
 
 Line3d (const Point3d &p, const Vector3d &v)
 
 Line3d (const Point3d &p, const UnitVector3d &v)
 
 Line3d (const Point3d &p1, const Point3d &p2)
 
double dist (const Point3d &) const
 
Point3d project (const Point3d &) const
 
void operator*= (const Transf3d &)
 
bool intersect (const Line3d &, Point3d &intersPoint, double dTol=WSM_DISTANCE_TOL) const
 Returns true if the lines intersect at a point, false otherwise. More...
 
bool intersectWithParameters (const Line3d &, Point3d &intersPoint, double &thisParam, double &otherParam, double dTol=WSM_DISTANCE_TOL) const
 Same as intersect except returns the parameters on each line as well in the case of intersection. More...
 
double GetParameter (const WSM::Point3d &pt) const
 Returns the parameter of the nearest point on the line. More...
 
Point3d GetPointFromParameter (double dParam) const
 Returns the point from the given parameter. More...
 
bool isEqual (const Line3d &) const
 
bool isValid () const
 
bool isCoincident (const Line3d &, bool sameDirectionAlso, double dTol=WSM_MACHINE_TOL) const
 Coincident lines are such lines whose vectors are parallel and for which the root point of one line lies on the other line and vice versa. More...
 

Public Attributes

Point3d point
 
Vector3d vector
 

Static Public Attributes

static const Line3d kNull
 
static const Line3d kXAxis
 
static const Line3d kYAxis
 
static const Line3d kZAxis
 

Constructor & Destructor Documentation

WSM::Line3d::Line3d ( )
inline
WSM::Line3d::Line3d ( const Point3d p,
const Vector3d v 
)
inline
WSM::Line3d::Line3d ( const Point3d p,
const UnitVector3d v 
)
inline
WSM::Line3d::Line3d ( const Point3d p1,
const Point3d p2 
)
inline

Member Function Documentation

double WSM::Line3d::dist ( const Point3d ) const
double WSM::Line3d::GetParameter ( const WSM::Point3d pt) const

Returns the parameter of the nearest point on the line.

Point3d WSM::Line3d::GetPointFromParameter ( double  dParam) const
inline

Returns the point from the given parameter.

bool WSM::Line3d::intersect ( const Line3d ,
Point3d intersPoint,
double  dTol = WSM_DISTANCE_TOL 
) const

Returns true if the lines intersect at a point, false otherwise.

bool WSM::Line3d::intersectWithParameters ( const Line3d ,
Point3d intersPoint,
double &  thisParam,
double &  otherParam,
double  dTol = WSM_DISTANCE_TOL 
) const

Same as intersect except returns the parameters on each line as well in the case of intersection.

bool WSM::Line3d::isCoincident ( const Line3d ,
bool  sameDirectionAlso,
double  dTol = WSM_MACHINE_TOL 
) const

Coincident lines are such lines whose vectors are parallel and for which the root point of one line lies on the other line and vice versa.

If sameDirectionAlso is true, the vectors of the two lines must also go in the same direction, they must not be antiparallel. dTol is the tolerance for distance between the lines.

bool WSM::Line3d::isEqual ( const Line3d ) const
bool WSM::Line3d::isValid ( ) const
inline
void WSM::Line3d::operator*= ( const Transf3d )
Point3d WSM::Line3d::project ( const Point3d ) const

Member Data Documentation

const Line3d WSM::Line3d::kNull
static
const Line3d WSM::Line3d::kXAxis
static
const Line3d WSM::Line3d::kYAxis
static
const Line3d WSM::Line3d::kZAxis
static
Point3d WSM::Line3d::point
Vector3d WSM::Line3d::vector

The documentation for this class was generated from the following file: