Class BiarcList

Inheritance Relationships

Base Type

Class Documentation

class G2lib::BiarcList : public G2lib::BaseCurve

Class to manage a list of biarc Curve (not necessarily G2 or G1 connected)

../_images/biarc_list.jpg

Public Functions

inline BiarcList()

Build an empty biarc spline.

inline ~BiarcList() override
inline BiarcList(BiarcList const &s)

Build a copy of another biarc spline.

void init()

Empty the the biarc list.

void reserve(int_type n)

Reserve memory for n biarcs.

void copy(BiarcList const &L)

Copy another biarc spline.

inline BiarcList const &operator=(BiarcList const &s)

Copy another biarc spline.

explicit BiarcList(LineSegment const &LS)

Build a biarc list from a line segment.

explicit BiarcList(CircleArc const &C)

Build a biarc list from a single circle arc.

explicit BiarcList(Biarc const &C)

Build a biarc list from a single biarc.

explicit BiarcList(PolyLine const &pl)

Build a biarc list from a single polyline.

explicit BiarcList(BaseCurve const &C)

Build a biarc list from another curve.

void push_back(LineSegment const &c)

Append a line segment to the biarc list (transformed to a degenerate biarc).

void push_back(CircleArc const &c)

Append a line circle to the biarc list (transformed to a degenerate biarc).

void push_back(Biarc const &c)

Append a biarc to the biarc list.

void push_back(PolyLine const &c)

Append a polyline to the biarc list (transformed to a list of degenerate biarc).

void push_back_G1(real_type x1, real_type y1, real_type theta1)

Construct a biarc passing from the points \( (x_0,y_0) \) to the point \( (x_1,y_1) \) with initial angle \( \theta_0 \) and final angle \( \theta_1 \) and append the biarc to the tail of biarc list. The initial point and angle is taken from the tail of the biarc list.

Parameters
  • x1[in] \( x_1 \)

  • y1[in] \( y_1 \)

  • theta1[in] \( \theta_1 \)

void push_back_G1(real_type x0, real_type y0, real_type theta0, real_type x1, real_type y1, real_type theta1)

Construct a biarc passing from the points \( (x_0,y_0) \) to the point \( (x_1,y_1) \) with initial angle \( \theta_0 \) and final angle \( \theta_1 \) and append the biarc to the tail of biarc list.

Parameters
  • x0[in] \( x_0 \)

  • y0[in] \( y_0 \)

  • theta0[in] \( \theta_0 \)

  • x1[in] \( x_1 \)

  • y1[in] \( y_1 \)

  • theta1[in] \( \theta_1 \)

bool build_G1(int_type n, real_type const *x, real_type const *y)

Construct a biarc list passing to the points \( (x_i,y_i) \).

Parameters
  • n[in] number of points

  • x[in] x-coordinates

  • y[in] y-coordinates

bool build_G1(int_type n, real_type const *x, real_type const *y, real_type const *theta)

Construct a biarc list passing to the points \( (x_i,y_i) \) with angles \( \theta_i \).

Parameters
  • n[in] number of points

  • x[in] x-coordinates

  • y[in] y-coordinates

  • theta[in] angles at nodes

Biarc const &get(int_type idx) const

Get the idx-th biarc.

Biarc const &getAtS(real_type s) const

Get the biarc that contain the curvilinear coordinate s.

inline int_type numSegments() const

Return the number of biarc in the biarc list.

int_type findAtS(real_type &s) const

Get the of the biarc that contain the curvilinear coordinate s.

virtual real_type length() const override

The length of the curve

virtual real_type length_ISO(real_type offs) const override

The length of the curve with offset (ISO)

real_type segment_length(int_type nseg) const

The length of the nseg-th biarc.

real_type segment_length_ISO(int_type nseg, real_type offs) const

The length of the nseg-th biarc with offset offs.

virtual void bbTriangles_ISO(real_type offs, std::vector<Triangle2D> &tvec, real_type max_angle = Utils::m_pi / 6, real_type max_size = 1e100, int_type icurve = 0) const override

