An ON_Arc is a subcurve of 3d circle. More...
#include <opennurbs_arc.h>
Public Member Functions | |
ON_Arc ()=default | |
Create a radius one arc with angle = 2*pi. More... | |
ON_Arc (const ON_Arc &)=default | |
ON_Arc (const ON_Circle &circle, double angle_in_radians) | |
Construct an arc from a circle and an angle in radians More... | |
ON_Arc (const ON_Circle &circle, ON_Interval angle_interval_in_radians) | |
ON_Arc (const ON_Plane &plane, double radius, double angle_in_radians) | |
Construct an arc from a plane, radius and an angle in radians. The center of the arc is at the plane's origin. More... | |
ON_Arc (const ON_3dPoint ¢er, double radius, double angle_in_radians) | |
Construct an arc parallel to the world XY plane from a center point, radius, and angle in radians. The arc starts at center+(radius,0,0). More... | |
ON_Arc (const ON_Plane &plane, const ON_3dPoint ¢er, double radius, double angle_in_radians) | |
Construct an arc parallel to plane from a center point, radius, and angle in radians. The arc starts at center+radius*plane.xaxis. More... | |
ON_Arc (const ON_2dPoint &start_point, const ON_2dPoint &interior_point, const ON_2dPoint &end_point) | |
Construct an arc that passes through three 2d points. More... | |
ON_Arc (const ON_3dPoint &start_point, const ON_3dPoint &interior_point, const ON_3dPoint &end_point) | |
Construct an arc that passes through three 3d points. More... | |
~ON_Arc ()=default | |
double | AngleDegrees () const |
double | AngleRadians () const |
ON_BoundingBox | BoundingBox () const |
Get arc's 3d axis aligned bounding box. More... | |
bool | ClosestPointTo (const ON_3dPoint &test_point, double *t) const |
Get the point on the arc that is closest to test_point. More... | |
ON_3dPoint | ClosestPointTo (const ON_3dPoint &test_point) const |
Get the point on the arc that is closest to test_point. More... | |
bool | Create (const ON_Circle &circle, double angle_in_radians) |
Create an arc from a circle and an angle in radians More... | |
bool | Create (const ON_Circle &circle, ON_Interval angle_interval_in_radians) |
Create an arc from a circle and an increasing angle interval More... | |
bool | Create (const ON_Plane &plane, double radius, double angle_in_radians) |
Create an arc from a plane, radius and an angle in radians. The center of the arc is at the plane's origin. More... | |
bool | Create (const ON_3dPoint ¢er, double radius, double angle_in_radians) |
Create an arc parallel to the world XY plane from a center point, radius, and angle in radians. The arc starts at center+(radius,0,0). More... | |
bool | Create (const ON_Plane &plane, const ON_3dPoint ¢er, double radius, double angle_in_radians) |
Create an arc parallel to plane from a center point, radius, and angle in radians. The arc starts at center+radius*plane.xaxis. More... | |
bool | Create (const ON_2dPoint &start_point, const ON_2dPoint &interior_point, const ON_2dPoint &end_point) |
Create an arc that passes through three 2d points. More... | |
bool | Create (const ON_3dPoint &start_point, const ON_3dPoint &interior_point, const ON_3dPoint &end_point) |
Create an arc that passes through three 3d points. More... | |
bool | Create (const ON_2dPoint &start_point, const ON_2dVector &dir_at_start, const ON_2dPoint &end_point) |
Create an arc from a 2d start point, 2d start direction and a 2d end point. More... | |
bool | Create (const ON_3dPoint &start_point, const ON_3dVector &dir_at_start, const ON_3dPoint &end_point) |
Create an arc from a 3d start point, 3d start direction and a 3d end point. More... | |
ON_Interval | Domain () const |
Get evaluation domain. More... | |
ON_Interval | DomainDegrees () const |
ON_Interval | DomainRadians () const |
void | Dump (ON_TextLog &dump) const |
Creates a text dump of the arc listing the normal, center radius, start point, end point, and angle. More... | |
ON_3dPoint | EndPoint () const |
bool | GetBoundingBox (ON_BoundingBox &bbox, int bGrowBox=false) const |
Get arc's 3d axis aligned bounding box or the union of the input box with the arc's bounding box. More... | |
int | GetNurbForm (ON_NurbsCurve &nurbs_curve) const |
Get a rational degree 2 NURBS curve representation of the arc. Note that the parameterization of NURBS curve does not match arc's transcendental paramaterization. Use GetRadianFromNurbFormParameter() and GetParameterFromRadian() to convert between the NURBS curve parameter and the transcendental parameter More... | |
bool | GetNurbFormParameterFromRadian (double arc_radians_parameter, double *nurbs_parameter) const |
Convert a arc radians parameter to a NURBS curve arc parameter. More... | |
bool | GetRadianFromNurbFormParameter (double nurbs_parameter, double *arc_radians_parameter) const |
Convert a NURBS curve arc parameter to a arc radians parameter. More... | |
bool | GetTightBoundingBox (ON_BoundingBox &tight_bbox, bool bGrowBox=false, const ON_Xform *xform=nullptr) const |
Get tight bounding box. More... | |
bool | IsCircle () const |
bool | IsValid () const |
Checks an arc to make sure it is valid. Detail: Radius>0 and 0<AngleRadians()<=2 ON_PI More... | |
double | Length () const |
ON_3dPoint | MidPoint () const |
ON_Arc & | operator= (const ON_Arc &)=default |
ON_Arc & | operator= (const ON_Circle &) |
bool | Reverse () |
Reverse the orientation of the arc. Changes the domain from [a,b] to [-b.-a]. More... | |
double | SectorArea () const |
ON_3dPoint | SectorAreaCentroid () const |
double | SegmentArea () const |
ON_3dPoint | SegmentAreaCentroid () const |
bool | SetAngleDegrees (double angle_in_degrees) |
Set arc's subtended angle in degrees. More... | |
bool | SetAngleIntervalRadians (ON_Interval angle_in_radians) |
Set arc's angle interval in radians. More... | |
bool | SetAngleRadians (double angle_in_radians) |
Set arc's subtended angle in radians. More... | |
ON_3dPoint | StartPoint () const |
bool | Trim (ON_Interval domain_radian) |
Set arc's domain as a subdomain of the circle. More... | |
Public Member Functions inherited from ON_Circle | |
ON_Circle ()=default | |
ON_Circle (const ON_Circle &)=default | |
ON_Circle (const ON_Plane &plane, double radius) | |
ON_Circle (const ON_3dPoint ¢er, double radius) | |
ON_Circle (const ON_Plane &plane, const ON_3dPoint ¢er, double radius) | |
ON_Circle (const ON_2dPoint &P, const ON_2dPoint &Q, const ON_2dPoint &R) | |
ON_Circle (const ON_3dPoint &P, const ON_3dPoint &Q, const ON_3dPoint &R) | |
~ON_Circle ()=default | |
ON_BoundingBox | BoundingBox () const |
const ON_3dPoint & | Center () const |
double | Circumference () const |
bool | ClosestPointTo (const ON_3dPoint &point, double *t) const |
returns parameters of point on circle that is closest to given point More... | |
ON_3dPoint | ClosestPointTo (const ON_3dPoint &point) const |
returns point on circle that is closest to given point More... | |
bool | Create (const ON_Plane &plane, double radius) |
bool | Create (const ON_3dPoint ¢er, double radius) |
bool | Create (const ON_Plane &plane, const ON_3dPoint ¢er, double radius) |
bool | Create (const ON_2dPoint &P, const ON_2dPoint &Q, const ON_2dPoint &R) |
bool | Create (const ON_3dPoint &P, const ON_3dPoint &Q, const ON_3dPoint &R) |
bool | Create (const ON_2dPoint &P, const ON_2dVector &tangent_at_P, const ON_2dPoint &Q) |
bool | Create (const ON_3dPoint &P, const ON_3dVector &tangent_at_P, const ON_3dPoint &Q) |
ON_3dVector | DerivativeAt (int, double) const |
double | Diameter () const |
double | EquationAt (const ON_2dPoint &plane_point) const |
evaluate circle's implicit equation in plane More... | |
int | GetNurbForm (ON_NurbsCurve &nurbs_curve) const |
Get a four span rational degree 2 NURBS circle representation of the circle. More... | |
bool | GetNurbFormParameterFromRadian (double circle_radians_parameter, double *nurbs_parameter) const |
Convert a circle radians parameter to a NURBS curve circle parameter. More... | |
bool | GetRadianFromNurbFormParameter (double nurbs_parameter, double *circle_radians_parameter) const |
Convert a NURBS curve circle parameter to a circle radians parameter. More... | |
bool | GetTightBoundingBox (ON_BoundingBox &tight_bbox, bool bGrowBox=false, const ON_Xform *xform=nullptr) const |
Get tight bounding box. More... | |
ON_2dVector | GradientAt (const ON_2dPoint &plane_point) const |
bool | IsInPlane (const ON_Plane &, double=ON_ZERO_TOLERANCE) const |
bool UpdatePoints(); // sets m_point[] to have valid points More... | |
bool | IsValid () const |
A Valid circle has m_radius>0 and m_plane.IsValid(). More... | |
const ON_3dVector & | Normal () const |
ON_Circle & | operator= (const ON_Circle &)=default |
const ON_Plane & | Plane () const |
ON_3dPoint | PointAt (double) const |
double | Radius () const |
bool | Reverse () |
bool | Rotate (double sin_angle, double cos_angle, const ON_3dVector &axis_of_rotation) |
rotate circle about its center More... | |
bool | Rotate (double angle_in_radians, const ON_3dVector &axis_of_rotation) |
bool | Rotate (double sin_angle, double cos_angle, const ON_3dVector &axis_of_rotation, const ON_3dPoint ¢er_of_rotation) |
rotate circle about a point and axis More... | |
bool | Rotate (double angle_in_radians, const ON_3dVector &axis_of_rotation, const ON_3dPoint ¢er_of_rotation) |
ON_3dVector | TangentAt (double) const |
bool | Transform (const ON_Xform &) |
bool | Translate (const ON_3dVector &delta) |
Static Public Attributes | |
static const ON_Arc | UnitCircle |
Static Public Attributes inherited from ON_Circle | |
static const ON_Circle | UnitCircle |
Friends | |
bool | ON_BinaryArchive::ReadArc (ON_Arc &) |
bool | ON_BinaryArchive::WriteArc (const ON_Arc &) |
Additional Inherited Members | |
Public Attributes inherited from ON_Circle | |
ON_Plane | plane = ON_Plane::World_xy |
double | radius = 1.0 |
An ON_Arc is a subcurve of 3d circle.
The curve is parameterized by an angle expressed in radians. For an IsValid() arc the total subtended angle AngleRadians() = Domain()(1) - Domain()(0) must satisfy 0< AngleRadians() <2*Pi .
The parameterization of the ON_Arc is inherited from the ON_Circle it is derived from. In particular t -> center + cos(t)*radius*xaxis + sin(t)*radius*yaxis where xaxis and yaxis, (part of ON_Circle::m_plane) form an othonormal frame of the plane containing the circle.
|
default |
Create a radius one arc with angle = 2*pi.
|
default |
|
default |
ON_Arc::ON_Arc | ( | const ON_Circle & | circle, |
double | angle_in_radians | ||
) |
Construct an arc from a circle and an angle in radians
circle | [in] |
angle_in_radians | [in] |
ON_Arc::ON_Arc | ( | const ON_Circle & | circle, |
ON_Interval | angle_interval_in_radians | ||
) |
circle | [in] |
angle_interval_in_radians | [in] increasing angle interval in radians with angle_interval_in_radians.Length() <= 2.0*ON_PI. |
ON_Arc::ON_Arc | ( | const ON_Plane & | plane, |
double | radius, | ||
double | angle_in_radians | ||
) |
Construct an arc from a plane, radius and an angle in radians. The center of the arc is at the plane's origin.
plane | [in] circle is in this plane with center at m_origin |
center | [in] circle's center point |
radius | [in] |
angle_in_radians | [in] |
ON_Arc::ON_Arc | ( | const ON_3dPoint & | center, |
double | radius, | ||
double | angle_in_radians | ||
) |
Construct an arc parallel to the world XY plane from a center point, radius, and angle in radians. The arc starts at center+(radius,0,0).
center | [in] |
radius | [in] |
angle_in_radians | [in] |
ON_Arc::ON_Arc | ( | const ON_Plane & | plane, |
const ON_3dPoint & | center, | ||
double | radius, | ||
double | angle_in_radians | ||
) |
Construct an arc parallel to plane from a center point, radius, and angle in radians. The arc starts at center+radius*plane.xaxis.
plane | [in] The plane x, y and z axis are used to defines the circle plane's x, y and z axis. The plane origin is ignorned. |
center | [in] circle's center point |
radius | [in] |
angle_in_radians | [in] |
ON_Arc::ON_Arc | ( | const ON_2dPoint & | start_point, |
const ON_2dPoint & | interior_point, | ||
const ON_2dPoint & | end_point | ||
) |
Construct an arc that passes through three 2d points.
start_point | [in] |
interior_point | [in] |
end_point | [in] |
ON_Arc::ON_Arc | ( | const ON_3dPoint & | start_point, |
const ON_3dPoint & | interior_point, | ||
const ON_3dPoint & | end_point | ||
) |
Construct an arc that passes through three 3d points.
start_point | [in] |
interior_point | [in] |
end_point | [in] |
double ON_Arc::AngleDegrees | ( | ) | const |
double ON_Arc::AngleRadians | ( | ) | const |
ON_BoundingBox ON_Arc::BoundingBox | ( | ) | const |
Get arc's 3d axis aligned bounding box.
bool ON_Arc::ClosestPointTo | ( | const ON_3dPoint & | test_point, |
double * | t | ||
) | const |
Get the point on the arc that is closest to test_point.
test_point | [in] |
t | [out] parameter (in radians) of the point on the arc that is closest to test_point. If test_point is the center of the arc, then the starting point of the arc is (arc.Domain()[0]) returned. |
ON_3dPoint ON_Arc::ClosestPointTo | ( | const ON_3dPoint & | test_point | ) | const |
Get the point on the arc that is closest to test_point.
test_point | [in] |
bool ON_Arc::Create | ( | const ON_Circle & | circle, |
double | angle_in_radians | ||
) |
Create an arc from a circle and an angle in radians
circle | [in] |
angle_in_radians | [in] |
bool ON_Arc::Create | ( | const ON_Circle & | circle, |
ON_Interval | angle_interval_in_radians | ||
) |
Create an arc from a circle and an increasing angle interval
circle | [in] |
angle_interval_in_radians | [in] increasing angle interval in radians with angle_interval_in_radians.Length() <= 2.0*ON_PI |
bool ON_Arc::Create | ( | const ON_Plane & | plane, |
double | radius, | ||
double | angle_in_radians | ||
) |
Create an arc from a plane, radius and an angle in radians. The center of the arc is at the plane's origin.
plane | [in] circle is in this plane with center at m_origin |
center | [in] circle's center point |
radius | [in] |
angle_in_radians | [in] |
bool ON_Arc::Create | ( | const ON_3dPoint & | center, |
double | radius, | ||
double | angle_in_radians | ||
) |
Create an arc parallel to the world XY plane from a center point, radius, and angle in radians. The arc starts at center+(radius,0,0).
center | [in] |
radius | [in] |
angle_in_radians | [in] |
bool ON_Arc::Create | ( | const ON_Plane & | plane, |
const ON_3dPoint & | center, | ||
double | radius, | ||
double | angle_in_radians | ||
) |
Create an arc parallel to plane from a center point, radius, and angle in radians. The arc starts at center+radius*plane.xaxis.
plane | [in] The plane x, y and z axis are used to defines the circle plane's x, y and z axis. The plane origin is ignorned. |
center | [in] circle's center point |
radius | [in] |
angle_in_radians | [in] |
bool ON_Arc::Create | ( | const ON_2dPoint & | start_point, |
const ON_2dPoint & | interior_point, | ||
const ON_2dPoint & | end_point | ||
) |
Create an arc that passes through three 2d points.
start_point | [in] |
interior_point | [in] |
end_point | [in] |
bool ON_Arc::Create | ( | const ON_3dPoint & | start_point, |
const ON_3dPoint & | interior_point, | ||
const ON_3dPoint & | end_point | ||
) |
Create an arc that passes through three 3d points.
start_point | [in] |
interior_point | [in] |
end_point | [in] |
bool ON_Arc::Create | ( | const ON_2dPoint & | start_point, |
const ON_2dVector & | dir_at_start, | ||
const ON_2dPoint & | end_point | ||
) |
Create an arc from a 2d start point, 2d start direction and a 2d end point.
start_point | [in] |
dir_at_start | [in] |
end_point | [in] |
bool ON_Arc::Create | ( | const ON_3dPoint & | start_point, |
const ON_3dVector & | dir_at_start, | ||
const ON_3dPoint & | end_point | ||
) |
Create an arc from a 3d start point, 3d start direction and a 3d end point.
start_point | [in] |
dir_at_start | [in] |
end_point | [in] |
ON_Interval ON_Arc::Domain | ( | ) | const |
Get evaluation domain.
ON_Interval ON_Arc::DomainDegrees | ( | ) | const |
ON_Interval ON_Arc::DomainRadians | ( | ) | const |
void ON_Arc::Dump | ( | ON_TextLog & | dump | ) | const |
Creates a text dump of the arc listing the normal, center radius, start point, end point, and angle.
Dump() is intended for debugging and is not suitable for creating high quality text descriptions of an arc.
ON_3dPoint ON_Arc::EndPoint | ( | ) | const |
bool ON_Arc::GetBoundingBox | ( | ON_BoundingBox & | bbox, |
int | bGrowBox = false |
||
) | const |
Get arc's 3d axis aligned bounding box or the union of the input box with the arc's bounding box.
bbox | [in/out] 3d axis aligned bounding box |
bGrowBox | [in] (default=false) If true, then the union of the input bbox and the arc's bounding box is returned in bbox. If false, the arc's bounding box is returned in bbox. |
int ON_Arc::GetNurbForm | ( | ON_NurbsCurve & | nurbs_curve | ) | const |
Get a rational degree 2 NURBS curve representation of the arc. Note that the parameterization of NURBS curve does not match arc's transcendental paramaterization. Use GetRadianFromNurbFormParameter() and GetParameterFromRadian() to convert between the NURBS curve parameter and the transcendental parameter
nurbs_curve | [out] nurbs_curve returned here. |
bool ON_Arc::GetNurbFormParameterFromRadian | ( | double | arc_radians_parameter, |
double * | nurbs_parameter | ||
) | const |
Convert a arc radians parameter to a NURBS curve arc parameter.
arc_radians_parameter | [in] 0.0 to 2.0*ON_PI |
nurbs_parameter | [out] |
The NURBS curve parameter is with respect to the NURBS curve created by ON_Arc::GetNurbForm. At radian values of 0.0, 0.5*ON_PI, ON_PI, 1.5*ON_PI, and 2.0*ON_PI, the nurbs parameter and radian parameter are the same. At all other values the nurbs and radian parameter values are different.
bool ON_Arc::GetRadianFromNurbFormParameter | ( | double | nurbs_parameter, |
double * | arc_radians_parameter | ||
) | const |
Convert a NURBS curve arc parameter to a arc radians parameter.
nurbs_parameter | [in] |
arc_radians_parameter | [out] |
The NURBS curve parameter is with respect to the NURBS curve created by ON_Arc::GetNurbForm. At nurbs parameter values of 0.0, 0.5*ON_PI, ON_PI, 1.5*ON_PI, and 2.0*ON_PI, the nurbs parameter and radian parameter are the same. At all other values the nurbs and radian parameter values are different.
bool ON_Arc::GetTightBoundingBox | ( | ON_BoundingBox & | tight_bbox, |
bool | bGrowBox = false , |
||
const ON_Xform * | xform = nullptr |
||
) | const |
Get tight bounding box.
tight_bbox | [in/out] tight bounding box |
bGrowBox | [in] (default=false) If true and the input tight_bbox is valid, then returned tight_bbox is the union of the input tight_bbox and the arc's tight bounding box. |
xform | [in] (default=nullptr) If not nullptr, the tight bounding box of the transformed arc is calculated. The arc is not modified. |
bool ON_Arc::IsCircle | ( | ) | const |
bool ON_Arc::IsValid | ( | ) | const |
Checks an arc to make sure it is valid. Detail: Radius>0 and 0<AngleRadians()<=2 ON_PI
double ON_Arc::Length | ( | ) | const |
ON_3dPoint ON_Arc::MidPoint | ( | ) | const |
bool ON_Arc::Reverse | ( | ) |
Reverse the orientation of the arc. Changes the domain from [a,b] to [-b.-a].
double ON_Arc::SectorArea | ( | ) | const |
The arc's sector is the region bounded by the arc, the line segment from the arc's end to the center, and the line segment from the center to the arc's start.
ON_3dPoint ON_Arc::SectorAreaCentroid | ( | ) | const |
The arc's sector is the region bounded by the arc, the line segment from the arc's end to the center, and the line segment from the center to the arc's start.
double ON_Arc::SegmentArea | ( | ) | const |
The arc's segment is the region bounded by the arc and the line segment from the arc's end to the arc's start.
ON_3dPoint ON_Arc::SegmentAreaCentroid | ( | ) | const |
The arc's segment is the region bounded by the arc and the line segment from the arc's end to the arc's start.
bool ON_Arc::SetAngleDegrees | ( | double | angle_in_degrees | ) |
Set arc's subtended angle in degrees.
angle_in_degrees | [in] 0 < angle_in_degrees <= 360 |
bool ON_Arc::SetAngleIntervalRadians | ( | ON_Interval | angle_in_radians | ) |
Set arc's angle interval in radians.
angle_in_radians | [in] increasing interval with start and end angle in radians. Length of the interval <= 2.0*ON_PI. |
bool ON_Arc::SetAngleRadians | ( | double | angle_in_radians | ) |
Set arc's subtended angle in radians.
angle_in_radians | [in] 0 <= angle_in_radians <= 2.0*ON_PI |
ON_3dPoint ON_Arc::StartPoint | ( | ) | const |
bool ON_Arc::Trim | ( | ON_Interval | domain_radian | ) |
Set arc's domain as a subdomain of the circle.
domain_radian | [in] 0 < domain_radian[1] - domain_radian[0] <= 2.0 * ON*PI |
|
friend |
|
friend |
|
static |