ActiveLib
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | List of all members
active::geometry::Arc Class Reference

Class to represent an arc. More...

#include <Arc.h>

Inheritance diagram for active::geometry::Arc:
Inheritance graph
[legend]
Collaboration diagram for active::geometry::Arc:
Collaboration graph
[legend]

Public Types

using Unique = std::unique_ptr<Arc>
 Unique pointer.
 
using Shared = std::shared_ptr<Arc>
 Shared pointer.
 
using Option = std::optional<Arc>
 Optional.
 

Public Member Functions

 Arc ()
 
 Arc (const Point &centre, double radius, double sweep=2.0 *math::pi, double start=0, const Vector3 &norm=Vector3(0, 0, 1))
 
 Arc (const Point &centre, const Point &pt1, const Point &pt2, bool isClockwise)
 
 Arc (const Point &pt1, const Point &pt2, const Point &pt3)
 
 Arc (const Point &origin, const PolyPoint &end)
 
ArcclonePtr () const
 
bool operator== (const Arc &ref) const
 
bool operator!= (const Arc &ref) const
 
Arcoperator= (const Arc &source)
 
Arc operator+ (const Point &offset) const
 
Arcoperator+= (const Point &offset)
 
Arc operator- (const Point &offset) const
 
Arcoperator-= (const Point &offset)
 
Arc operator* (double scale) const
 
Arcoperator*= (double scale)
 
Arc operator* (const Matrix3x3 &matrix) const
 
Arcoperator*= (const Matrix3x3 &matrix)
 
double isValid (double prec=math::eps) const
 
bool isEqual2D (const Arc &ref, double prec=math::eps) const
 
bool isEqual3D (const Arc &ref, double prec=math::eps) const
 
Point getOrigin () const
 
PolyPoint getEnd () const
 
Point midpoint () const
 
double getEndAngle () const
 
Plane getPlane () const
 
Box::Unique bounds () const
 
double length2D () const
 
double length3D () const
 
double getArea (bool isArcOnly=true, bool isResultSigned=false) const
 
bool isColinearTo2D (const Arc &ref, double prec=math::eps) const
 
bool isColinearTo3D (const Arc &ref, double prec=math::eps) const
 
bool isParallelTo2D (const Arc &ref, double prec=math::eps) const
 
bool isParallelTo3D (const Arc &ref, double prec=math::eps) const
 
Point closestPointAlong2D (const Point &ref, double prec=math::eps) const
 
Point closestPointAlong3D (const Point &ref, double prec=math::eps) const
 
Point closestPointTo2D (const Point &ref, double prec=math::eps) const
 
Point closestPointTo3D (const Point &ref, double prec=math::eps) const
 
vertex_index intersectionWith (const Plane &ref, XList &inter, double prec=math::eps) const
 
vertex_index intersectionWith2D (const Line &ref, XList &inter, double prec=math::eps) const
 
vertex_index intersectionWith2D (const Arc &ref, XList &inter, double prec=math::eps) const
 
vertex_index intersectionWith3D (const Line &ref, XList &inter, double prec=math::eps) const
 
vertex_index intersectionWith3D (const Arc &ref, XList &inter, double prec=math::eps) const
 
Position positionOf2D (const Point &ref, double prec=math::eps) const
 
Position positionOf3D (const Point &ref, double prec=math::eps) const
 
bool encloses2D (const Point &ref, double prec=math::eps) const
 
bool encloses3D (const Point &ref, double prec=math::eps) const
 
void setEndAngle (double end)
 
void movePolar (double len, double azim, double alt)
 
void movePolar (double len, double angle)
 
void expand (double inc)
 
void spin (double rotAngle)
 
void flip ()
 
- Public Member Functions inherited from active::utility::Cloner
virtual ~Cloner ()=default
 

Public Attributes

Point centre
 
Vector3 normal
 
double radius
 
double startAngle
 
double sweep
 

Protected Member Functions

void initLevel (Leveller &level, double prec=math::eps) const
 
bool createIntersect (const Point &pt, const Arc &arc, const Arc &ref, XList &inter, double prec=math::eps) const
 
bool createIntersect (const Point &pt, const Arc &arc, const Line &ref, XList &inter, double prec=math::eps) const
 
vertex_index intersectionWithLevel (const Line &ref, XList &inter, double prec=math::eps) const
 
vertex_index intersectionWithLevel (const Arc &ref, XList &inter, double prec=math::eps) const
 

Detailed Description

Class to represent an arc.

Constructor & Destructor Documentation

◆ Arc() [1/5]

Arc::Arc ( )