Build a cover with triangles of the curve with offset (ISO).

Parameters
  • offs[out] curve offset

  • tvec[out] list of covering triangles

  • max_angle[out] maximum angle variation of the curve covered by a triangle

  • max_size[out] maximum admissible size of the covering tirnagles

  • icurve[out] index of the covering triangles

virtual void bbTriangles_SAE(real_type offs, std::vector<Triangle2D> &tvec, real_type max_angle = Utils::m_pi / 6, real_type max_size = 1e100, int_type icurve = 0) const override

Build a cover with triangles of the curve with offset (SAE).

Parameters
  • offs[out] curve offset

  • tvec[out] list of covering triangles

  • max_angle[out] maximum angle variation of the arc covered by a triangle

  • max_size[out] maximum admissible size of the covering tirnagles

  • icurve[out] index of the covering triangles

virtual void bbTriangles(std::vector<Triangle2D> &tvec, real_type max_angle = Utils::m_pi / 6, real_type max_size = 1e100, int_type icurve = 0) const override

Build a cover with triangles of the curve.

../_images/biarc_cover.jpg

Parameters
  • tvec[out] list of covering triangles

  • max_angle[out] maximum angle variation of the curve covered by a triangle

  • max_size[out] maximum admissible size of the covering tirnagles

  • icurve[out] index of the covering triangles

inline virtual void bbox(real_type &xmin, real_type &ymin, real_type &xmax, real_type &ymax) const override

Compute the bounding box of the curve.

Parameters
  • xmin[out] left bottom

  • ymin[out] left bottom

  • xmax[out] right top

  • ymax[out] right top

virtual void bbox_ISO(real_type offs, real_type &xmin, real_type &ymin, real_type &xmax, real_type &ymax) const override

Compute the bounding box of the curve with offset (ISO).

Parameters
  • offs[in] curve offset

  • xmin[out] left bottom

  • ymin[out] left bottom

  • xmax[out] right top

  • ymax[out] right top

inline virtual real_type thetaBegin() const override

Initial angle of the curve.

inline virtual real_type thetaEnd() const override

Final angle of the curve.

inline virtual real_type xBegin() const override

Initial x-coordinate.

inline virtual real_type yBegin() const override

Initial y-coordinate.

inline virtual real_type xEnd() const override

Final x-coordinate.

inline virtual real_type yEnd() const override

Final y-coordinate.

inline virtual real_type xBegin_ISO(real_type offs) const override

Initial x-coordinate with offset (ISO standard).

inline virtual real_type yBegin_ISO(real_type offs) const override

Initial y-coordinate with offset (ISO standard).

inline virtual real_type xEnd_ISO(real_type offs) const override

Final x-coordinate with offset (ISO standard).

inline virtual real_type yEnd_ISO(real_type offs) const override

Final y-coordinate with offset (ISO standard).

inline virtual real_type tx_Begin() const override

Initial tangent x-coordinate.

inline virtual real_type ty_Begin() const override

Initial tangent y-coordinate.

inline virtual real_type tx_End() const override

Final tangent x-coordinate.

inline virtual real_type ty_End() const override

Final tangent y-coordinate.

inline virtual real_type nx_Begin_ISO() const override

Intial normal x-coordinate (ISO).

inline virtual real_type ny_Begin_ISO() const override

Intial normal y-coordinate (ISO).

inline virtual real_type nx_End_ISO() const override

Final normal x-coordinate (ISO).

inline virtual real_type ny_End_ISO() const override

Final normal y-coordinate (ISO).

virtual real_type theta(real_type) const override

Angle at curvilinear coodinate s.

virtual real_type theta_D(real_type) const override

Angle derivative (curvature) at curvilinear coodinate s.

virtual real_type theta_DD(real_type) const override

Angle second derivative (devitive of curvature) at curvilinear coodinate s.

virtual real_type theta_DDD(real_type) const override

Angle third derivative at curvilinear coodinate s.

