|
ActiveLib
|
#include <PolyEdge.h>

Public Types | |
| using | Unique = std::unique_ptr<PolyEdge> |
| Unique pointer. | |
| using | Shared = std::shared_ptr<PolyEdge> |
| Shared pointer. | |
| using | Option = std::optional<PolyEdge> |
| Optional. | |
Public Member Functions | |
| PolyEdge () | |
| PolyEdge (const Point &origin, const PolyPoint &end) | |
| PolyEdge (const Point &origin, const Point &end, double radius, Rotation rotation=anticlockwise, double prec=math::eps) | |
| PolyEdge (const Arc &arc) | |
| bool | operator== (const PolyEdge &ref) const |
| The normal to the plane the edge is aligned to (vertical by default) | |
| bool | operator!= (const PolyEdge &ref) const |
| PolyEdge & | operator= (const PolyEdge &source) |
| PolyEdge | operator+ (const Point &offset) const |
| PolyEdge & | operator+= (const Point &offset) |
| PolyEdge | operator- (const Point &offset) const |
| PolyEdge & | operator-= (const Point &offset) |
| PolyEdge | operator* (double scale) const |
| PolyEdge & | operator*= (double scale) |
| PolyEdge | operator* (const Matrix3x3 &matrix) const |
| PolyEdge & | operator*= (const Matrix3x3 &matrix) |
| bool | isArc (double prec=math::eps) const |
| bool | isEqual2D (const PolyEdge &ref, double prec=math::eps) const |
| bool | isEqual3D (const PolyEdge &ref, double prec=math::eps) const |
| bool | isColinearTo2D (const PolyEdge &ref, double prec=math::eps) const |
| bool | isColinearTo3D (const PolyEdge &ref, double prec=math::eps) const |
| bool | isParallelTo2D (const PolyEdge &ref, double prec=math::eps) const |
| bool | isParallelTo3D (const PolyEdge &ref, double prec=math::eps) const |
| bool | isTangentialTo2D (const PolyEdge &ref, double prec=math::eps, double anglePrec=math::epsAngle) const |
| double | getRadius (bool isSigned=false) const |
| double | getSweep () const |
| double | azimuthAngle () const |
| double | altitudeAngle () const |
| double | startTangent () const |
| double | endTangent () const |
| double | getTangentAt (const Point &ref) const |
| Point | centre () const |
| Point | midpoint () const |
| double | getArea (bool isResultSigned=false) const |
| double | length2D () const |
| double | length3D () const |
| std::optional< Arc > | asArc (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 |
| Point | closestPointAlong2D (const Point &ref, double prec=math::eps) const |
| Point | closestPointAlong3D (const Point &ref, double prec=math::eps) const |
| vertex_index | intersectionWith2D (const PolyEdge &ref, XList &inter, double prec=math::eps) const |
| vertex_index | intersectionWith3D (const PolyEdge &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 |
| bool | overlaps2D (const PolyEdge &ref, double prec=math::eps) const |
| void | setRadius (double radius, std::optional< Rotation > rotation=std::nullopt, double prec=math::eps) |
| void | setSweep (double sweep) |
| void | stretchOrigin (const Point &pt, bool canInvert=true, double prec=math::eps) |
| void | stretchEnd (const Point &pt, double prec=math::eps) |
| void | setBaseLevel (double z=0.0) |
| void | offset (double shift) |
| void | extend (double len, bool byEnd=true) |
| void | extend (const Point &ref, bool byEnd=true) |
| void | split (const Point &pos, PolyEdge &offcut, bool keepOrig=true) |
| void | movePolar (double len, double azim, double alt) |
| void | movePolar (double len, double angle) |
| PolyEdge & | flip () |
Public Attributes | |
| Point | origin |
| The edge origin. | |
| PolyPoint | end |
| The edge end. | |
| Vector3 | normal = Vector3(0.0, 0.0, 1.0) |
| The normal to the plane the edge lies in. | |
Class to represent an edge (curved or straight)
|
inline |
Constructor

Constructor
| origin | Origin point of the edge |
| end | End point of the edge |
| PolyEdge::PolyEdge | ( | const Point & | origin, |
| const Point & | end, | ||
| double | radius, | ||
| Rotation | rotation = anticlockwise, | ||
| double | prec = math::eps ) |
Constructor
| origin | Origin point of the edge |
| end | End point of the edge |
| radius | The edge radius (sign indicates arc centre side (+ve = right, -ve = left, 0 = linear) |
| rotation | The rotation direction of the edge |
| prec | The required precision |

| PolyEdge::PolyEdge | ( | const Arc & | arc | ) |
Constructor
| arc | An arc describing the poly-edge |
| double PolyEdge::altitudeAngle | ( | ) | const |
Get the altitude angle of the edge


| Arc::Option PolyEdge::asArc | ( | double | prec = math::eps | ) | const |
Get the edge as an arc
| prec | The required precision |


| double PolyEdge::azimuthAngle | ( | ) | const |
Get the azimuth angle of the edge


| Point PolyEdge::centre | ( | ) | const |
Get the center of the edge


Get the closest point along the edge to a given point in 2D
| ref | The reference point |


Get the closest point along the edge to a given point
| ref | The reference point |

Get the closest point in the edge to a given point in 2D
| ref | The reference point |


Get the closest point in the edge to a given point
| ref | The reference point |


Determine if a point is enclosed by a edge in 2D
| ref | The reference point |
| prec | The required precision |

Determine if a point is enclosed by a edge
| ref | The reference point |

| double PolyEdge::endTangent | ( | ) | const |
Get the tangent angle at the edge end


| void PolyEdge::extend | ( | const Point & | ref, |
| bool | byEnd = true ) |
Extend the edge to the point nearest te specified point
| ref | The point to extend to |
| byEnd | True to extend the edge by the endpoint |

| void PolyEdge::extend | ( | double | len, |
| bool | byEnd = true ) |
Extend the edge length by the specified amount It is also possible to shorten the edge or to set len to negative values. If the edge is an arc, it cannot be extended further than to a full circle, both to the positive and to the negative direction.
| len | The amount to extend the edge by |
| byEnd | True to extend the edge by the endpoint |


| PolyEdge & PolyEdge::flip | ( | ) |
Flip the edge

| double PolyEdge::getArea | ( | bool | isResultSigned = false | ) | const |
Get the edge area (line edges are always zero)
| isResultSigned | True if the result should be signed (reflecting the arc angle) |


| double PolyEdge::getRadius | ( | bool | isSigned = false | ) | const |
Get the radius of the edge
| isSigned | True if the radius should be signed for the side of arc centres (left = -ve, right = +ve) |


|
inline |
Get the edge sweep angle
| double PolyEdge::getTangentAt | ( | const Point & | ref | ) | const |
Get the tangent angle at the specified point
| ref | The reference point |


| vertex_index PolyEdge::intersectionWith2D | ( | const PolyEdge & | ref, |
| XList & | inter, | ||
| double | prec = math::eps ) const |
Get the intersection point of two edges in 2D
| ref | The reference edge |
| inter | The intersection list to populate |
| prec | The required precision |

| vertex_index PolyEdge::intersectionWith3D | ( | const PolyEdge & | ref, |
| XList & | inter, | ||
| double | prec = math::eps ) const |
Get the intersection point of two edges in 3D
| ref | The reference edge |
| inter | The intersection list to populate |
| prec | The required precision |

|
inline |
Determine if the edge is an arc


Check if two edges are colinear
| ref | The reference edge |
| prec | The required precision |


Check if two edges are colinear
| ref | The reference edge |

Determine if two edges are equal in 2D
| ref | The edge to compare with this |
| prec | The required precision |

Determine if two edges are equal
| ref | The edge to compare with this |
| prec | The required precision |


Check if two edges are parallel
| ref | The reference edge |
| prec | The required precision |


Check if two edges are parallel
| ref | The reference edge |


| bool PolyEdge::isTangentialTo2D | ( | const PolyEdge & | ref, |
| double | prec = math::eps, | ||
| double | anglePrec = math::epsAngle ) const |
Check if two edges are tangential (i.e. the end tangent of the reference edge matches the start tangent of this edge)
| ref | The reference edge |
| prec | The coordinate precision |
| anglePrec | The angle precision |


| double PolyEdge::length2D | ( | ) | const |
Get the length of the edge in 2D


| double PolyEdge::length3D | ( | ) | const |
Get the length of the edge


| Point PolyEdge::midpoint | ( | ) | const |
Get the midpoint of the edge


| void PolyEdge::movePolar | ( | double | len, |
| double | angle ) |
Move the edge by the specified distance and angle
| len | The distance to move the edge |
| angle | The angle to move the edge along |

| void PolyEdge::movePolar | ( | double | len, |
| double | azim, | ||
| double | alt ) |
Move the edge by the specified distance and azimuth/altitude angles
| len | The distance to move the edge |
| azim | The azimuth angle to move the edge along |
| alt | The altitude angle to move the edge along |

| void PolyEdge::offset | ( | double | shift | ) |
Offset the edge by the specified amount
| shift | The amount to offset the edge by |


|
inline |
Inequality operator
| ref | The edge to compare with this |

Multiplication operator
| matrix | The matrix to multiply the edge by |

| PolyEdge PolyEdge::operator* | ( | double | scale | ) | const |
Multiplication operator
| scale | The amount to multiply the edge by |

Multiplication with assignment operator
| matrix | The matrix to multiply the edge by |
| PolyEdge & PolyEdge::operator*= | ( | double | scale | ) |
Multiplication with assignment operator
| scale | The amount to multiply the edge by |
Addition operator
| offset | The amount to add to the edge |

Addition with assignment operator
| offset | The amount to add to the edge |

Subtraction operator
| offset | The amount to subtract from the edge |

Subtraction with assignment operator
| offset | The amount to subtract from the edge |

Assignment operator
| source | The edge to be assigned to this |
|
inline |
The normal to the plane the edge is aligned to (vertical by default)
Equality operator
| ref | The edge to compare with this |

Determine if this edge is overlapped by a reference edge (a touching vertex is not an overlap)
| ref | The reference edge |
| prec | The required precision |

Determine the relationship of a point to the edge in 2D
| ref | The point to test |
| prec | The required precision |


Determine the relationship of a point to the edge in 3D
| ref | The point to test |
| prec | The required precision |


| void PolyEdge::setBaseLevel | ( | double | z = 0.0 | ) |
Set the level (z coordinate) of the edge vertices
| z | The required level |
| void PolyEdge::setRadius | ( | double | radius, |
| std::optional< Rotation > | rotation = std::nullopt, | ||
| double | prec = math::eps ) |
Set the edge radius
| radius | The edge radius (sign indicates arc centre side (+ve = right, -ve = left, 0 = linear) |
| rotation | The rotation direction of the edge (undefined = use existing, default = anticlockwise) |
| prec | The required precision |


|
inline |
Set the edge sweep angle
| sweep | The edge sweep angle (0.0 = straight line) |
Split the edge at the specified point
| pos | The point to split the edge at |
| offcut | The offcut created by the split |
| keepOrig | True to maintain the edge origin |

| double PolyEdge::startTangent | ( | ) | const |
Get the tangent angle at the edge start


Stretch the end point for this edge to the specified point
| pt | The point to stretch to |

Stretch the origin point for this edge to the specified point
| pt | The point to stretch to |
| canInvert | True if the direction can be inverted |