Constructor

Here is the caller graph for this function:

◆ Arc() [2/5]

Arc::Arc ( const Point & centre,
double radius,
double sweep = 2.0 * math::pi,
double start = 0,
const Vector3 & norm = Vector3(0, 0, 1) )

Constructor

Parameters
centreCentre of the arc
startStart angle of the arc sweep
sweepArc sweep angle
normNormal to the arc plane

◆ Arc() [3/5]

Arc::Arc ( const Point & centre,
const Point & pt1,
const Point & pt2,
bool isClockwise )

Constructor

Parameters
centreCentre of the arc
pt1First point on the arc
pt2Second point on the arc
isClockwiseTrue if the arc travels in a clockwise direction from pt1 to pt2
Here is the call graph for this function:

◆ Arc() [4/5]

Arc::Arc ( const Point & pt1,
const Point & pt2,
const Point & pt3 )

Constructor

Parameters
pt1First point on the arc (Note: points must be consecutive)
pt2Second point on the arc
pt3Third point on the arc
Here is the call graph for this function:

◆ Arc() [5/5]

Arc::Arc ( const Point & origin,
const PolyPoint & end )

Constructor

Parameters
originOrigin point of the arc
endEnd point of the arc
Here is the call graph for this function:

Member Function Documentation

◆ bounds()

Box::Unique Arc::bounds ( ) const

Get the bounds of the arc

Returns
The bounds of the arc
Here is the call graph for this function:
Here is the caller graph for this function:

◆ clonePtr()

Arc * active::geometry::Arc::clonePtr ( ) const
inlinevirtual

Clone method

Returns
A clone of this object

Implements active::utility::Cloner.

Here is the call graph for this function:

◆ closestPointAlong2D()

Point Arc::closestPointAlong2D ( const Point & ref,
double prec = math::eps ) const

Get the closest point along the arc to a given point in 2D

Parameters
refThe reference point
Returns
The closest point along the arc to the reference point
Here is the call graph for this function:
Here is the caller graph for this function:

◆ closestPointAlong3D()

Point Arc::closestPointAlong3D ( const Point & ref,
double prec = math::eps ) const

Get the closest point along the arc to a given point

Parameters
refThe reference point
Returns
The closest point along the line to the reference point
Here is the call graph for this function:
Here is the caller graph for this function:

◆ closestPointTo2D()

Point Arc::closestPointTo2D ( const Point & ref,
double prec = math::eps ) const

Get the closest point in the arc to a given point in 2D

Parameters
refThe reference point
Returns
The closest point in the arc to the reference point
Here is the call graph for this function:
Here is the caller graph for this function:

◆ closestPointTo3D()

Point Arc::closestPointTo3D ( const Point & ref,
double prec = math::eps ) const

Get the closest point in the arc to a given point

Parameters
refThe reference point
Returns
The closest point in the arc to the reference point
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createIntersect() [1/2]

bool Arc::createIntersect ( const Point & pt,
const Arc & arc,
const Arc & ref,
XList & inter,
double prec = math::eps ) const
protected

Create an intersection point

Parameters
ptThe intersection point
arcThe source arc
refThe reference arc
interThe intersection list to populate
precThe required precision
Returns
True if a new intersection was formed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createIntersect() [2/2]

bool Arc::createIntersect ( const Point & pt,
const Arc & arc,
const Line & ref,
XList & inter,
double prec = math::eps ) const
protected

Create an intersection point

Parameters
ptThe intersection point
arcThe source arc
refThe reference line
interThe intersection list to populate
precThe required precision
Returns
True if a new intersection was formed
Here is the call graph for this function:

◆ encloses2D()

bool Arc::encloses2D ( const Point & ref,
double prec = math::eps ) const

Determine if a point is enclosed by an arc in 2D

Parameters
refThe reference point
Returns
True if the arcarc encloses the point
Here is the call graph for this function:

◆ encloses3D()

bool Arc::encloses3D ( const Point & ref,
double prec = math::eps ) const

Determine if a point is enclosed by an arc

Parameters
refThe reference point
Returns
True if the arc encloses the point
Here is the call graph for this function:

◆ expand()

void active::geometry::Arc::expand ( double inc)
inline

Adjust the radius by the specified amount

Parameters
incThe expansion amount

◆ flip()

void Arc::flip ( )

Flip the arc

◆ getArea()

double Arc::getArea ( bool isArcOnly = true,
bool isResultSigned = false ) const

Get the arc area

Parameters
isArcOnlyTrue if only the area enclosed by the arc is included (not the wedge to the centre)
isResultSignedTrue if the result should be signed (reflecting the arc angle)
Returns
The arc area
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEnd()