virtual real_type tx(real_type) const override

Tangent x-coordinate at curvilinear coodinate s.

virtual real_type ty(real_type) const override

Tangent y-coordinate at curvilinear coodinate s.

virtual real_type tx_D(real_type) const override

Tangent derivative x-coordinate at curvilinear coodinate s.

virtual real_type ty_D(real_type) const override

Tangent derivative y-coordinate at curvilinear coodinate s.

virtual real_type tx_DD(real_type) const override

Tangent second derivative x-coordinate at curvilinear coodinate s.

virtual real_type ty_DD(real_type) const override

Tangent second derivative y-coordinate at curvilinear coodinate s.

virtual real_type tx_DDD(real_type) const override

Tangent third derivative x-coordinate at curvilinear coodinate s.

virtual real_type ty_DDD(real_type) const override

Tangent third derivative y-coordinate at curvilinear coodinate s.

virtual void tg(real_type s, real_type &tg_x, real_type &tg_y) const override

Tangent at curvilinear coodinate s.

virtual void tg_D(real_type s, real_type &tg_x_D, real_type &tg_y_D) const override

Tangent derivative at curvilinear coodinate s.

virtual void tg_DD(real_type s, real_type &tg_x_DD, real_type &tg_y_DD) const override

Tangent second derivative at curvilinear coodinate s.

virtual void tg_DDD(real_type s, real_type &tg_x_DDD, real_type &tg_y_DDD) const override

Tangent third derivative at curvilinear coodinate s.

virtual void evaluate(real_type s, real_type &th, real_type &k, real_type &x, real_type &y) const override

Evaluate curve at curvilinear coordinate s.

Parameters
  • s[in] curvilinear coordinate

  • th[out] angle

  • k[out] curvature

  • x[out] x-coordinate

  • y[out] y-coordinate

virtual void evaluate_ISO(real_type s, real_type offs, real_type &th, real_type &k, real_type &x, real_type &y) const override

Evaluate curve with offset at curvilinear coordinate s (ISO).

Parameters
  • s[in] curvilinear coordinate

  • offs[in] offset

  • th[out] angle

  • k[out] curvature

  • x[out] x-coordinate

  • y[out] y-coordinate

virtual real_type X(real_type) const override

x-coordinate at curvilinear coordinate s.

virtual real_type Y(real_type) const override

y-coordinate at curvilinear coordinate s.

virtual real_type X_D(real_type) const override

x-coordinate derivative at curvilinear coordinate s.

virtual real_type Y_D(real_type) const override

y-coordinate derivative at curvilinear coordinate s.

virtual real_type X_DD(real_type) const override

x-coordinate second derivative at curvilinear coordinate s.

virtual real_type Y_DD(real_type) const override

y-coordinate second derivative at curvilinear coordinate s.

virtual real_type X_DDD(real_type) const override

x-coordinate third derivative at curvilinear coordinate s.

virtual real_type Y_DDD(real_type) const override

y-coordinate third derivative at curvilinear coordinate s.

virtual void eval(real_type s, real_type &x, real_type &y) const override

x and y-coordinate at curvilinear coordinate s.

virtual void eval_D(real_type s, real_type &x_D, real_type &y_D) const override

x and y-coordinate derivative at curvilinear coordinate s.

virtual void eval_DD(real_type s, real_type &x_DD, real_type &y_DD) const override

x and y-coordinate second derivative at curvilinear coordinate s.

virtual void eval_DDD(real_type s, real_type &x_DDD, real_type &y_DDD) const override

x and y-coordinate third derivative at curvilinear coordinate s.

virtual real_type X_ISO(real_type s, real_type offs) const override

x-coordinate at curvilinear coordinate s with offset offs (ISO).

virtual real_type Y_ISO(real_type s, real_type offs) const override

y-coordinate at curvilinear coordinate s with offset offs (ISO).

virtual real_type X_ISO_D(real_type s, real_type offs) const override

x-coordinate derivative at curvilinear coordinate s with offset offs (ISO).

