Rhino C++ API  8.13
Public Member Functions | Static Public Attributes | Friends | List of all members
ON_Arc Class Reference

#include <opennurbs_arc.h>

Inheritance diagram for ON_Arc:
ON_Circle

Public Member Functions

 ON_Arc ()=default
 Create a radius one arc with angle = 2*pi. More...
 
 ON_Arc (const ON_2dPoint &start_point, const ON_2dPoint &interior_point, const ON_2dPoint &end_point)
 
 ON_Arc (const ON_3dPoint &center, double radius, double angle_in_radians)
 
 ON_Arc (const ON_3dPoint &start_point, const ON_3dPoint &interior_point, const ON_3dPoint &end_point)
 
 ON_Arc (const ON_Arc &)=default
 
 ON_Arc (const ON_Circle &circle, double angle_in_radians)
 
 ON_Arc (const ON_Circle &circle, ON_Interval angle_interval_in_radians)
 
 ON_Arc (const ON_Plane &plane, const ON_3dPoint &center, double radius, double angle_in_radians)
 
 ON_Arc (const ON_Plane &plane, double radius, double angle_in_radians)
 
 ~ON_Arc ()=default
 
double AngleDegrees () const
 
double AngleRadians () const
 
ON_BoundingBox BoundingBox () const
 
ON_3dPoint ClosestPointTo (const ON_3dPoint &test_point) const
 
bool ClosestPointTo (const ON_3dPoint &test_point, double *t) const
 
bool Create (const ON_2dPoint &start_point, const ON_2dPoint &interior_point, const ON_2dPoint &end_point)
 
bool Create (const ON_2dPoint &start_point, const ON_2dVector &dir_at_start, const ON_2dPoint &end_point)
 
bool Create (const ON_3dPoint &center, double radius, double angle_in_radians)
 
bool Create (const ON_3dPoint &start_point, const ON_3dPoint &interior_point, const ON_3dPoint &end_point)
 
bool Create (const ON_3dPoint &start_point, const ON_3dVector &dir_at_start, const ON_3dPoint &end_point)
 
bool Create (const ON_Circle &circle, double angle_in_radians)
 
bool Create (const ON_Circle &circle, ON_Interval angle_interval_in_radians)
 
bool Create (const ON_Plane &plane, const ON_3dPoint &center, double radius, double angle_in_radians)
 
bool Create (const ON_Plane &plane, double radius, double angle_in_radians)
 
ON_Interval Domain () const
 
ON_Interval DomainDegrees () const
 
ON_Interval DomainRadians () const
 
void Dump (ON_TextLog &dump) const
 
ON_3dPoint EndPoint () const
 
bool GetBoundingBox (ON_BoundingBox &bbox, int bGrowBox=false) const
 
int GetNurbForm (ON_NurbsCurve &nurbs_curve) const
 
bool GetNurbFormParameterFromRadian (double arc_radians_parameter, double *nurbs_parameter) const
 
bool GetRadianFromNurbFormParameter (double nurbs_parameter, double *arc_radians_parameter) const
 
bool GetTightBoundingBox (ON_BoundingBox &tight_bbox, bool bGrowBox=false, const ON_Xform *xform=nullptr) const
 
bool IsCircle () const
 
bool IsLinear (double tol) const
 
bool IsValid () const
 
double Length () const
 
ON_3dPoint MidPoint () const
 
ON_Arcoperator= (const ON_Arc &)=default
 
ON_Arcoperator= (const ON_Circle &)
 
bool Reverse ()
 
double SectorArea () const
 
ON_3dPoint SectorAreaCentroid () const
 
double SegmentArea () const
 
ON_3dPoint SegmentAreaCentroid () const
 
bool SetAngleDegrees (double angle_in_degrees)
 
bool SetAngleIntervalRadians (ON_Interval angle_in_radians)
 
bool SetAngleRadians (double angle_in_radians)
 
ON_3dPoint StartPoint () const
 
bool Trim (ON_Interval domain_radian)
 