PolyPoint Arc::getEnd ( ) const

Get the end point of the arc

Returns
The end point
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEndAngle()

double active::geometry::Arc::getEndAngle ( ) const
inline

Get the arc end angle

Returns
The arc end angle
Here is the caller graph for this function:

◆ getOrigin()

Point Arc::getOrigin ( ) const

Get the origin point of the arc

Returns
The origin point
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPlane()

Plane Arc::getPlane ( ) const

Get the plane of the arc

Returns
The plane of the arc
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initLevel()

void Arc::initLevel ( Leveller & level,
double prec = math::eps ) const
protected

Initialise a Leveller to transform the arc to flat plane

Parameters
levelThe Leveller to be initialised
precThe required precision
Here is the call graph for this function:
Here is the caller graph for this function:

◆ intersectionWith()

vertex_index Arc::intersectionWith ( const Plane & ref,
XList & inter,
double prec = math::eps ) const

Get the intersection point of an arc and plane in 3D

Parameters
refThe reference plane
interThe intersection list to populate
precThe required precision
Returns
The number of intersections calculated
Here is the call graph for this function:

◆ intersectionWith2D() [1/2]

vertex_index Arc::intersectionWith2D ( const Arc & ref,
XList & inter,
double prec = math::eps ) const

Get the intersection point of two arcs in 2D

Parameters
refThe reference arc
interThe intersection list to populate
precThe required precision
Returns
The number of intersections calculated
Here is the call graph for this function:

◆ intersectionWith2D() [2/2]

vertex_index Arc::intersectionWith2D ( const Line & ref,
XList & inter,
double prec = math::eps ) const

Get the intersection point of an arc and line in 2D

Parameters
refThe reference line
interThe intersection list to populate
precThe required precision
Returns
The number of intersections calculated
Here is the call graph for this function:
Here is the caller graph for this function:

◆ intersectionWith3D() [1/2]

vertex_index Arc::intersectionWith3D ( const Arc & ref,
XList & inter,
double prec = math::eps ) const

Get the intersection point of two arcs in 3D

Parameters
refThe reference arc
interThe intersection list to populate
precThe required precision
Returns
The number of intersections calculated
Here is the call graph for this function:

◆ intersectionWith3D() [2/2]

vertex_index Arc::intersectionWith3D ( const Line & ref,
XList & inter,
double prec = math::eps ) const

Get the intersection point of an arc and line in 3D

Parameters
refThe reference line
interThe intersection list to populate
precThe required precision
Returns
The number of intersections calculated
Here is the call graph for this function:
Here is the caller graph for this function:

◆ intersectionWithLevel() [1/2]

vertex_index Arc::intersectionWithLevel ( const Arc & ref,
XList & inter,
double prec = math::eps ) const
protected

Get the intersection point between two co-planar horizontal arcs

Parameters
refThe reference arc
interThe intersection list to populate
precThe required precision
Returns
The number of intersections calculated
Here is the call graph for this function:

◆ intersectionWithLevel() [2/2]

vertex_index Arc::intersectionWithLevel ( const Line & ref,
XList & inter,
double prec = math::eps ) const
protected

Get the intersection point between a co-planar horizontal line and arc

Parameters
refThe reference line
interThe intersection list to populate
precThe required precision
Returns
The number of intersections calculated
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isColinearTo2D()

bool Arc::isColinearTo2D ( const Arc & ref,
double prec = math::eps ) const

Check if two arcs are colinear

Parameters
refThe reference arc
Returns
True if the arcs are colinear
Here is the call graph for this function:

◆ isColinearTo3D()

bool Arc::isColinearTo3D ( const Arc & ref,
double prec = math::eps ) const

Check if two arcs are colinear

Parameters
refThe reference arc
Returns
True if the arcs are colinear
Here is the call graph for this function:

◆ isEqual2D()

bool Arc::isEqual2D ( const Arc & ref,
double prec = math::eps ) const

Determine if two arcs are equal in 2D

Parameters
refThe arc to compare with this
precThe required precision
Returns
True if the arcs are identical
Here is the call graph for this function:

◆ isEqual3D()

bool Arc::isEqual3D ( const Arc & ref,
double prec = math::eps ) const

Determine if two arcs are equal

Parameters
refThe arc to compare with this
precThe required precision
Returns
True if the arcs are identical
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isParallelTo2D()

bool Arc::isParallelTo2D ( const Arc & ref,
double prec = math::eps ) const

Check if two arcs are parallel