virtual real_type Y_ISO_D(real_type s, real_type offs) const override

y-coordinate derivative at curvilinear coordinate s with offset offs (ISO).

virtual real_type X_ISO_DD(real_type s, real_type offs) const override

x-coordinate second derivative at curvilinear coordinate s with offset offs (ISO).

virtual real_type Y_ISO_DD(real_type s, real_type offs) const override

y-coordinate second derivative at curvilinear coordinate s with offset offs (ISO).

virtual real_type X_ISO_DDD(real_type s, real_type offs) const override

x-coordinate third derivative at curvilinear coordinate s with offset offs (ISO).

virtual real_type Y_ISO_DDD(real_type s, real_type offs) const override

y-coordinate third derivative at curvilinear coordinate s with offset offs (ISO).

virtual void eval_ISO(real_type s, real_type offs, real_type &x, real_type &y) const override

Compute curve at position s with offset offs (ISO).

Parameters
  • s[in] parameter on the curve

  • offs[in] offset of the curve

  • x[out] coordinate

  • y[out] coordinate

virtual void eval_ISO_D(real_type s, real_type offs, real_type &x_D, real_type &y_D) const override

Compute derivative curve at position s with offset offs (ISO).

Parameters
  • s[in] parameter on the curve

  • offs[in] offset of the curve

  • x_D[out] x-coordinate

  • y_D[out] y-coordinate

virtual void eval_ISO_DD(real_type s, real_type offs, real_type &x_DD, real_type &y_DD) const override

Compute second derivative curve at position s with offset offs (ISO).

Parameters
  • s[in] parameter on the curve

  • offs[in] offset of the curve

  • x_DD[out] x-coordinate second derivative

  • y_DD[out] y-coordinate second derivative

virtual void eval_ISO_DDD(real_type s, real_type offs, real_type &x_DDD, real_type &y_DDD) const override

Compute third derivative curve at position s with offset offs (ISO).

Parameters
  • s[in] parameter on the curve

  • offs[in] offset of the curve

  • x_DDD[out] x-coordinate third derivative

  • y_DDD[out] y-coordinate third derivative

virtual void translate(real_type tx, real_type ty) override

translate curve by \( (t_x,t_y) \)

virtual void rotate(real_type angle, real_type cx, real_type cy) override

Rotate curve by angle \( theta \) centered at point \( (c_x,c_y)\).

Parameters
  • angle[in] angle \( theta \)

  • cx[in] \( c_x\)

  • cy[in] \( c_y\)

virtual void scale(real_type sc) override

Scale curve by factor sc.

virtual void reverse() override

Reverse curve parameterization.

virtual void changeOrigin(real_type newx0, real_type newy0) override

Translate curve so that origin will be (newx0, newy0).

virtual void trim(real_type s_begin, real_type s_end) override

Cut curve at parametrix coordinate s_begin and s_end.

virtual int_type closestPoint_ISO(real_type qx, real_type qy, real_type &x, real_type &y, real_type &s, real_type &t, real_type &dst) const override

Given a point find closest point on the curve.

Parameters
  • qx – x-coordinate of the point

  • qy – y-coordinate of the point

  • x – x-coordinate of the projected point on the curve

  • y – y-coordinate of the projected point on the curve

  • s – parameter on the curve of the projection

  • t – curvilinear coordinate of the point x,y (if orthogonal projection)

  • dst – distance point projected point

Returns

1 = point is projected orthogonal 0 = more than one projection (first returned) -1 = minimum point is not othogonal projection to curve

virtual int_type closestPoint_ISO(real_type qx, real_type qy, real_type offs, real_type &x, real_type &y, real_type &s, real_type &t, real_type &dst) const override

Given a point find closest point on the curve.

Parameters
  • qx – x-coordinate of the point

  • qy – y-coordinate of the point

  • offs – offset of the curve

  • x – x-coordinate of the projected point on the curve

  • y – y-coordinate of the projected point on the curve

  • s – parameter on the curve of the projection

  • t – curvilinear coordinate of the point x,y (if orthogonal projection)

  • dst – distance point projected point

