/* $NoKeywords: $ */ /* // // Copyright (c) 1993-2012 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 . // //////////////////////////////////////////////////////////////// */ #if !defined(ON_ARC_INC_) #define ON_ARC_INC_ /* 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 othonormal frame of the plane containing the circle. */ class ON_CLASS ON_Arc : public ON_Circle { public: // Create a radius one arc with angle = 2*pi ON_Arc(); /* Description: Construct an arc from a circle and an angle in radians Parameters: circle - [in] angle_in_radians - [in] */ ON_Arc( const ON_Circle& circle, double angle_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( const ON_Circle& circle, ON_Interval angle_interval_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( const ON_Plane& plane, 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( 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 ignorned. center - [in] circle's center point radius - [in] angle_in_radians - [in] */ ON_Arc( const ON_Plane& plane, const ON_3dPoint& center, double radius, double angle_in_radians ); /* Description: Construct an arc that passes through three 2d points. Parameters: start_point - [in] interior_point - [in] end_point - [in] */ 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 3d points. Parameters: start_point - [in] interior_point - [in] end_point - [in] */ ON_Arc( const ON_3dPoint& start_point, const ON_3dPoint& interior_point, const ON_3dPoint& end_point ); /* 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. */ bool Create( const ON_Circle& circle, double angle_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. */ bool Create( const ON_Circle& circle, ON_Interval angle_interval_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] */ bool Create( const ON_Plane& plane, 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] */ bool Create( 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 ignorned. center - [in] circle's center point radius - [in] angle_in_radians - [in] */ bool Create( const ON_Plane& plane, const ON_3dPoint& center, double radius, double angle_in_radians ); /* Description: Create an arc that passes through three 2d points. Parameters: start_point - [in] interior_point - [in] end_point - [in] */ bool Create( const ON_2dPoint& start_point, const ON_2dPoint& interior_point, const ON_2dPoint& end_point ); /* Description: Create an arc that passes through three 3d points. Parameters: start_point - [in] interior_point - [in] end_point - [in] */ bool Create( const ON_3dPoint& start_point, const ON_3dPoint& interior_point, const ON_3dPoint& 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] */ bool Create( const ON_2dPoint& start_point, const ON_2dVector& dir_at_start, const ON_2dPoint& 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] */ bool Create( const ON_3dPoint& start_point, const ON_3dVector& dir_at_start, const ON_3dPoint& end_point ); ON_Arc& operator=( const ON_Circle& ); ~ON_Arc(); // 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. void Dump( ON_TextLog& dump ) const; // Description: // Checks an arc to make sure it is valid. // Detail: // Radius>0 and 0