LibreCAD
|
#include <geoarc.h>
Public Member Functions | |
Arc (const Coordinate ¢er, double radius, double startAngle, double endAngle) | |
Arc (const Coordinate ¢er, double radius, double startAngle, double endAngle, bool CCW) | |
Arc (const Arc &c) | |
Arc (Arc &&c) noexcept | |
Arc & | operator= (Arc &&c) noexcept |
const Coordinate | center () const |
Returns center of Arc. More... | |
double | radius () const |
Returns the radius of Arc. More... | |
double | startAngle () const |
Returns the startAngle. More... | |
double | endAngle () const |
Returns the EndAngle. More... | |
double | length () const |
Coordinate | startP () const |
Coordinate | endP () const |
Area | boundingBox () const |
bool | CCW () const |
Returns of the arc is in reversed direction. More... | |
Coordinate | nearestPointOnPath (const Coordinate &coord) const |
Coordinate | nearestPointOnEntity (const Coordinate &coord) const |
const maths::Equation | equation () const |
bool | isAngleBetween (double angle) const |
virtual void | accept (GeoEntityVisitor &v) const override |
double | angle () const |
double | bulge () const |
![]() | |
virtual | ~Base ()=default |
![]() | |
virtual | ~Visitable ()=default |
Static Public Member Functions | |
static Arc | createArc3P (const Coordinate &p1, const Coordinate &p2, const Coordinate &p3) |
static Arc | createArcBulge (const Coordinate &p1, const Coordinate &p2, const double bulge) |
Private Attributes | |
Coordinate | _center |
Coordinate center of Arc. More... | |
double | _radius |
Double _Radius of Arc. More... | |
double | _startAngle |
Double startAngle of Arc. More... | |
double | _endAngle |
Double endAngle of Arc. More... | |
bool | _CCW |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Arc &a) |
Arc::Arc | ( | const Coordinate & | center, |
double | radius, | ||
double | startAngle, | ||
double | endAngle | ||
) |
Create a new Arc center center location radius radius of the arc startAngle, will be corrected to 0..2*PI endAngle, will be corrected to 0..2*PI
Arc will always be setup such that startAngle will increase or decrease to endAngle So it's perfectly possible to have a startAngle > endAngle
Definition at line 8 of file geoarc.cpp.
Arc::Arc | ( | const Coordinate & | center, |
double | radius, | ||
double | startAngle, | ||
double | endAngle, | ||
bool | CCW | ||
) |
Create a new Arc center center location radius radius of the arc startAngle, will be corrected to 0..2*PI endAngle, will be corrected to 0..2*PI CCW, setup arc to be drawn ClockWise or counter clockwise
Definition at line 23 of file geoarc.cpp.
|
inline |
|
inlineoverridevirtual |
Implements lc::Visitable.
Reimplemented in lc::entity::Arc.
double Arc::angle | ( | ) | const |
Returns the angle between start and end points
Definition at line 167 of file geoarc.cpp.
Area Arc::boundingBox | ( | ) | const |
Tight bounding box for the area
Definition at line 138 of file geoarc.cpp.
double Arc::bulge | ( | ) | const |
Returns arc bulge
Definition at line 171 of file geoarc.cpp.
bool Arc::CCW | ( | ) | const |
Returns of the arc is in reversed direction.
Definition at line 126 of file geoarc.cpp.
const Coordinate Arc::center | ( | ) | const |
|
static |
Definition at line 27 of file geoarc.cpp.
|
static |
Definition at line 51 of file geoarc.cpp.
double Arc::endAngle | ( | ) | const |
Coordinate Arc::endP | ( | ) | const |
Coordinate of the end point
Definition at line 134 of file geoarc.cpp.
|
inline |
bool Arc::isAngleBetween | ( | double | angle | ) | const |
Definition at line 163 of file geoarc.cpp.
double Arc::length | ( | ) | const |
Calculates arc length This assumes that startAngle and endAngle are between -M_PI and M_PI and the difference is not bigger then 2.*M_PI TODO: Should we make this more reliable, for example to have angle is 4*MPI it's still correctly calculated?
Definition at line 118 of file geoarc.cpp.
Coordinate Arc::nearestPointOnEntity | ( | const Coordinate & | coord | ) | const |
Definition at line 98 of file geoarc.cpp.
Coordinate Arc::nearestPointOnPath | ( | const Coordinate & | coord | ) | const |
Definition at line 95 of file geoarc.cpp.
double Arc::radius | ( | ) | const |
double Arc::startAngle | ( | ) | const |
Coordinate Arc::startP | ( | ) | const |
Coordinate of the start point
Definition at line 130 of file geoarc.cpp.
|
friend |
|
private |
Coordinate center of Arc.
|
private |
|
private |
|
private |