Returns

1 = point is projected orthogonal 0 = more than one projection (first returned) -1 = minimum point is not othogonal projection to curve

inline virtual void info(ostream_type &stream) const override

Pretty print of the curve data.

void getSTK(real_type *s, real_type *theta, real_type *kappa) const

Return the biarc as a list of nodes angles and curvatures.

Parameters
  • s[out] nodes

  • theta[out] angles

  • kappa[out] curvature

void getXY(real_type *x, real_type *y) const

Return the biarc XY nodes

Parameters
  • x[out] x-nodes

  • y[out] y-nodes

int_type findST1(real_type x, real_type y, real_type &s, real_type &t) const

Find parametric coordinate.

Parameters
  • x – x-coordinate point

  • y – y-coordinate point

  • s – value \( s \)

  • t – value \( t \)

Returns

idx the segment with point at minimal distance, otherwise -(idx+1) if (x,y) cannot be projected orthogonally on the segment

int_type findST1(int_type ibegin, int_type iend, real_type x, real_type y, real_type &s, real_type &t) const

Find parametric coordinate.

Parameters
  • ibegin – initial segment to compute the distance

  • iend – final segment to compute the distance

  • x – x-coordinate point

  • y – y-coordinate point

  • s – value \( s \)

  • t – value \( t \)

Returns

idx the segment with point at minimal distance, otherwise -(idx+1) if (x,y) cannot be projected orthogonally on the segment

bool collision(BiarcList const &C) const

Detect a collision with another biarc list.

bool collision_ISO(real_type offs, BiarcList const &CL, real_type offs_C) const

Detect a collision with another biarc list with offset.

Parameters
  • offs[in] offset of first biarc

  • CL[in] second biarc

  • offs_C[in] offset of second biarc

inline void intersect(BiarcList const &CL, IntersectList &ilist, bool swap_s_vals) const

intersect a biarc list with another biarc list

Parameters
  • CL[in] second biarc

  • ilist[out] list of the intersection (as parameter on the curves)

  • swap_s_vals[in] if true store (s2,s1) instead of (s1,s2) for each intersection

void intersect_ISO(real_type offs, BiarcList const &CL, real_type offs_obj, IntersectList &ilist, bool swap_s_vals) const

Intersect a biarc list with another biarc list with offset (ISO).

Parameters
  • offs[in] offset of first biarc

  • CL[in] second biarc

  • offs_obj[in] offset of second biarc

  • ilist[out] list of the intersection (as parameter on the curves)

  • swap_s_vals[in] if true store (s2,s1) instead of (s1,s2) for each intersection

inline CurveType type() const

The name of the curve type

inline real_type length_SAE(real_type offs) const

The length of the curve with offset (SAE)

inline void bbox_SAE(real_type offs, real_type &xmin, real_type &ymin, real_type &xmax, real_type &ymax) const

Compute the bounding box of the curve (SAE).

Parameters
  • offs[in] curve offset

  • xmin[out] left bottom

  • ymin[out] left bottom

  • xmax[out] right top

  • ymax[out] right top

inline virtual real_type kappaBegin() const

Initial curvature.

inline virtual real_type kappaEnd() const

Final curvature.

inline real_type xBegin_SAE(real_type offs) const

Initial x-coordinate with offset (SAE standard).

inline real_type yBegin_SAE(real_type offs) const

Initial y-coordinate with offset (SAE standard).

inline real_type xEnd_SAE(real_type offs) const

Final y-coordinate with offset (SAE standard).

inline real_type yEnd_SAE(real_type offs) const

Final y-coordinate with offset (ISO standard).

inline real_type nx_Begin_SAE() const

Intial normal x-coordinate (SAE).

inline real_type ny_Begin_SAE() const

Intial normal y-coordinate (SAE).

inline real_type nx_End_SAE() const

Final normal x-coordinate (SAE).