- Public Member Functions inherited from ON_Circle
 ON_Circle ()=default
 
 ON_Circle (const ON_2dPoint &P, const ON_2dPoint &Q, const ON_2dPoint &R)
 
 ON_Circle (const ON_3dPoint &center, double radius)
 
 ON_Circle (const ON_3dPoint &P, const ON_3dPoint &Q, const ON_3dPoint &R)
 
 ON_Circle (const ON_Circle &)=default
 
 ON_Circle (const ON_Plane &plane, const ON_3dPoint &center, double radius)
 
 ON_Circle (const ON_Plane &plane, double radius)
 
 ~ON_Circle ()=default
 
ON_BoundingBox BoundingBox () const
 
const ON_3dPointCenter () const
 
double Circumference () const
 
ON_3dPoint ClosestPointTo (const ON_3dPoint &point) const
 returns point on circle that is closest to given point More...
 
bool ClosestPointTo (const ON_3dPoint &point, double *t) const
 returns parameters of point on circle that is closest to given point More...
 
bool Create (const ON_2dPoint &P, const ON_2dPoint &Q, const ON_2dPoint &R)
 
bool Create (const ON_2dPoint &P, const ON_2dVector &tangent_at_P, const ON_2dPoint &Q)
 
bool Create (const ON_3dPoint &center, double radius)
 
bool Create (const ON_3dPoint &P, const ON_3dPoint &Q, const ON_3dPoint &R)
 
bool Create (const ON_3dPoint &P, const ON_3dVector &tangent_at_P, const ON_3dPoint &Q)
 
bool Create (const ON_Plane &plane, const ON_3dPoint &center, double radius)
 
bool Create (const ON_Plane &plane, double radius)
 
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
 
bool GetNurbFormParameterFromRadian (double circle_radians_parameter, double *nurbs_parameter) const
 
bool GetRadianFromNurbFormParameter (double nurbs_parameter, double *circle_radians_parameter) const
 
bool GetTightBoundingBox (ON_BoundingBox &tight_bbox, bool bGrowBox=false, const ON_Xform *xform=nullptr) const
 
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...
 
double MaximumCoordinate () const
 ///< absolute value of maximum coordinate More...
 
const ON_3dVectorNormal () const
 
ON_Circleoperator= (const ON_Circle &)=default
 
const ON_PlanePlane () const
 plane containing circle More...
 
ON_3dPoint PointAt (double) const
 
double Radius () const
 
bool Reverse ()
 
bool Rotate (double angle_in_radians, const ON_3dVector &axis_of_rotation)
 
bool Rotate (double angle_in_radians, const ON_3dVector &axis_of_rotation, const ON_3dPoint &center_of_rotation)
 
bool Rotate (double sin_angle, double cos_angle, const ON_3dVector &axis_of_rotation)
 rotate circle about its center More...
 
bool Rotate (double sin_angle, double cos_angle, const ON_3dVector &axis_of_rotation, const ON_3dPoint &center_of_rotation)
 rotate circle about a point and axis More...
 
ON_3dVector TangentAt (double) const
 
bool Transform (const ON_Xform &)
 
bool Translate (const ON_3dVector &delta)
 

Static Public Attributes

static const ON_Arc UnitCircle
 unit circle in the xy plane More...
 
- Static Public Attributes inherited from ON_Circle
static const ON_Circle UnitCircle
 unit circle in the xy plane More...
 

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
 

Detailed Description

Copyright (c) 1993-2022 Robert McNeel & Associates. All rights reserved. OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert McNeel & Associates.

THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.

For complete openNURBS copyright information see http://www.opennurbs.org. Description: An ON_Arc is a subcurve of 3d circle. Details: 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 orthonormal frame of the plane containing the circle.

Constructor & Destructor Documentation

◆ ON_Arc() [1/9]

ON_Arc::ON_Arc ( )
default

Create a radius one arc with angle = 2*pi.

◆ ~ON_Arc()

ON_Arc::~ON_Arc ( )
default

◆ ON_Arc() [2/9]

ON_Arc::ON_Arc ( const ON_Arc )
default

◆ ON_Arc() [3/9]

ON_Arc::ON_Arc ( const ON_Circle circle,
double  angle_in_radians 
)

Description: Construct an arc from a circle and an angle in radians Parameters: circle - [in] angle_in_radians - [in]

◆ ON_Arc() [4/9]

ON_Arc::ON_Arc ( const ON_Circle circle,
ON_Interval  angle_interval_in_radians 
)

