Represents a cone in 3D space.
More...
#include <Cone.h>
Inherits SFCGAL::PrimitiveImpl< Derived, Base >.
|
| | Cone (const Kernel::FT &bottom_radius=1.0, const Kernel::FT &top_radius=0.0, const Kernel::FT &height=1.0, unsigned int num_radial=32) |
| | Constructs a Cone object with its base centered on the origin and in the XY plane A cone frustum is a cone with a top_radius greater than zero. More...
|
| |
| | Cone (const Cone &other)=default |
| | Copy constructor. More...
|
| |
| auto | primitiveType () const -> std::string override |
| | returns the primitive type More...
|
| |
| auto | primitiveTypeId () const -> PrimitiveType override |
| |
| | ~Cone () override=default |
| | Destructor. More...
|
| |
| void | setHeight (const Kernel::FT &height) |
| | Sets the cone height. More...
|
| |
| void | setBottomRadius (const Kernel::FT &bottom_radius) |
| | Sets the bottom face radius of the cone. More...
|
| |
| void | setTopRadius (const Kernel::FT &top_radius) |
| | Sets the top face radius of the cone. More...
|
| |
| void | setNumRadial (const unsigned int &num_radial) |
| | Sets the number of radial divisions. More...
|
| |
| auto | height () const -> const Kernel::FT & |
| | Gets the cone height. More...
|
| |
| auto | bottomRadius () const -> const Kernel::FT & |
| | Gets the bottom face radius of the cone. More...
|
| |
| auto | topRadius () const -> const Kernel::FT & |
| | Gets the top face radius of the cone. More...
|
| |
| auto | numRadial () const -> unsigned int |
| | Gets the number of radial divisions. More...
|
| |
| auto | generatePolyhedralSurface () const -> PolyhedralSurface override |
| | Generates a surface mesh representation of the cone. More...
|
| |
| auto | baseVolume (bool withDiscretization=false) const -> double override |
| | Returns the sphere volume without scaling. More...
|
| |
| auto | area3D (bool withDiscretization=false) const -> double override |
| | Returns the primitive area. More...
|
| |
| auto | baseArea3D (bool withDiscretization=false) const -> double |
| | Computes cone base area without scaling effect. More...
|
| |
Represents a cone in 3D space.
This class provides methods to generate a polyhedral surface representation of a cone. It uses SFCGAL's Kernel for exact computations.
| SFCGAL::Cone::Cone |
( |
const Kernel::FT & |
bottom_radius = 1.0, |
|
|
const Kernel::FT & |
top_radius = 0.0, |
|
|
const Kernel::FT & |
height = 1.0, |
|
|
unsigned int |
num_radial = 32 |
|
) |
| |
Constructs a Cone object with its base centered on the origin and in the XY plane A cone frustum is a cone with a top_radius greater than zero.
- Parameters
-
| bottom_radius | the bottom face radius of the cone |
| top_radius | the top face radius of the cone |
| height | the height of the cone |
| num_radial | The number of radial divisions |
| SFCGAL::Cone::Cone |
( |
const Cone & |
other | ) |
|
|
default |
Copy constructor.
- Parameters
-
| auto SFCGAL::Cone::area3D |
( |
bool |
withDiscretization = false | ) |
const -> double |
|
override |
Returns the primitive area.
- Parameters
-
| withDiscretization | Computes volume with discretization (true) or as perfect primitive (false). Defaults to false. |
- Returns
- The primitive volume
| auto SFCGAL::Cone::baseArea3D |
( |
bool |
withDiscretization = false | ) |
const -> double |
Computes cone base area without scaling effect.
- Parameters
-
| withDiscretization | Computes area with discretization (true) or as perfect primitive (false). Defaults to false. |
- Returns
- base area
| auto SFCGAL::Cone::baseVolume |
( |
bool |
withDiscretization = false | ) |
const -> double |
|
override |
Returns the sphere volume without scaling.
- Parameters
-
| withDiscretization | Computes volume with discretization (true) or as perfect primitive (false). Defaults to false. |
- Returns
- The sphere volume
| auto SFCGAL::Cone::bottomRadius |
( |
| ) |
const -> const Kernel::FT & |
Gets the bottom face radius of the cone.
- Returns
- The bottom face radius
Generates a surface mesh representation of the cone.
- Returns
- A CGAL::Surface_mesh object representing the cone
| auto SFCGAL::Cone::height |
( |
| ) |
const -> const Kernel::FT & |
Gets the cone height.
- Returns
- The cone height
| auto SFCGAL::Cone::numRadial |
( |
| ) |
const -> unsigned int |
Gets the number of radial divisions.
- Returns
- The number of radial divisions
| auto SFCGAL::Cone::primitiveType |
( |
| ) |
const -> std::string |
|
override |
returns the primitive type
- Warning
- use CamelCase (Cylinder, not CYLINDER)
- Returns
- the primitive type as string
- Returns
- a code corresponding to the type
| void SFCGAL::Cone::setBottomRadius |
( |
const Kernel::FT & |
bottom_radius | ) |
|
Sets the bottom face radius of the cone.
- Parameters
-
| bottom_radius | The new bottom face radius |
| void SFCGAL::Cone::setHeight |
( |
const Kernel::FT & |
height | ) |
|
Sets the cone height.
- Parameters
-
| height | The new cone height |
| void SFCGAL::Cone::setNumRadial |
( |
const unsigned int & |
num_radial | ) |
|
Sets the number of radial divisions.
- Parameters
-
| num_radial | The new number of radial divisions |
| void SFCGAL::Cone::setTopRadius |
( |
const Kernel::FT & |
top_radius | ) |
|
Sets the top face radius of the cone.
- Parameters
-
| top_radius | The new top face radius |
| auto SFCGAL::Cone::topRadius |
( |
| ) |
const -> const Kernel::FT & |
Gets the top face radius of the cone.
- Returns
- The top face radius
| void SFCGAL::Cone::validateParameters |
( |
std::unordered_map< std::string, PrimitiveParameter > const & |
tempParameters | ) |
const |
|
overrideprotected |
Verifies that all parameters are valid.
For instance, it raises an error if a radius is negative.
- Parameters
-
| tempParameters | a temp map of parameter with new values |
- Exceptions
-
| SFCGAL::Exception | if one of the parameters if not valid provided variant type is not compatible with the parameter. |