Rhino C++ API  8.14
Public Member Functions | Public Attributes | List of all members
ON_Torus Class Reference

#include <opennurbs_torus.h>

Public Member Functions

 ON_Torus ()
 
 ON_Torus (const ON_Circle &major__circle, double minor__radius)
 
 ON_Torus (const ON_Plane &major__plane, double major__radius, double minor__radius)
 
 ~ON_Torus ()
 
ON_3dVector Axis () const
 
ON_3dPoint Center () const
 
ON_3dPoint ClosestPointTo (ON_3dPoint test_point) const
 returns point on torus that is closest to test_point More...
 
bool ClosestPointTo (ON_3dPoint test_point, double *major_angle_radians, double *minor_angle_radians) const
 returns parameters of point on torus that is closest to test_point. More...
 
bool Create (const ON_Circle &major__circle, double minor__radius)
 
bool Create (const ON_Plane &major__plane, double major__radius, double minor__radius)
 
int GetNurbForm (ON_NurbsSurface &) const
 parameterization of NURBS surface does not match torus's transcendental parameterization More...
 
bool IsValid (ON_TextLog *text_log=nullptr) const
 
ON_Circle MajorCircleDegrees (double minor_angle_degrees) const
 
ON_Circle MajorCircleRadians (double minor_angle_radians) const
 
double MajorRadius () const
 
ON_Circle MinorCircleDegrees (double major_angle_degrees) const
 
ON_Circle MinorCircleRadians (double major_angle_radians) const
 
double MinorRadius () const
 
ON_3dVector NormalAt (double major_angle_radians, double minor_angle_radians) const
 
ON_3dPoint PointAt (double major_angle_radians, double minor_angle_radians) const
 
ON_RevSurfaceRevSurfaceForm (ON_RevSurface *srf=nullptr) const
 
bool Rotate (double angle_radians, const ON_3dVector &axis_of_rotation)
 
