|
SFCGAL
2.3.0
|
Represents a cylinder in 3D space. More...
#include <Cylinder.h>
Inherits SFCGAL::PrimitiveImpl< Derived, Base >.
Public Member Functions | |
| Cylinder (const Kernel::FT &radius=1.0, const Kernel::FT &height=1.0, unsigned int num_radial=32) | |
| Constructs a Cylinder object. More... | |
| Cylinder (const Cylinder &other)=default | |
| Copy constructor. More... | |
| auto | primitiveType () const -> std::string override |
| returns the primitive type More... | |
| auto | primitiveTypeId () const -> PrimitiveType override |
| returns a code corresponding to the type More... | |
| ~Cylinder () override=default | |
| Destructor. More... | |
| void | setRadius (const Kernel::FT &radius) |
| Sets the radius of the cylinder. More... | |
| void | setHeight (const Kernel::FT &height) |
| Sets the height of the cylinder. More... | |
| void | setNumRadial (unsigned int num) |
| Sets the number of radial divisions. More... | |
| auto | radius () const -> const Kernel::FT & |
| Gets the radius of the cylinder. More... | |
| auto | height () const -> const Kernel::FT & |
| Gets the height of the cylinder. More... | |
| auto | numRadial () const -> unsigned int |
| Gets the number of radial divisions. More... | |
| auto | generatePolyhedron () const -> Polyhedron_3 |
| Generates a polyhedron representation of the cylinder. More... | |
| auto | generateSurfaceMesh () const -> Surface_mesh_3 |
| Generates a surface mesh representation of the cylinder. More... | |
| auto | generatePolyhedralSurface () const -> PolyhedralSurface override |
| Generates a surface mesh representation of the cylinder. More... | |
| auto | baseVolume (bool withDiscretization=false) const -> double override |
| Returns the primitive volume without scaling. More... | |
| auto | area3D (bool withDiscretization=false) const -> double override |
| Returns the primitive area. More... | |
Protected Member Functions | |
| void | validateParameters (std::unordered_map< std::string, PrimitiveParameter > const &tempParameters) const override |
| Verifies that all parameters are valid. More... | |
| void | invalidateCache () override |
| Invalidates the cached polyhedron and surface mesh. More... | |
Represents a cylinder in 3D space.
The cylinder is aligned along the Z axis with its base centered at the origin and its top cap located at z = height.
This class provides methods to generate a polyhedron and a surface mesh representation of a cylinder. It uses SFCGAL's Kernel for exact computations.
| SFCGAL::Cylinder::Cylinder | ( | const Kernel::FT & | radius = 1.0, |
| const Kernel::FT & | height = 1.0, |
||
| unsigned int | num_radial = 32 |
||
| ) |
Constructs a Cylinder object.
| radius | The radius of the cylinder |
| height | The height of the cylinder |
| num_radial | The number of radial divisions |
|
default |
Copy constructor.
| other | copy from |
|
overridedefault |
Destructor.
|
override |
Returns the primitive area.
| withDiscretization | Computes area with discretization (true) or as perfect primitive (false). Defaults to false. |
|
override |
Returns the primitive volume without scaling.
| withDiscretization | Computes volume with discretization (true) or as perfect primitive (false). Defaults to false. |
|
override |
Generates a surface mesh representation of the cylinder.
| auto SFCGAL::Cylinder::generatePolyhedron | ( | ) | const -> Polyhedron_3 |
Generates a polyhedron representation of the cylinder.
| auto SFCGAL::Cylinder::generateSurfaceMesh | ( | ) | const -> Surface_mesh_3 |
Generates a surface mesh representation of the cylinder.
|
inline |
Gets the height of the cylinder.
|
overrideprotected |
Invalidates the cached polyhedron and surface mesh.
|
inline |
Gets the number of radial divisions.
|
override |
returns the primitive type
|
override |
returns a code corresponding to the type
|
inline |
Gets the radius of the cylinder.
| void SFCGAL::Cylinder::setHeight | ( | const Kernel::FT & | height | ) |
Sets the height of the cylinder.
| height | The new height |
| void SFCGAL::Cylinder::setNumRadial | ( | unsigned int | num | ) |
Sets the number of radial divisions.
| num | The new number of radial divisions |
| void SFCGAL::Cylinder::setRadius | ( | const Kernel::FT & | radius | ) |
Sets the radius of the cylinder.
| radius | The new radius |
|
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. |
1.8.10