Parameters
refThe reference arc
Returns
True if they are parallel
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isParallelTo3D()

bool Arc::isParallelTo3D ( const Arc & ref,
double prec = math::eps ) const

Check if two arcs are concentric

Parameters
refThe reference arc
Returns
True if the arcs are concentric
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isValid()

double Arc::isValid ( double prec = math::eps) const

Determine if the arc is valid

Returns
True if the arc is valid
Here is the call graph for this function:
Here is the caller graph for this function:

◆ length2D()

double Arc::length2D ( ) const

Get the length of the arc in 2D

Returns
The 2D arc length
Here is the caller graph for this function:

◆ length3D()

double Arc::length3D ( ) const

Get the length of the arc

Returns
The length of the arc
Here is the caller graph for this function:

◆ midpoint()

Point Arc::midpoint ( ) const

Get the midpoint of the arc

Returns
The midpoint of the arc
Here is the call graph for this function:
Here is the caller graph for this function:

◆ movePolar() [1/2]

void Arc::movePolar ( double len,
double angle )

Move the arc by the specified distance and angle

Parameters
lenThe distance to move the arc
angleThe angle to move the arc along
Here is the call graph for this function:

◆ movePolar() [2/2]

void Arc::movePolar ( double len,
double azim,
double alt )

Move the arc by the specified distance and azimuth/altitude angles

Parameters
lenThe distance to move the arc
azimThe azimuth angle to move the arc along
altThe altitude angle to move the arc along
Here is the call graph for this function:

◆ operator!=()

bool active::geometry::Arc::operator!= ( const Arc & ref) const
inline

Inequality operator

Parameters
refThe line to compare with this
Returns
True if the lines are different
Here is the call graph for this function:

◆ operator*() [1/2]

Arc Arc::operator* ( const Matrix3x3 & matrix) const

Multiplication operator

Parameters
matrixThe matrix to multiply the arc by
Returns
A multiplied arc
Here is the call graph for this function:

◆ operator*() [2/2]

Arc Arc::operator* ( double scale) const

Multiplication operator

Parameters
scaleThe amount to multiply the arc by
Returns
A multiplied arc
Here is the call graph for this function:

◆ operator*=() [1/2]

Arc & Arc::operator*= ( const Matrix3x3 & matrix)

Multiplication with assignment operator

Parameters
matrixThe matrix to multiply the arc by
Returns
A reference to this
Here is the call graph for this function:

◆ operator*=() [2/2]

Arc & Arc::operator*= ( double scale)

Multiplication with assignment operator

Parameters
scaleThe amount to multiply the arc by
Returns
A reference to this

◆ operator+()

Arc Arc::operator+ ( const Point & offset) const

Addition operator

Parameters
offsetThe amount to add to the arc
Returns
An offset arc
Here is the call graph for this function:

◆ operator+=()

Arc & Arc::operator+= ( const Point & offset)

Addition with assignment operator

Parameters
offsetThe amount to add to the arc
Returns
A reference to this

◆ operator-()

Arc Arc::operator- ( const Point & offset) const

Subtraction operator

Parameters
offsetThe amount to subtract from the arc
Returns
An offset arc
Here is the call graph for this function:

◆ operator-=()

Arc & Arc::operator-= ( const Point & offset)

Subtraction with assignment operator

Parameters
offsetThe amount to subtract from the arc
Returns
A reference to this

◆ operator=()

Arc & Arc::operator= ( const Arc & source)

Assignment operator

Parameters
sourceThe arc to be assigned to this
Returns
A reference to this arc

◆ operator==()

bool active::geometry::Arc::operator== ( const Arc & ref) const
inline

Equality operator

Parameters
refThe line to compare with this
Returns
True if the lines are identical
Here is the call graph for this function:

◆ positionOf2D()

Position Arc::positionOf2D ( const Point & ref,
double prec = math::eps ) const

Determine the relationship of a point to the arc in 2D

Parameters
refThe point to test
precThe required precision
Returns
The relative position of the point
Here is the call graph for this function:
Here is the caller graph for this function:

◆ positionOf3D()

Position Arc::positionOf3D ( const Point & ref,
double prec = math::eps ) const

Determine the relationship of a point to the arc in 3D

Parameters
refThe point to test
precThe required precision
Returns
The relative position of the point
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setEndAngle()

void active::geometry::Arc::setEndAngle ( double end)
inline

Set the arc end angle

Parameters
endThe arc end angle

◆ spin()

void active::geometry::Arc::spin ( double rotAngle)
inline

Spin the arc about its axis by the specified angle

Parameters
rotAngleThe rotation angle

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