Parameters: circle - [in] angle_interval_in_radians - [in] increasing angle interval in radians with angle_interval_in_radians.Length() <= 2.0*ON_PI.

◆ ON_Arc() [5/9]

ON_Arc::ON_Arc ( const ON_Plane plane,
double  radius,
double  angle_in_radians 
)

Description: Construct an arc from a plane, radius and an angle in radians. The center of the arc is at the plane's origin. Parameters: 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() [6/9]

ON_Arc::ON_Arc ( const ON_3dPoint center,
double  radius,
double  angle_in_radians 
)

Description: 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). Parameters: center - [in] radius - [in] angle_in_radians - [in]

◆ ON_Arc() [7/9]

ON_Arc::ON_Arc ( const ON_Plane plane,
const ON_3dPoint center,
double  radius,
double  angle_in_radians 
)

Description: Construct an arc parallel to plane from a center point, radius, and angle in radians.
The arc starts at center+radius*plane.xaxis. Parameters: 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 ignored. center - [in] circle's center point radius - [in] angle_in_radians - [in]

◆ ON_Arc() [8/9]

ON_Arc::ON_Arc ( const ON_2dPoint start_point,
const ON_2dPoint interior_point,
const ON_2dPoint end_point 
)

Description: Construct an arc that passes through three 2d points. Parameters: start_point - [in] interior_point - [in] end_point - [in]

◆ ON_Arc() [9/9]

ON_Arc::ON_Arc ( const ON_3dPoint start_point,
const ON_3dPoint interior_point,
const ON_3dPoint end_point 
)

Description: Construct an arc that passes through three 3d points. Parameters: start_point - [in] interior_point - [in] end_point - [in]

Member Function Documentation

◆ AngleDegrees()

double ON_Arc::AngleDegrees ( ) const

Returns: The arc's subtended angle in degrees.

◆ AngleRadians()

double ON_Arc::AngleRadians ( ) const

Returns: The arc's subtended angle in radians.

◆ BoundingBox()

ON_BoundingBox ON_Arc::BoundingBox ( ) const

Description: Get arc's 3d axis aligned bounding box. Returns: 3d bounding box.

◆ ClosestPointTo() [1/2]

ON_3dPoint ON_Arc::ClosestPointTo ( const ON_3dPoint test_point) const

Description: Get the point on the arc that is closest to test_point. Parameters: test_point - [in] Returns: 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 returned.

◆ ClosestPointTo() [2/2]

bool ON_Arc::ClosestPointTo ( const ON_3dPoint test_point,
double *  t 
) const

Description: Get the point on the arc that is closest to test_point. Parameters: 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.

◆ Create() [1/9]

bool ON_Arc::Create ( const ON_2dPoint start_point,
const ON_2dPoint interior_point,
const ON_2dPoint end_point 
)

Description: Create an arc that passes through three 2d points. Parameters: start_point - [in] interior_point - [in] end_point - [in]

◆ Create() [2/9]

bool ON_Arc::Create ( const ON_2dPoint start_point,
const ON_2dVector dir_at_start,
const ON_2dPoint end_point 
)

Description: Create an arc from a 2d start point, 2d start direction and a 2d end point. Parameters: start_point - [in] dir_at_start - [in] end_point - [in]

◆ Create() [3/9]

bool ON_Arc::Create ( const ON_3dPoint center,
double  radius,
double  angle_in_radians 
)

Description: 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). Parameters: center - [in] radius - [in] angle_in_radians - [in]

◆ Create() [4/9]

bool ON_Arc::Create ( const ON_3dPoint start_point,
const ON_3dPoint interior_point,
const ON_3dPoint end_point 
)

Description: Create an arc that passes through three 3d points. Parameters: start_point - [in] interior_point - [in] end_point - [in]

◆ Create() [5/9]

bool ON_Arc::Create ( const ON_3dPoint start_point,
const ON_3dVector dir_at_start,
const ON_3dPoint end_point 
)

Description: Create an arc from a 3d start point, 3d start direction and a 3d end point. Parameters: start_point - [in] dir_at_start - [in] end_point - [in]

◆ Create() [6/9]

bool ON_Arc::Create ( const ON_Circle circle,
double  angle_in_radians 
)

Description: Create an arc from a circle and an angle in radians Parameters: circle - [in] angle_in_radians - [in] Returns: true if input is valid and a valid arc is created.