inline real_type ny_End_SAE() const

Intial normal y-coordinate (SAE).

inline real_type kappa(real_type s) const

Ccurvature at curvilinear coodinate s.

inline real_type kappa_D(real_type s) const

Curvature derivative at curvilinear coodinate s.

inline real_type kappa_DD(real_type s) const

Curvature second derivative at curvilinear coodinate s.

inline real_type nx_ISO(real_type s) const

Normal x-coordinate at curvilinear coodinate s (ISO).

inline real_type nx_ISO_D(real_type s) const

Normal derivative x-coordinate at curvilinear coodinate s (ISO).

inline real_type nx_ISO_DD(real_type s) const

Normal second derivative x-coordinate at curvilinear coodinate s (ISO).

inline real_type nx_ISO_DDD(real_type s) const

Normal third derivative x-coordinate at curvilinear coodinate s (ISO).

inline real_type ny_ISO(real_type s) const

Normal y-coordinate at curvilinear coodinate s (ISO).

inline real_type ny_ISO_D(real_type s) const

Normal derivative y-coordinate at curvilinear coodinate s (ISO).

inline real_type ny_ISO_DD(real_type s) const

Normal second derivative y-coordinate at curvilinear coodinate s (ISO).

inline real_type ny_ISO_DDD(real_type s) const

Normal third derivative y-coordinate at curvilinear coodinate s (ISO).

inline real_type nx_SAE(real_type s) const

Normal x-coordinate at curvilinear coodinate s (SAE).

inline real_type nx_SAE_D(real_type s) const

Normal derivative x-coordinate at curvilinear coodinate s (SAE).

inline real_type nx_SAE_DD(real_type s) const

Normal second derivative x-coordinate at curvilinear coodinate s (SAE).

inline real_type nx_SAE_DDD(real_type s) const

Normal third derivative x-coordinate at curvilinear coodinate s (SAE).

inline real_type ny_SAE(real_type s) const

Normal y-coordinate at curvilinear coodinate s (ISO)

inline real_type ny_SAE_D(real_type s) const

Normal derivative y-coordinate at curvilinear coodinate s (SAE).

inline real_type ny_SAE_DD(real_type s) const

Normal second derivative x-coordinate at curvilinear coodinate s (SAE).

inline real_type ny_SAE_DDD(real_type s) const

Normal third derivative y-coordinate at curvilinear coodinate s (SAE).

inline void nor_ISO(real_type s, real_type &nx, real_type &ny) const

Normal at curvilinear coodinate s (ISO).

inline void nor_ISO_D(real_type s, real_type &nx_D, real_type &ny_D) const

Normal derivative at curvilinear coodinate s (ISO).

inline void nor_ISO_DD(real_type s, real_type &nx_DD, real_type &ny_DD) const

Normal second derivative at curvilinear coodinate s (ISO).

inline void nor_ISO_DDD(real_type s, real_type &nx_DDD, real_type &ny_DDD) const

Normal third derivative at curvilinear coodinate s (ISO).

inline void nor_SAE(real_type s, real_type &nx, real_type &ny) const

Normal at curvilinear coodinate s (SAE).

inline void nor_SAE_D(real_type s, real_type &nx_D, real_type &ny_D) const

Normal derivative at curvilinear coodinate s (SAE).

inline void nor_SAE_DD(real_type s, real_type &nx_DD, real_type &ny_DD) const

Normal second derivative at curvilinear coodinate s (SAE).

inline void nor_SAE_DDD(real_type s, real_type &nx_DDD, real_type &ny_DDD) const

Normal third at curvilinear coodinate s (SAE).

inline virtual void evaluate_SAE(real_type s, real_type offs, real_type &th, real_type &k, real_type &x, real_type &y) const

Evaluate curve with offset at curvilinear coordinate s (SAE).

Parameters
  • s[in] curvilinear coordinate

  • offs[in] offset

  • th[out] angle

  • k[out] curvature

  • x[out] x-coordinate

  • y[out] y-coordinate

