Rhino C++ API  9.0
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ON_Circle Class Reference

#include <opennurbs_circle.h>

Inheritance diagram for ON_Circle:
ON_Arc

Public Member Functions

 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)
 

Public Attributes

ON_Plane plane = ON_Plane::World_xy
 
double radius = 1.0
 

Static Public Attributes

static const ON_Circle UnitCircle
 unit circle in the xy plane More...
 
static const ON_Circle UnsetCircle
 invalid circle with ON_Plane::Unset and ON_UNSET_VALUE radius; More...
 

Detailed Description

Description: ON_Circle is a circle in 3d. The circle is represented by a radius and an orthonormal frame of the plane containing the circle, with origin at the center.

An IsValid() circle has positive radius and an IsValid() plane defining the frame.

The circle is parameterized by radians from 0 to 2 Pi given by t -> center + cos(t)*radius*xaxis + sin(t)*radius*yaxis
where center, xaxis and yaxis define the orthonormal frame of the circle's plane.

Constructor & Destructor Documentation

◆ ON_Circle() [1/7]

ON_Circle::ON_Circle ( )
default

◆ ~ON_Circle()

ON_Circle::~ON_Circle ( )
default

◆ ON_Circle() [2/7]

ON_Circle::ON_Circle ( const ON_Circle )
default

◆ ON_Circle() [3/7]

ON_Circle::ON_Circle ( const ON_Plane plane,
double  radius 
)

Creates a circle in the plane with center at plane.origin.

◆ ON_Circle() [4/7]

ON_Circle::ON_Circle ( const ON_3dPoint center,
double  radius 
)

Creates a circle parallel to the world XY plane with given center and radius

◆ ON_Circle() [5/7]

ON_Circle::ON_Circle ( const ON_Plane plane,
const ON_3dPoint center,
double  radius 
)

Creates a circle parallel to the plane with given center and radius.

◆ ON_Circle() [6/7]

ON_Circle::ON_Circle ( const ON_2dPoint P,
const ON_2dPoint Q,
const ON_2dPoint R 
)

Create a circle through three 2d points. The start/end of the circle is at point P.

Parameters
Pcircle through 3 2d points

◆ ON_Circle() [7/7]

ON_Circle::ON_Circle ( const ON_3dPoint P,
const ON_3dPoint Q,
const ON_3dPoint R 
)

Create a circle through three 3d points. The start/end of the circle is at point P.

Member Function Documentation

◆ BoundingBox()

ON_BoundingBox ON_Circle::BoundingBox ( ) const

◆ Center()

const ON_3dPoint& ON_Circle::Center ( ) const

◆ Circumference()

double ON_Circle::Circumference ( ) const

◆ ClosestPointTo() [1/2]

ON_3dPoint ON_Circle::ClosestPointTo ( const ON_3dPoint point) const

returns point on circle that is closest to given point

◆ ClosestPointTo() [2/2]

bool ON_Circle::ClosestPointTo ( const ON_3dPoint point,
double *  t 
) const

returns parameters of point on circle that is closest to given point

◆ Create() [1/7]

bool ON_Circle::Create ( const ON_2dPoint P,
const ON_2dPoint Q,
const ON_2dPoint R 
)

Create a circle through three 2d points. The start/end of the circle is at point P.

Parameters
Pcircle through 3 2d points

◆ Create() [2/7]

bool ON_Circle::Create ( const ON_2dPoint P,
const ON_2dVector tangent_at_P,
const ON_2dPoint Q 
)

Create a circle from two 2d points and a tangent at the first point. The start/end of the circle is at point P.

◆ Create() [3/7]

bool ON_Circle::Create ( const ON_3dPoint center,
double  radius 
)

Creates a circle parallel to the world XY plane with given center and radius

◆ Create() [4/7]

bool ON_Circle::Create ( const ON_3dPoint P,
const ON_3dPoint Q,
const ON_3dPoint R 
)

Create a circle through three 3d points. The start/end of the circle is at point P.

◆ Create() [5/7]

bool ON_Circle::Create ( const ON_3dPoint P,
const ON_3dVector tangent_at_P,
const ON_3dPoint Q 
)

Create a circle from two 3d points and a tangent at the first point. The start/end of the circle is at point P.

◆ Create() [6/7]

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

Creates a circle parallel to the plane with given center and radius.

◆ Create() [7/7]

bool ON_Circle::Create ( const ON_Plane plane,
double  radius 
)

Creates a circle in the plane with center at plane.origin.

◆ DerivativeAt()

ON_3dVector ON_Circle::DerivativeAt ( int  ,
double   
) const

◆ Diameter()

double ON_Circle::Diameter ( ) const

◆ EquationAt()

double ON_Circle::EquationAt ( const ON_2dPoint plane_point) const

evaluate circle's implicit equation in plane

◆ GetNurbForm()