◆ Create() [7/9]

bool ON_Arc::Create ( const ON_Circle circle,
ON_Interval  angle_interval_in_radians 
)

Description: Create an arc from a circle and an increasing angle interval Parameters: circle - [in] angle_interval_in_radians - [in] increasing angle interval in radians with angle_interval_in_radians.Length() <= 2.0*ON_PI Returns: true if input is valid and a valid arc is created.

◆ Create() [8/9]

bool ON_Arc::Create ( const ON_Plane plane,
const ON_3dPoint center,
double  radius,
double  angle_in_radians 
)

Description: Create an arc parallel to plane from a center point, radius, and angle in radians.
The arc starts at center+radius*plane.xaxis. Parameters: 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 ignored. center - [in] circle's center point radius - [in] angle_in_radians - [in]

◆ Create() [9/9]

bool ON_Arc::Create ( const ON_Plane plane,
double  radius,
double  angle_in_radians 
)

Description: Create an arc from a plane, radius and an angle in radians. The center of the arc is at the plane's origin. Parameters: plane - [in] circle is in this plane with center at m_origin center - [in] circle's center point radius - [in] angle_in_radians - [in]

◆ Domain()

ON_Interval ON_Arc::Domain ( ) const

Description: Get evaluation domain. Returns: Evaluation domain (same as DomainRadians()).

◆ DomainDegrees()

ON_Interval ON_Arc::DomainDegrees ( ) const

Returns: The arc's domain in degrees.

◆ DomainRadians()

ON_Interval ON_Arc::DomainRadians ( ) const

Returns: The arc's domain in radians.

◆ Dump()

void ON_Arc::Dump ( ON_TextLog dump) const

Description: Creates a text dump of the arc listing the normal, center radius, start point, end point, and angle. Remarks: Dump() is intended for debugging and is not suitable for creating high quality text descriptions of an arc.

◆ EndPoint()

ON_3dPoint ON_Arc::EndPoint ( ) const

Returns: Point at end of the arc.

◆ GetBoundingBox()

bool ON_Arc::GetBoundingBox ( ON_BoundingBox bbox,
int  bGrowBox = false 
) const

Description: Get arc's 3d axis aligned bounding box or the union of the input box with the arc's bounding box. Parameters: 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. Returns: true if arc has bounding box and calculation was successful.

◆ GetNurbForm()

int ON_Arc::GetNurbForm ( ON_NurbsCurve nurbs_curve) const

Description: Get a rational degree 2 NURBS curve representation of the arc. Note that the parameterization of NURBS curve does not match arc's transcendental parameterization. Use GetRadianFromNurbFormParameter() and GetParameterFromRadian() to convert between the NURBS curve parameter and the transcendental parameter Parameters: nurbs_curve - [out] nurbs_curve returned here. Returns: 0 for failure and 2 for success.

◆ GetNurbFormParameterFromRadian()

bool ON_Arc::GetNurbFormParameterFromRadian ( double  arc_radians_parameter,
double *  nurbs_parameter 
) const

Description: Convert a arc radians parameter to a NURBS curve arc parameter. Parameters: arc_radians_parameter - [in] 0.0 to 2.0*ON_PI nurbs_parameter - [out] Example:

    ON_Arc arc = ...;
    double arc_t = 1.2345; ///< some number in interval (0,2.0*ON_PI).
    double nurbs_t;
    arc.GetNurbFormParameterFromRadian( arc_t, &nurbs_t );

    ON_NurbsCurve nurbs_curve;
    arc.GetNurbsForm( nurbs_curve );
    arc_pt = arc.PointAt(arc_t);
    nurbs_pt = nurbs_curve.PointAt(nurbs_t);

/ arc_pt and nurbs_pt will be the same

Remarks: 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. See Also: ON_Arc::GetNurbFormParameterFromRadian

◆ GetRadianFromNurbFormParameter()

bool ON_Arc::GetRadianFromNurbFormParameter ( double  nurbs_parameter,
double *  arc_radians_parameter 
) const