bool Rotate (double angle_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 torus about its origin More...
 
bool Rotate (double sin_angle, double cos_angle, const ON_3dVector &axis_of_rotation, const ON_3dPoint &center_of_rotation)
 rotate torus about a point and axis More...
 
bool Transform (const ON_Xform &)
 
bool Translate (const ON_3dVector &)
 

Public Attributes

double major_radius
 

minor_radius

More...
 
double minor_radius
 

0

More...
 
ON_Plane plane
 for expert users More...
 

Detailed Description

Description: The torus is defined by a major circle and minor radius. The torus is parameterized by (major_angle,minor_angle). The angles are specified in radians. The domain of both parameters is (0,2pi).

Constructor & Destructor Documentation

◆ ON_Torus() [1/3]

ON_Torus::ON_Torus ( )

◆ ON_Torus() [2/3]

ON_Torus::ON_Torus ( const ON_Plane major__plane,
double  major__radius,
double  minor__radius 
)

◆ ON_Torus() [3/3]

ON_Torus::ON_Torus ( const ON_Circle major__circle,
double  minor__radius 
)

◆ ~ON_Torus()

ON_Torus::~ON_Torus ( )

Member Function Documentation

◆ Axis()

ON_3dVector ON_Torus::Axis ( ) const

◆ Center()

ON_3dPoint ON_Torus::Center ( ) const

◆ ClosestPointTo() [1/2]

ON_3dPoint ON_Torus::ClosestPointTo ( ON_3dPoint  test_point) const

returns point on torus that is closest to test_point

◆ ClosestPointTo() [2/2]

bool ON_Torus::ClosestPointTo ( ON_3dPoint  test_point,
double *  major_angle_radians,
double *  minor_angle_radians 
) const

returns parameters of point on torus that is closest to test_point.

◆ Create() [1/2]

bool ON_Torus::Create ( const ON_Circle major__circle,
double  minor__radius 
)

◆ Create() [2/2]

bool ON_Torus::Create ( const ON_Plane major__plane,
double  major__radius,
double  minor__radius 
)

◆ GetNurbForm()

int ON_Torus::GetNurbForm ( ON_NurbsSurface ) const

parameterization of NURBS surface does not match torus's transcendental parameterization

returns 0=failure, 2=success

◆ IsValid()

bool ON_Torus::IsValid ( ON_TextLog text_log = nullptr) const

◆ MajorCircleDegrees()

ON_Circle ON_Torus::MajorCircleDegrees ( double  minor_angle_degrees) const

Description: Get the circle that is the isocurve on the torus at a specified minor angle. Parameters: minor_angle_degrees - [in] Returns: A circle with normal major_circle.plane.zaxis that starts at PointAt( 0.0, minor_angle_degrees*ON_PI/180.0 ). See Also: ON_Torus::MajorCircleRadians ON_Torus::MajorCircleDegrees ON_Torus::MinorCircleRadians ON_Torus::MinorCircleDegrees

◆ MajorCircleRadians()

ON_Circle ON_Torus::MajorCircleRadians ( double  minor_angle_radians) const

Description: Get the circle that is the isocurve on the torus at a specified minor angle. Parameters: minor_angle_radians - [in] Returns: A circle with normal major_circle.plane.zaxis that starts at PointAt( 0.0, minor_angle_radians ). See Also: ON_Torus::MajorCircleRadians ON_Torus::MajorCircleDegrees ON_Torus::MinorCircleRadians ON_Torus::MinorCircleDegrees

◆ MajorRadius()

double ON_Torus::MajorRadius ( ) const

◆ MinorCircleDegrees()

ON_Circle ON_Torus::MinorCircleDegrees ( double  major_angle_degrees) const

Description: Get the minor circle that is the isocurve on the torus at a specified major angle. Parameters: major_angle_degrees - [in] Returns: A circle with radius = minor_radis, center = major_circle.PointAt(major_angle_degrees*ON_PI/180.0), and starting point PointAt( major_angle_degrees*ON_PI/180.0, 0.0 ). See Also: ON_Torus::MajorCircleRadians ON_Torus::MajorCircleDegrees ON_Torus::MinorCircleRadians ON_Torus::MinorCircleDegrees

◆ MinorCircleRadians()

ON_Circle ON_Torus::MinorCircleRadians ( double  major_angle_radians) const

Description: Get the minor circle that is the isocurve on the torus at a specified major angle. Parameters: major_angle_radians - [in] Returns: A circle with radius = minor_radis, center = major_circle.PointAt(major_angle_radians), and starting point PointAt( major_angle_radians, 0.0 ). See Also: ON_Torus::MajorCircleRadians ON_Torus::MajorCircleDegrees ON_Torus::MinorCircleRadians ON_Torus::MinorCircleDegrees

◆ MinorRadius()

double ON_Torus::MinorRadius ( ) const

◆ NormalAt()

ON_3dVector ON_Torus::NormalAt ( double  major_angle_radians,
double  minor_angle_radians 
) const

◆ PointAt()

ON_3dPoint ON_Torus::PointAt ( double  major_angle_radians,
double  minor_angle_radians 
) const

◆ RevSurfaceForm()

ON_RevSurface* ON_Torus::RevSurfaceForm ( ON_RevSurface srf = nullptr) const

Description: Creates a surface of revolution definition of the torus. Parameters: srf - [in] if not nullptr, then this srf is used. Result: A surface of revolution or nullptr if the torus is not valid.

◆ Rotate() [1/4]

bool ON_Torus::Rotate ( double  angle_radians,
const ON_3dVector axis_of_rotation 
)
Parameters
angle_radiansangle in radians
axis_of_rotationaxis of rotation

◆ Rotate() [2/4]

bool ON_Torus::Rotate ( double  angle_radians,
const ON_3dVector axis_of_rotation,
const ON_3dPoint center_of_rotation 
)
Parameters
angle_radiansangle in radians
axis_of_rotationaxis of rotation
center_of_rotationcenter of rotation

◆ Rotate() [3/4]

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

rotate torus about its origin

Parameters
sin_anglesin(angle)
cos_anglecos(angle)
axis_of_rotationaxis of rotation

◆ Rotate() [4/4]

bool ON_Torus::Rotate ( double  sin_angle,
double  cos_angle,
const ON_3dVector axis_of_rotation,
const ON_3dPoint center_of_rotation 
)

rotate torus about a point and axis

Parameters
sin_anglesin(angle)
cos_anglecos(angle)
axis_of_rotationaxis of rotation
center_of_rotationcenter of rotation

◆ Transform()

bool ON_Torus::Transform ( const ON_Xform )

◆ Translate()

bool ON_Torus::Translate ( const ON_3dVector )

Member Data Documentation

◆ major_radius

double ON_Torus::major_radius

minor_radius

◆ minor_radius

double ON_Torus::minor_radius

0

◆ plane

ON_Plane ON_Torus::plane

for expert users

major circle plane