int ON_Circle::GetNurbForm ( ON_NurbsCurve nurbs_curve) const

Description: Get a four span rational degree 2 NURBS circle representation of the circle. Returns: 2 for success, 0 for failure Remarks: Note that the parameterization of NURBS curve does not match circle's transcendental parameterization. Use ON_Circle::GetRadianFromNurbFormParameter() and ON_Circle::GetParameterFromRadian() to convert between the NURBS curve parameter and the transcendental parameter.

◆ GetNurbFormParameterFromRadian()

bool ON_Circle::GetNurbFormParameterFromRadian ( double  circle_radians_parameter,
double *  nurbs_parameter 
) const

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

    ON_Circle circle = ...;
    double circle_t = 1.2345; ///< some number in interval (0,2.0*ON_PI).
    double nurbs_t;
    circle.GetNurbFormParameterFromRadian( circle_t, &nurbs_t );

    ON_NurbsCurve nurbs_curve;
    circle.GetNurbForm( nurbs_curve );
    circle_pt = circle.PointAt(circle_t);
    nurbs_pt = nurbs_curve.PointAt(nurbs_t);

/ circle_pt and nurbs_pt will be the same

Remarks: The NURBS curve parameter is with respect to the NURBS curve created by ON_Circle::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_Circle::GetRadianFromNurbFormParameter

◆ GetRadianFromNurbFormParameter()

bool ON_Circle::GetRadianFromNurbFormParameter ( double  nurbs_parameter,
double *  circle_radians_parameter 
) const

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

    ON_Circle circle = ...;
    double nurbs_t = 1.2345; ///< some number in interval (0,2.0*ON_PI).
    double circle_t;
    circle.GetRadianFromNurbFormParameter( nurbs_t, &circle_t );

    ON_NurbsCurve nurbs_curve;
    circle.GetNurbForm( nurbs_curve );
    circle_pt = circle.PointAt(circle_t);
    nurbs_pt = nurbs_curve.PointAt(nurbs_t);

/ circle_pt and nurbs_pt will be the same

Remarks: The NURBS curve parameter is with respect to the NURBS curve created by ON_Circle::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_Circle::GetNurbFormParameterFromRadian

◆ GetTightBoundingBox()

bool ON_Circle::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 circle's tight bounding box. xform -[in] (default=nullptr) If not nullptr, the tight bounding box of the transformed circle is calculated. The circle is not modified. Returns: True if a valid tight_bbox is returned.

◆ GradientAt()

ON_2dVector ON_Circle::GradientAt ( const ON_2dPoint plane_point) const

◆ IsInPlane()

bool ON_Circle::IsInPlane ( const ON_Plane ,
double  = ON_ZERO_TOLERANCE 
) const

bool UpdatePoints(); ///< sets m_point[] to have valid points

◆ IsValid()

bool ON_Circle::IsValid ( ) const

A Valid circle has m_radius>0 and m_plane.IsValid().

◆ MaximumCoordinate()

double ON_Circle::MaximumCoordinate ( ) const

///< absolute value of maximum coordinate

◆ Normal()

const ON_3dVector& ON_Circle::Normal ( ) const

◆ operator=()

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

◆ Plane()

const ON_Plane& ON_Circle::Plane ( ) const

plane containing circle

◆ PointAt()

ON_3dPoint ON_Circle::PointAt ( double  ) const

Circles use trigonometric parameterization t -> center + cos(t)*radius*xaxis + sin(t)*radius*yaxis

◆ Radius()

double ON_Circle::Radius ( ) const

◆ Reverse()

bool ON_Circle::Reverse ( )

◆ Rotate() [1/4]

bool ON_Circle::Rotate ( double  angle_in_radians,
const ON_3dVector axis_of_rotation 
)

◆ Rotate() [2/4]

bool ON_Circle::Rotate ( double  angle_in_radians,
const ON_3dVector axis_of_rotation,
const ON_3dPoint center_of_rotation 
)

◆ Rotate() [3/4]

bool ON_Circle::Rotate ( double  sin_angle,
double  cos_angle,
const ON_3dVector axis_of_rotation 
)

rotate circle about its center

◆ Rotate() [4/4]

bool ON_Circle::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

◆ TangentAt()

ON_3dVector ON_Circle::TangentAt ( double  ) const

◆ Transform()

bool ON_Circle::Transform ( const ON_Xform )

◆ Translate()

bool ON_Circle::Translate ( const ON_3dVector delta)

Member Data Documentation

◆ plane

ON_Plane ON_Circle::plane = ON_Plane::World_xy

◆ radius

double ON_Circle::radius = 1.0

◆ UnitCircle

const ON_Circle ON_Circle::UnitCircle
static

unit circle in the xy plane

◆ UnsetCircle

const ON_Circle ON_Circle::UnsetCircle
static

invalid circle with ON_Plane::Unset and ON_UNSET_VALUE radius;