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). More...

#include <opennurbs_torus.h>

Public Member Functions

 ON_Torus ()
 
 ON_Torus (const ON_Plane &major__plane, double major__radius, double minor__radius)
 
 ON_Torus (const ON_Circle &major__circle, double minor__radius)
 
 ~ON_Torus ()
 
ON_3dVector Axis () const
 
ON_3dPoint Center () const
 
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...
 
ON_3dPoint ClosestPointTo (ON_3dPoint test_point) const
 returns point on torus that is closest to test_point More...
 
bool Create (const ON_Plane &major__plane, double major__radius, double minor__radius)
 
bool Create (const ON_Circle &major__circle, double minor__radius)
 
int GetNurbForm (ON_NurbsSurface &) const
 parameterization of NURBS surface does not match torus's transcendental paramaterization More...
 
bool IsValid (ON_TextLog *text_log=nullptr) const
 
ON_Circle MajorCircleDegrees (double minor_angle_degrees) const
 Get the circle that is the isocurve on the torus at a specified minor angle. Parameteters: minor_angle_degrees - [in] More...
 
ON_Circle MajorCircleRadians (double minor_angle_radians) const
 Get the circle that is the isocurve on the torus at a specified minor angle. Parameteters: minor_angle_radians - [in] More...
 
double MajorRadius () const
 
ON_Circle MinorCircleDegrees (double major_angle_degrees) const
 Get the minor circle that is the isocurve on the torus at a specified major angle. Parameteters: major_angle_degrees - [in] More...
 
ON_Circle MinorCircleRadians (double major_angle_radians) const
 Get the minor circle that is the isocurve on the torus at a specified major angle. Parameteters: major_angle_radians - [in] More...
 
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
 Creates a surface of revolution definition of the torus. More...
 
bool Rotate (double sin_angle, double cos_angle, const ON_3dVector &axis_of_rotation)
 rotate torus about its origin More...
 
bool Rotate (double angle_radians, const ON_3dVector &axis_of_rotation)
 
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 Rotate (double angle_radians, const ON_3dVector &axis_of_rotation, const ON_3dPoint &center_of_rotation)
 
bool Transform (const ON_Xform &)
 
bool Translate (const ON_3dVector &)
 

Public Attributes

double major_radius
 
double minor_radius
 
ON_Plane plane
 for expert users More...
 

Detailed 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]

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.

◆ ClosestPointTo() [2/2]

ON_3dPoint ON_Torus::ClosestPointTo ( ON_3dPoint  test_point) const

returns point on torus that is closest to test_point

◆ Create() [1/2]

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

◆ Create() [2/2]

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

◆ GetNurbForm()

int ON_Torus::GetNurbForm ( ON_NurbsSurface ) const

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

◆ IsValid()

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

◆ MajorCircleDegrees()

ON_Circle ON_Torus::MajorCircleDegrees ( double  minor_angle_degrees) const

Get the circle that is the isocurve on the torus at a specified minor angle. Parameteters: 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

Get the circle that is the isocurve on the torus at a specified minor angle. Parameteters: 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

Get the minor circle that is the isocurve on the torus at a specified major angle. Parameteters: 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

Get the minor circle that is the isocurve on the torus at a specified major angle. Parameteters: 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

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  sin_angle,
double  cos_angle,
const ON_3dVector axis_of_rotation 
)

rotate torus about its origin

◆ Rotate() [2/4]

bool ON_Torus::Rotate ( double  angle_radians,
const ON_3dVector axis_of_rotation 
)

◆ Rotate() [3/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

◆ Rotate() [4/4]

bool ON_Torus::Rotate ( double  angle_radians,
const ON_3dVector axis_of_rotation,
const ON_3dPoint center_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

double ON_Torus::minor_radius

◆ plane

ON_Plane ON_Torus::plane

for expert users