inline real_type X_SAE(real_type s, real_type offs) const

x-coordinate at curvilinear coordinate s with offset offs (SAE).

inline real_type Y_SAE(real_type s, real_type offs) const

y-coordinate at curvilinear coordinate s with offset offs (SAE).

inline real_type X_SAE_D(real_type s, real_type offs) const

x-coordinate derivative at curvilinear coordinate s with offset offs (SAE).

inline real_type Y_SAE_D(real_type s, real_type offs) const

y-coordinate derivative at curvilinear coordinate s with offset offs (SAE).

inline real_type X_SAE_DD(real_type s, real_type offs) const

x-coordinate second derivative at curvilinear coordinate s with offset offs (SAE).

inline real_type Y_SAE_DD(real_type s, real_type offs) const

y-coordinate second derivative at curvilinear coordinate s with offset offs (SAE).

inline real_type X_SAE_DDD(real_type s, real_type offs) const

x-coordinate third derivative at curvilinear coordinate s with offset offs (SAE).

inline real_type Y_SAE_DDD(real_type s, real_type offs) const

y-coordinate third derivative at curvilinear coordinate s with offset offs (SAE).

inline void eval_SAE(real_type s, real_type offs, real_type &x, real_type &y) const

Compute curve at position s with offset offs (SAE).

Parameters
  • s[in] parameter on the curve

  • offs[in] offset of the curve

  • x[out] coordinate

  • y[out] coordinate

inline void eval_SAE_D(real_type s, real_type offs, real_type &x_D, real_type &y_D) const

Compute derivative curve at position s with offset offs (SAE).

Parameters
  • s[in] parameter on the curve

  • offs[in] offset of the curve

  • x_D[out] x-coordinate first derivative

  • y_D[out] y-coordinate first derivative

inline void eval_SAE_DD(real_type s, real_type offs, real_type &x_DD, real_type &y_DD) const

Compute second derivative curve at position s with offset offs (SAE).

Parameters
  • s[in] parameter on the curve

  • offs[in] offset of the curve

  • x_DD[out] x-coordinate second derivative

  • y_DD[out] y-coordinate second derivative

inline void eval_SAE_DDD(real_type s, real_type offs, real_type &x_DDD, real_type &y_DDD) const

Compute third derivative curve at position s with offset offs (SAE).

Parameters
  • s[in] parameter on the curve

  • offs[in] offset of the curve

  • x_DDD[out] x-coordinate third derivative

  • y_DDD[out] y-coordinate third derivative

inline bool collision(BaseCurve const &C) const

Check collision with another curve.

inline bool collision_ISO(real_type offs, BaseCurve const &C, real_type offs_C) const

Check collision with another curve with offset (ISO).

Parameters
  • offs[in] curve offset

  • C[in] second curve to check collision

  • offs_C[in] curve offset of the second curve

Returns

true if collision is detected

inline bool collision_SAE(real_type offs, BaseCurve const &C, real_type offs_C) const

Check collision with another curve with offset (SAE).

Parameters
  • offs[in] curve offset

  • C[in] second curve to check collision

  • offs_C[in] curve offset of the second curve

Returns

true if collision is detected

inline void intersect(BaseCurve const &C, IntersectList &ilist, bool swap_s_vals) const

Intersect the curve with another curve.

Parameters
  • C[in] second curve intersect

  • ilist[out] list of the intersection (as parameter on the curves)

  • swap_s_vals[in] if true store (s2,s1) instead of (s1,s2) for each intersection

inline void intersect_ISO(real_type offs, BaseCurve const &C, real_type offs_C, IntersectList &ilist, bool swap_s_vals) const

Intersect the curve with another curve with offset (ISO)

Parameters
  • offs[in] offset first curve

  • C[in] second curve intersect

  • offs_C[in] offset second curve

  • ilist[out] list of the intersection (as parameter on the curves)

  • swap_s_vals[in] if true store (s2,s1) instead of (s1,s2) for each intersection

