Project Chrono: chrono::ChLine Class Reference

Public Member Functions | Protected Attributes | List of all members
chrono::ChLine Class Referenceabstract
Chrono::Engine » Geometric objects

## Description

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

This is the base for all U-parametric object, implementing Evaluate() that returns a point as a function of the U parameter.

`#include <ChLine.h>`

Inheritance diagram for chrono::ChLine:
[legend]
Collaboration diagram for chrono::ChLine:
[legend]

## Public Member Functions
| ChLine (const ChLine &source)
virtual Type | GetType () const override
| "Virtual" copy constructor (covariant return type).
virtual ChVector3d | Evaluate (double U) const =0
| Return a point on the line, given parametric coordinate U.
virtual ChVector3d | GetTangent (double parU) const
| Return the tangent unit vector at the parametric coordinate U (in [0,1]).
virtual bool | IsClosed () const
| Tell if the curve is closed.
virtual void | SetClosed (bool mc)
virtual int | GetComplexity () const
| Tell the complexity.
virtual void | SetComplexity (int mc)
virtual int | GetManifoldDimension () const override
| This is a line.
bool | FindNearestLinePoint (ChVector3d &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 ChVector3d | GetEndA () const
| Return the start point of the line.
virtual ChVector3d | GetEndB () const
| Return the end point of the line.
double | CurveCurveDist (ChLine *compline, int samples) const
| Returns adimensional information on "how much" this curve is similar to another in its overall shape (does not matter parametrization or start point).
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).
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...
double | CurveSegmentDistMax (ChLine *complinesegm, int samples) const
virtual void | ArchiveOut (ChArchiveOut &archive_out) override
| Method to allow serialization of transient data to archives.
virtual void | ArchiveIn (ChArchiveIn &archive_in) override
| Method to allow de-serialization of transient data from archives.
Public Member Functions inherited from chrono::ChGeometry
| ChGeometry (const ChGeometry &other)
virtual ChGeometry * | Clone () const =0
| "Virtual" copy constructor.
virtual ChAABB | GetBoundingBox () const
| Compute bounding box along the directions of the shape definition frame.
void | InflateBoundingBox (ChAABB &bbox) const
| Enlarge the given existing bounding box with the bounding box of this object.
virtual double | GetBoundingSphereRadius () const
| Returns the radius of a bounding sphere for this geometry.
virtual ChVector3d | Baricenter () const
| Compute center of mass.
virtual void | Update ()
| Generic update of internal data.

## Protected Attributes
bool | closed
int | complexityU

## Additional Inherited Members
Public Types inherited from chrono::ChGeometry
enum class | Type { NONE , SPHERE , ELLIPSOID , BOX , CYLINDER , TRIANGLE , CAPSULE , CONE , LINE , LINE_ARC , LINE_BEZIER , LINE_CAM , LINE_PATH , LINE_POLY , LINE_SEGMENT , ROUNDED_BOX , ROUNDED_CYLINDER , TRIANGLEMESH , TRIANGLEMESH_CONNECTED , TRIANGLEMESH_SOUP }
| Enumeration of geometric object types.

## Member Function Documentation

## ◆ ArchiveIn()

void chrono::ChLine::ArchiveIn | ( | ChArchiveIn & | archive_in | ) |
| overridevirtual

Method to allow de-serialization of transient data from archives.

Reimplemented from chrono::ChGeometry.

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

## ◆ ArchiveOut()

void chrono::ChLine::ArchiveOut | ( | ChArchiveOut & | archive_out | ) |
| overridevirtual

Method to allow serialization of transient data to archives.

Reimplemented from chrono::ChGeometry.

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

## ◆ CurveCurveDist()

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

Returns adimensional information on "how much" this curve is similar to another in its overall shape (does not 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 estimation 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).

## ◆ CurveSegmentDist()

double chrono::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

## ◆ Evaluate()

virtual ChVector3d chrono::ChLine::Evaluate | ( | double | U | ) | const
| pure virtual

Return a point on the line, given parametric coordinate U.

Parameter U always work in 0..1 range. The default implementation always returns the origin of the surface frame.

Implemented in chrono::ChLineArc, chrono::ChLineBezier, chrono::ChLineBSpline, chrono::ChLineCam, chrono::ChLineNurbs, chrono::ChLinePath, chrono::ChLinePoly, and chrono::ChLineSegment.

## ◆ GetComplexity()

virtual int chrono::ChLine::GetComplexity | ( |  | ) | const
| inlinevirtual

Tell the complexity.

Reimplemented in chrono::ChLineArc, chrono::ChLineBSpline, chrono::ChLineNurbs, chrono::ChLinePath, chrono::ChLinePoly, and chrono::ChLineSegment.

## ◆ GetEndA()

virtual ChVector3d chrono::ChLine::GetEndA | ( |  | ) | const
| inlinevirtual

Return the start point of the line.

By default, evaluates line at U=0.

Reimplemented in chrono::ChLinePath.

## ◆ GetEndB()

virtual ChVector3d chrono::ChLine::GetEndB | ( |  | ) | const
| inlinevirtual

Return the end point of the line.

By default, evaluates line at U=1.

Reimplemented in chrono::ChLinePath.

## ◆ GetManifoldDimension()

virtual int chrono::ChLine::GetManifoldDimension | ( |  | ) | const
| inlineoverridevirtual

This is a line.

Reimplemented from chrono::ChGeometry.

## ◆ GetTangent()

ChVector3d chrono::ChLine::GetTangent | ( | double | parU | ) | const
| virtual

Return the tangent unit vector at the parametric coordinate U (in [0,1]).

This default implementation uses finite differences.

Reimplemented in chrono::ChLineBSpline, and chrono::ChLineNurbs.

## ◆ GetType()

virtual Type chrono::ChLine::GetType | ( |  | ) | const
| inlineoverridevirtual

"Virtual" copy constructor (covariant return type).

Get the class type as an enum.

Reimplemented from chrono::ChGeometry.

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

## ◆ IsClosed()

virtual bool chrono::ChLine::IsClosed | ( |  | ) | const
| inlinevirtual

Tell if the curve is closed.

Reimplemented in chrono::ChLineCam.

## ◆ Length()

double chrono::ChLine::Length | ( | int | sampling | ) | const
| virtual

Returns curve length. Typical sampling 1..5 (1 already gives correct result with degree1 curves).

Reimplemented in chrono::ChLineArc, chrono::ChLinePath, chrono::ChLinePoly, and chrono::ChLineSegment.

## ◆ SetClosed()

virtual void chrono::ChLine::SetClosed | ( | bool | mc | ) |
| inlinevirtual

Reimplemented in chrono::ChLineBSpline.

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

- D:/W/B/src/chrono-9.0.1/src/chrono/geometry/ChLine.h
- D:/W/B/src/chrono-9.0.1/src/chrono/geometry/ChLine.cpp