Rhino C++ API  8.11
Public Member Functions | Public Attributes | List of all members
ON_Cone Class Reference

#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
 
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)
 
int GetNurbForm (ON_NurbsSurface &) const
 
bool IsValid () const
 
ON_Line LineAt (double radial_parameter) const
 
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
 
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 cone 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 cone about a point and axis More...
 
bool Transform (const ON_Xform &)
 
bool Translate (const ON_3dVector &delta)
 

Public Attributes

double height
 not zero More...
 
ON_Plane plane
 apex = plane.origin, axis = plane.zaxis More...
 
double radius
 not zero More...
 

Detailed Description

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 ( )

Creates a cone with world XY plane as the base plane, center = (0,0,0), radius = 0.0, height = 0.0.

◆ 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. Remarks: 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. Remarks: The base point is plane.origin + height*plane.zaxis.

◆ CircleAt()

ON_Circle ON_Cone::CircleAt ( double  height_parameter) const

Description: 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 
)

Description: 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

Returns true if plane is valid, height is not zero, and radius is not zero.

◆ LineAt()

ON_Line ON_Cone::LineAt ( double  radial_parameter) const

Description: 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 Remarks: 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

evaluate parameters and return point 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

Description: 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  angle_in_radians,
const ON_3dVector axis_of_rotation 
)

◆ Rotate() [2/4]

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

◆ Rotate() [3/4]

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

rotate cone about its origin

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

◆ 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

not zero

◆ plane

ON_Plane ON_Cone::plane

apex = plane.origin, axis = plane.zaxis

◆ radius

double ON_Cone::radius

not zero