inline void intersect_SAE(real_type offs, BaseCurve const &C, real_type offs_C, IntersectList &ilist, bool swap_s_vals) const

Intersect the curve with another curve with offset (SAE).

Parameters
  • offs[in] offset first curve

  • C[in] second curve intersect

  • offs_C[in] offset second curve

  • ilist[out] list of the intersection (as parameter on the curves)

  • swap_s_vals[in] if true store (s2,s1) instead of (s1,s2) for each intersection

inline int_type closestPoint_SAE(real_type qx, real_type qy, real_type &x, real_type &y, real_type &s, real_type &t, real_type &dst) const

Given a point find closest point on the curve.

Parameters
  • qx – x-coordinate of the point

  • qy – y-coordinate of the point

  • x – x-coordinate of the projected point on the curve

  • y – y-coordinate of the projected point on the curve

  • s – parameter on the curve of the projection

  • t – curvilinear coordinate of the point x,y (if orthogonal projection)

  • dst – distance point projected point

Returns

1 = point is projected orthogonal 0 = more than one projection (first returned) -1 = minimum point is not othogonal projection to curve

inline int_type closestPoint_SAE(real_type qx, real_type qy, real_type offs, real_type &x, real_type &y, real_type &s, real_type &t, real_type &dst) const

Given a point find closest point on the curve.

Parameters
  • qx – x-coordinate of the point

  • qy – y-coordinate of the point

  • offs – offset of the curve

  • x – x-coordinate of the projected point on the curve

  • y – y-coordinate of the projected point on the curve

  • s – parameter on the curve of the projection

  • t – curvilinear coordinate of the point x,y (if orthogonal projection)

  • dst – distance point projected point

Returns

1 = point is projected orthogonal 0 = more than one projection (first returned) -1 = minimum point is not othogonal projection to curve

inline virtual real_type distance(real_type qx, real_type qy) const

Compute the distance between a point \( q=(q_x,q_y) \) and the curve.

Parameters
  • qx[in] component \( q_x \)

  • qy[in] component \( q_y \)

Returns

the computed distance

inline real_type distance_ISO(real_type qx, real_type qy, real_type offs) const

Compute the distance between a point \( q=(q_x,q_y) \) and the curve with offset (ISO).

Parameters
  • qx[in] component \( q_x \)

  • qy[in] component \( q_y \)

  • offs[in] offset of the curve

Returns

the computed distance

inline real_type distance_SAE(real_type qx, real_type qy, real_type offs) const

Compute the distance between a point \( q=(q_x,q_y) \) and the curve with offset (SAE).

Parameters
  • qx[in] component \( q_x \)

  • qy[in] component \( q_y \)

  • offs[in] offset of the curve

Returns

the computed distance

inline bool findST_ISO(real_type x, real_type y, real_type &s, real_type &t) const

Find the curvilinear coordinate of point \( P=(x,y) \) respect to the curve (ISO), i.e.

\[ P = C(s)+N(s)t \]

where \( C(s) \) is the curve position respect to the curvilinear coordinates and \( C(s) \) is the normal at the point \( C(s) \).

Parameters
  • x[in] component \( x \)

  • y[in] component \( y \)

  • s[out] curvilinear coordinate

  • t[out] offset respect to the curve of \( (x,y) \)

Returns

true if the coordinate are found

inline bool findST_SAE(real_type x, real_type y, real_type &s, real_type &t) const

Find the curvilinear coordinate of point \( (x,y) \) respect to the curve (SAE), i.e.

\[ P = C(s)+N(s)t \]

where \( C(s) \) is the curve position respect to the curvilinear coordinates and \( C(s) \) is the normal at the point \( C(s) \).

Parameters
  • x[in] component \( x \)

  • y[in] component \( y \)

  • s[out] curvilinear coordinate

  • t[out] offset respect to the curve of \( (x,y) \)

Returns

true if the coordinate are found

Friends

friend ostream_type &operator<<(ostream_type &stream, BiarcList const &CL)

pretty print the biarc list