|
SFCGAL 2.3.0
|
Represents a torus in 3D space. More...
#include <Torus.h>
Public Member Functions | |
| Torus (const Kernel::FT &main_radius=10.0, const Kernel::FT &tube_radius=2.0, unsigned int main_num_radial=32, unsigned int tube_num_radial=16) | |
| Constructs a Torus object centered on the origin and lying in the XY plane. | |
| Torus (const Torus &other)=default | |
| Copy constructor. | |
| auto | primitiveType () const -> std::string override |
| returns the primitive type | |
| auto | primitiveTypeId () const -> PrimitiveType override |
| ~Torus () override=default | |
| Destructor. | |
| void | setMainRadius (const Kernel::FT &main_radius) |
| Sets the main radius of the torus. | |
| void | setTubeRadius (const Kernel::FT &tube_radius) |
| Sets the tube radius of the torus. | |
| void | setMainNumRadial (const unsigned int &main_num_radial) |
| Sets the main number of radial divisions. | |
| void | setTubeNumRadial (const unsigned int &tube_num_radial) |
| Sets the number of radial divisions for the tube. | |
| auto | mainRadius () const -> const Kernel::FT & |
| Gets the main radius of the torus. | |
| auto | tubeRadius () const -> const Kernel::FT & |
| Gets the tube radius of the torus. | |
| auto | mainNumRadial () const -> unsigned int |
| Gets the number of main radial divisions. | |
| auto | tubeNumRadial () const -> unsigned int |
| Gets the number of radial divisions for the tube. | |
| auto | generatePolyhedralSurface () const -> PolyhedralSurface override |
| Generates a surface mesh representation of the torus. | |
| 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. | |
Protected Member Functions | |
| void | validateParameters (std::unordered_map< std::string, PrimitiveParameter > const &tempParameters) const override |
| Verifies that all parameters are valid. | |
Represents a torus in 3D space.
This class provides methods to generate a polyhedral surface representation of a torus. It uses SFCGAL's Kernel for exact computations.
| SFCGAL::Torus::Torus | ( | const Kernel::FT & | main_radius = 10.0, |
| const Kernel::FT & | tube_radius = 2.0, | ||
| unsigned int | main_num_radial = 32, | ||
| unsigned int | tube_num_radial = 16 ) |
Constructs a Torus object centered on the origin and lying in the XY plane.
| main_radius | the main radius of the torus |
| tube_radius | the tube radius of the torus |
| main_num_radial | The number of main radial divisions |
| tube_num_radial | The number of tube 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. |
|
nodiscardoverride |
Returns the sphere 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 torus.
|
nodiscard |
Gets the number of main radial divisions.
|
nodiscard |
Gets the main radius of the torus.
|
nodiscardoverride |
returns the primitive type
|
nodiscardoverride |
| void SFCGAL::Torus::setMainNumRadial | ( | const unsigned int & | main_num_radial | ) |
Sets the main number of radial divisions.
| main_num_radial | The new number of main radial |
| void SFCGAL::Torus::setMainRadius | ( | const Kernel::FT & | main_radius | ) |
Sets the main radius of the torus.
| main_radius | The new main radius |
| void SFCGAL::Torus::setTubeNumRadial | ( | const unsigned int & | tube_num_radial | ) |
Sets the number of radial divisions for the tube.
| tube_num_radial | The new number of tube radial divisions |
| void SFCGAL::Torus::setTubeRadius | ( | const Kernel::FT & | tube_radius | ) |
Sets the tube radius of the torus.
| tube_radius | The new tube radius |
|
nodiscard |
Gets the number of radial divisions for the tube.
|
nodiscard |
Gets the tube radius of the torus.
|
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. |