Description: Convert a NURBS curve arc parameter to a arc radians parameter. Parameters: nurbs_parameter - [in] arc_radians_parameter - [out] Example:

    ON_Arc arc = ...;
    double nurbs_t = 1.2345; ///< some number in interval (0,2.0*ON_PI).
    double arc_t;
    arc.GetRadianFromNurbFormParameter( nurbs_t, &arc_t );

    ON_NurbsCurve nurbs_curve;
    arc.GetNurbsForm( nurbs_curve );
    arc_pt = arc.PointAt(arc_t);
    nurbs_pt = nurbs_curve.PointAt(nurbs_t);

/ arc_pt and nurbs_pt will be the same

Remarks: 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. See Also: ON_Arc::GetNurbFormParameterFromRadian

◆ GetTightBoundingBox()

bool ON_Arc::GetTightBoundingBox ( ON_BoundingBox tight_bbox,
bool  bGrowBox = false,
const ON_Xform xform = nullptr 
) const

Description: Get tight bounding box. Parameters: 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. Returns: True if a valid tight_bbox is returned.

◆ IsCircle()

bool ON_Arc::IsCircle ( ) const

Returns: true if the arc is a complete circle; i.e., the arc's angle is 360 degrees.

◆ IsLinear()

bool ON_Arc::IsLinear ( double  tol) const

Returns: True if the arc is within tol of the chord and chord is longer than tol

◆ IsValid()

bool ON_Arc::IsValid ( ) const

Description: Checks an arc to make sure it is valid. Detail: Radius>0 and 0<AngleRadians()<=2 ON_PI Returns: true if the arc is valid.

◆ Length()

double ON_Arc::Length ( ) const

Returns: Length of the arc = radius*(subtended angle in radians).

◆ MidPoint()

ON_3dPoint ON_Arc::MidPoint ( ) const

Returns: Point at middle of the arc.

◆ operator=() [1/2]

ON_Arc& ON_Arc::operator= ( const ON_Arc )
default

◆ operator=() [2/2]

ON_Arc& ON_Arc::operator= ( const ON_Circle )

◆ Reverse()

bool ON_Arc::Reverse ( )

Description: Reverse the orientation of the arc. Changes the domain from [a,b] to [-b.-a].

◆ SectorArea()

double ON_Arc::SectorArea ( ) const

Returns: Area of the arc's sector.
Remarks: 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.

◆ SectorAreaCentroid()

ON_3dPoint ON_Arc::SectorAreaCentroid ( ) const

Returns: Area centroid of the arc's sector.
Remarks: 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.

◆ SegmentArea()

double ON_Arc::SegmentArea ( ) const

Returns: Area of the arc's segment. Remarks: 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.

◆ SegmentAreaCentroid()

ON_3dPoint ON_Arc::SegmentAreaCentroid ( ) const

Returns: Area centroid of the arc's segment.
Remarks: 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.

◆ SetAngleDegrees()

bool ON_Arc::SetAngleDegrees ( double  angle_in_degrees)

Description: Set arc's subtended angle in degrees. Parameters: angle_in_degrees - [in] 0 < angle_in_degrees <= 360

◆ SetAngleIntervalRadians()

bool ON_Arc::SetAngleIntervalRadians ( ON_Interval  angle_in_radians)

Description: Set arc's angle interval in radians. Parameters: angle_in_radians - [in] increasing interval with start and end angle in radians. Length of the interval <= 2.0*ON_PI. Returns: true if successful.

◆ SetAngleRadians()

bool ON_Arc::SetAngleRadians ( double  angle_in_radians)

Description: Set arc's subtended angle in radians. Parameters: angle_in_radians - [in] 0 <= angle_in_radians <= 2.0*ON_PI

◆ StartPoint()

ON_3dPoint ON_Arc::StartPoint ( ) const

Returns: Point at start of the arc.

◆ Trim()

bool ON_Arc::Trim ( ON_Interval  domain_radian)

Description: Set arc's domain as a subdomain of the circle. Parameters: domain_radian - [in] 0 < domain_radian[1] - domain_radian[0] <= 2.0 * ON*PI

Friends And Related Function Documentation

◆ ON_BinaryArchive::ReadArc

bool ON_BinaryArchive::ReadArc ( ON_Arc )
friend

◆ ON_BinaryArchive::WriteArc

bool ON_BinaryArchive::WriteArc ( const ON_Arc )
friend

Member Data Documentation

◆ UnitCircle

const ON_Arc ON_Arc::UnitCircle
static

unit circle in the xy plane