chrono::geometry::ChLine Class Reference

Description

Base class for all geometric objects representing lines in 3D space.

#include <ChLine.h>

Inheritance diagram for chrono::geometry::ChLine:
Collaboration diagram for chrono::geometry::ChLine:

Public Member Functions

 ChLine (const ChLine &source)
 
virtual ChLineClone () const override
 "Virtual" copy constructor (covariant return type).
 
virtual GeometryType GetClassType () const override
 Get the class type as unique numerical ID (faster than using ChronoRTTI mechanism). More...
 
virtual bool Get_closed () const
 Tell if the curve is closed.
 
virtual void Set_closed (bool mc)
 
virtual int Get_complexity () const
 Tell the complexity.
 
virtual void Set_complexity (int mc)
 
virtual int GetManifoldDimension () const override
 This is a line.
 
bool FindNearestLinePoint (ChVector<> &point, double &resU, double approxU, double tol) const
 Find the parameter resU for the nearest point on curve to "point".
 
virtual double Length (int sampling) const
 Returns curve length. Typical sampling 1..5 (1 already gives correct result with degree1 curves)
 
virtual ChVector GetEndA () const
 Return the start point of the line. More...
 
virtual ChVector GetEndB () const
 Return the end point of the line. More...
 
double CurveCurveDist (ChLine *compline, int samples) const
 Returns adimensional information on "how much" this curve is similar to another in its overall shape (doesnot matter parametrization or start point). More...
 
double CurveSegmentDist (ChLine *complinesegm, int samples) const
 Same as before, but returns "how near" is complinesegm to whatever segment of this line (does not matter the percentual of line). More...
 
double CurveCurveDistMax (ChLine *compline, int samples) const
 Same as above, but instead of making average of the distances, these functions return the maximum of the distances... More...
 
double CurveSegmentDistMax (ChLine *complinesegm, int samples) const
 
virtual bool DrawPostscript (ChFile_ps *mfle, int markpoints, int bezier_interpolate)
 Draw into the current graph viewport of a ChFile_ps file.
 
virtual void ArchiveOUT (ChArchiveOut &marchive) override
 
virtual void ArchiveIN (ChArchiveIn &marchive) override
 Method to allow de serialization of transient data from archives.
 
- Public Member Functions inherited from chrono::geometry::ChGeometry
 ChGeometry (const ChGeometry &source)
 
virtual void GetBoundingBox (double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax, ChMatrix33<> *Rot=NULL) const
 Compute bounding box. More...
 
virtual void InflateBoundingBox (double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax, ChMatrix33<> *Rot=NULL) const
 Enlarge a previous existing bounding box. More...
 
virtual double Size () const
 Returns the radius of the sphere which can enclose the geometry.
 
virtual void Evaluate (ChVector<> &pos, const double parU, const double parV=0., const double parW=0.) const
 Evaluates a point on a geometry, given parametric coordinates, if possible. More...
 
virtual void Derive (ChVector<> &dir, const double parU, const double parV=0., const double parW=0.) const
 Evaluates a tangent versor on a geometry, given parametric coordinates, if possible. More...
 
virtual ChVector Baricenter () const
 Compute center of mass It should be overriden by inherited classes.
 
virtual void CovarianceMatrix (ChMatrix33<> &C) const
 Compute the 3x3 covariance matrix (only the diagonal and upper part) It should be overriden by inherited classes.
 
virtual void Update ()
 Generic update of internal data. More...
 

Protected Attributes

bool closed
 
int complexityU
 

Additional Inherited Members

- Public Types inherited from chrono::geometry::ChGeometry
enum  GeometryType {
  NONE, SPHERE, BOX, CYLINDER,
  TRIANGLE, CAPSULE, CONE, LINE,
  LINE_ARC, LINE_BEZIER, LINE_CAM, LINE_PATH,
  LINE_POLY, LINE_SEGMENT, ROUNDED_BOX, ROUNDED_CYLINDER,
  ROUNDED_CONE, TRIANGLEMESH, TRIANGLEMESH_CONNECTED, TRIANGLEMESH_SOUP
}
 Enumeration of geometric objects.
 

Member Function Documentation

double chrono::geometry::ChLine::CurveCurveDist ( ChLine compline,
int  samples 
) const

Returns adimensional information on "how much" this curve is similar to another in its overall shape (doesnot matter parametrization or start point).

Try with 20 samples. The return value is somewhat the "average distance between the two curves". Note that the result is affected by "weight" of curves. If it chnges from default 1.0, the distance extimation is higher/lower (ex: if a curve defines low 'weight' in its central segment, its CurveCurveDistance from another segment is not much affected by errors near the central segment).

double chrono::geometry::ChLine::CurveCurveDistMax ( ChLine compline,
int  samples 
) const

Same as above, but instead of making average of the distances, these functions return the maximum of the distances...

double chrono::geometry::ChLine::CurveSegmentDist ( ChLine complinesegm,
int  samples 
) const

Same as before, but returns "how near" is complinesegm to whatever segment of this line (does not matter the percentual of line).

Again, this is affected by "weight" of curves. If weight changes along curves ->'weighted' distance

virtual GeometryType chrono::geometry::ChLine::GetClassType ( ) const
overridevirtual

Get the class type as unique numerical ID (faster than using ChronoRTTI mechanism).

Each inherited class must return an unique ID.

Reimplemented from chrono::geometry::ChGeometry.

Reimplemented in chrono::geometry::ChLineCam, chrono::geometry::ChLineArc, chrono::geometry::ChLinePath, chrono::geometry::ChLineBezier, chrono::geometry::ChLinePoly, and chrono::geometry::ChLineSegment.

virtual ChVector chrono::geometry::ChLine::GetEndA ( ) const
virtual

Return the start point of the line.

By default, evaluates line at U=0.

Reimplemented in chrono::geometry::ChLinePath.

virtual ChVector chrono::geometry::ChLine::GetEndB ( ) const
virtual

Return the end point of the line.

By default, evaluates line at U=1.

Reimplemented in chrono::geometry::ChLinePath.