|
SFCGAL 2.3.0
|
Represents a cone in 3D space. More...
#include <Cone.h>
Public Member Functions | |
| 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. | |
| Cone (const Cone &other)=default | |
| Copy constructor. | |
| auto | primitiveType () const -> std::string override |
| returns the primitive type | |
| auto | primitiveTypeId () const -> PrimitiveType override |
| ~Cone () override=default | |
| Destructor. | |
| void | setHeight (const Kernel::FT &height) |
| Sets the cone height. | |
| void | setBottomRadius (const Kernel::FT &bottom_radius) |
| Sets the bottom face radius of the cone. | |
| void | setTopRadius (const Kernel::FT &top_radius) |
| Sets the top face radius of the cone. | |
| void | setNumRadial (const unsigned int &num_radial) |
| Sets the number of radial divisions. | |
| auto | height () const -> const Kernel::FT & |
| Gets the cone height. | |
| auto | bottomRadius () const -> const Kernel::FT & |
| Gets the bottom face radius of the cone. | |
| auto | topRadius () const -> const Kernel::FT & |
| Gets the top face radius of the cone. | |
| auto | numRadial () const -> unsigned int |
| Gets the number of radial divisions. | |
| auto | generatePolyhedralSurface () const -> PolyhedralSurface override |
| Generates a surface mesh representation of the cone. | |
| auto | baseVolume (bool withDiscretization=false) const -> double override |
| Returns the sphere volume without scaling. | |
| auto | area3D (bool withDiscretization=false) const -> double override |
| Returns the primitive area. | |
| auto | baseArea3D (bool withDiscretization=false) const -> double |
| Computes cone base area without scaling effect. | |
Protected Member Functions | |
| void | validateParameters (std::unordered_map< std::string, PrimitiveParameter > const &tempParameters) const override |
| Verifies that all parameters are valid. | |
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.
| 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 |
|
default |
Copy constructor.
| other | copy from |
|
overridedefault |
Destructor.
|
nodiscardoverride |
Returns the primitive area.
| withDiscretization | Computes volume with discretization (true) or as perfect primitive (false). Defaults to false. |
| auto SFCGAL::Cone::baseArea3D | ( | bool | withDiscretization = false | ) | const -> double |
Computes cone base area without scaling effect.
| withDiscretization | Computes area with discretization (true) or as perfect primitive (false). Defaults to false. |
|
nodiscardoverride |
Returns the sphere volume without scaling.
| withDiscretization | Computes volume with discretization (true) or as perfect primitive (false). Defaults to false. |
|
nodiscard |
Gets the bottom face radius of the cone.
|
override |
Generates a surface mesh representation of the cone.
|
nodiscard |
Gets the cone height.
|
nodiscard |
Gets the number of radial divisions.
|
nodiscardoverride |
returns the primitive type
|
nodiscardoverride |
| void SFCGAL::Cone::setBottomRadius | ( | const Kernel::FT & | bottom_radius | ) |
Sets the bottom face radius of the cone.
| bottom_radius | The new bottom face radius |
| void SFCGAL::Cone::setHeight | ( | const Kernel::FT & | height | ) |
Sets the cone height.
| height | The new cone height |
| void SFCGAL::Cone::setNumRadial | ( | const unsigned int & | num_radial | ) |
Sets the number of radial divisions.
| 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.
| top_radius | The new top face radius |
|
nodiscard |
Gets the top face radius of the cone.
|
overrideprotected |
Verifies that all parameters are valid.
For instance, it raises an error if a radius is negative.
| tempParameters | a temp map of parameter with new values |
| SFCGAL::Exception | if one of the parameters if not valid provided variant type is not compatible with the parameter. |