Represents a torus in 3D space.
More...
#include <Torus.h>
Inherits SFCGAL::PrimitiveImpl< Derived, Base >.
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.
- Parameters
-
| 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 |
| SFCGAL::Torus::Torus |
( |
const Torus & |
other | ) |
|
|
default |
Copy constructor.
- Parameters
-
| SFCGAL::Torus::~Torus |
( |
| ) |
|
|
overridedefault |
| auto SFCGAL::Torus::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
- Note
- only perfect primitive version is available
| auto SFCGAL::Torus::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
- Note
- only perfect primitive version is available
Generates a surface mesh representation of the torus.
- Returns
- A CGAL::Surface_mesh object representing the torus
| auto SFCGAL::Torus::mainNumRadial |
( |
| ) |
const -> unsigned int |
Gets the number of main radial divisions.
- Returns
- The number of main radial divisions
| auto SFCGAL::Torus::mainRadius |
( |
| ) |
const -> const Kernel::FT & |
Gets the main radius of the torus.
- Returns
- The main radius
| auto SFCGAL::Torus::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::Torus::setMainNumRadial |
( |
const unsigned int & |
main_num_radial | ) |
|
Sets the main number of radial divisions.
- Parameters
-
| 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.
- Parameters
-
| 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.
- Parameters
-
| 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.
- Parameters
-
| tube_radius | The new tube radius |
| auto SFCGAL::Torus::tubeNumRadial |
( |
| ) |
const -> unsigned int |
Gets the number of radial divisions for the tube.
- Returns
- The number of tube radial divisions
| auto SFCGAL::Torus::tubeRadius |
( |
| ) |
const -> const Kernel::FT & |
Gets the tube radius of the torus.
- Returns
- The tube radius
| void SFCGAL::Torus::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. |