Lightweight right circular cone. Use ON_ConeSurface if you need ON_Cone geometry as a virtual ON_Surface. More...

#include <opennurbs_cone.h>

Public Member Functions

 ON_Cone ()
 
 ON_Cone (const ON_Plane &plane, double height, double radius)
 See ON_Cone::Create. More...
 
 ~ON_Cone ()
 
double AngleInDegrees () const
 
double AngleInRadians () const
 
const ON_3dPointApexPoint () const
 
const ON_3dVectorAxis () const
 
ON_3dPoint BasePoint () const
 
ON_Circle CircleAt (double height_parameter) const
 Get iso curve circle at a specified height. More...
 
bool ClosestPointTo (ON_3dPoint point, double *radial_parameter, double *height_parameter) const
 returns parameters of point on cone that is closest to given point More...
 
ON_3dPoint ClosestPointTo (ON_3dPoint) const
 returns point on cone that is closest to given point More...
 
bool Create (const ON_Plane &plane, double height, double radius)
 Creates a right circular cone from a plane, height, and radius. plane - [in] The apex of cone is at plane.origin and the axis of the cone is plane.zaxis. height - [in] The center of the base is height*plane.zaxis. radius - [in] tan(cone angle) = radius/height More...
 
int GetNurbForm (ON_NurbsSurface &) const
 
bool IsValid () const
 
ON_Line LineAt (double radial_parameter) const
 Get iso curve line segment at a specified angle. More...
 
ON_3dVector NormalAt (double radial_parameter, double height_parameter) const
 
ON_3dPoint PointAt (double radial_parameter, double height_parameter) const
 
ON_RevSurfaceRevSurfaceForm (ON_RevSurface *srf=nullptr) const
 Creates a surface of revolution definition of the cylinder. More...
 
bool Rotate (double sin_angle, double cos_angle, const ON_3dVector &axis_of_rotation)
 rotate cone about its origin More...
 
bool Rotate (double angle_in_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 cone about a point and axis More...
 
bool Rotate (double angle_in_radians, const ON_3dVector &axis_of_rotation, const ON_3dPoint &center_of_rotation)
 
bool Transform (const ON_Xform &)
 
bool Translate (const ON_3dVector &delta)
 

Public Attributes

double height
 
ON_Plane plane
 
double radius
 

Detailed Description

Lightweight right circular cone. Use ON_ConeSurface if you need ON_Cone geometry as a virtual ON_Surface.

Constructor & Destructor Documentation

◆ ON_Cone() [1/2]

ON_Cone::ON_Cone ( )

◆ ON_Cone() [2/2]

ON_Cone::ON_Cone ( const ON_Plane plane,
double  height,
double  radius 
)

◆ ~ON_Cone()

ON_Cone::~ON_Cone ( )

Member Function Documentation

◆ AngleInDegrees()

double ON_Cone::AngleInDegrees ( ) const
Returns
The angle Iin degrees) between the axis and the side. The angle and the height have the same sign.

◆ AngleInRadians()

double ON_Cone::AngleInRadians ( ) const
Returns
The angle (in radians) between the axis and the side of the cone. The angle and the height have the same sign.

◆ ApexPoint()

const ON_3dPoint& ON_Cone::ApexPoint ( ) const
Returns
Point at the tip of the cone.

The apex point is plane.origin.

◆ Axis()

const ON_3dVector& ON_Cone::Axis ( ) const
Returns
Unit vector axis of cone.

◆ BasePoint()

ON_3dPoint ON_Cone::BasePoint ( ) const
Returns
Center of base circle.

The base point is plane.origin + height*plane.zaxis.

◆ CircleAt()

ON_Circle ON_Cone::CircleAt ( double  height_parameter) const

Get iso curve circle at a specified height.

Parameters
height_parameter[in] 0 = apex, height = base

◆ ClosestPointTo() [1/2]

bool ON_Cone::ClosestPointTo ( ON_3dPoint  point,
double *  radial_parameter,
double *  height_parameter 
) const

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

◆ ClosestPointTo() [2/2]

ON_3dPoint ON_Cone::ClosestPointTo ( ON_3dPoint  ) const

returns point on cone that is closest to given point

◆ Create()

bool ON_Cone::Create ( const ON_Plane plane,
double  height,
double  radius 
)

Creates a right circular cone from a plane, height, and radius. plane - [in] The apex of cone is at plane.origin and the axis of the cone is plane.zaxis. height - [in] The center of the base is height*plane.zaxis. radius - [in] tan(cone angle) = radius/height

◆ GetNurbForm()

int ON_Cone::GetNurbForm ( ON_NurbsSurface ) const
Returns
0 = failure 2 = success

◆ IsValid()

bool ON_Cone::IsValid ( ) const

◆ LineAt()

ON_Line ON_Cone::LineAt ( double  radial_parameter) const

Get iso curve line segment at a specified angle.

Parameters
radial_parameter[in] (in radians) 0.0 to 2.0*ON_PI

◆ NormalAt()

ON_3dVector ON_Cone::NormalAt ( double  radial_parameter,
double  height_parameter 
) const
Parameters
radial_parameter[in] (in radians) 0.0 to 2.0*ON_PI
height_parameter[in] 0 = apex, height = base

If radius>0 and height>0, then the normal points "out" when height_parameter >= 0.

◆ PointAt()

ON_3dPoint ON_Cone::PointAt ( double  radial_parameter,
double  height_parameter 
) const
Parameters
radial_parameter[in] 0.0 to 2.0*ON_PI
height_parameter[in] 0 = apex, height = base

◆ RevSurfaceForm()

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

Creates a surface of revolution definition of the cylinder.

Parameters
srf[in] if not nullptr, then this srf is used. Result: A surface of revolution or nullptr if the cylinder is not valid or is infinite.

◆ Rotate() [1/4]

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

rotate cone about its origin

◆ Rotate() [2/4]

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

◆ Rotate() [3/4]

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

rotate cone about a point and axis

◆ Rotate() [4/4]

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

◆ Transform()

bool ON_Cone::Transform ( const ON_Xform )

◆ Translate()

bool ON_Cone::Translate ( const ON_3dVector delta)

Member Data Documentation

◆ height

double ON_Cone::height

◆ plane

ON_Plane ON_Cone::plane

◆ radius

double ON_Cone::radius