SFCGAL  2.2.0
Public Member Functions | List of all members
SFCGAL::Cylinder Class Reference

Represents a cylinder in 3D space. More...

#include <Cylinder.h>

Public Member Functions

 Cylinder (const Point_3 &base_center=Point_3(0, 0, 0), const Vector_3 &axis=Vector_3(0, 0, 1), const Kernel::FT &radius=1.0, const Kernel::FT &height=1.0, int num_radial=32)
 Constructs a Cylinder object. More...
 
 Cylinder (const Cylinder &other)=default
 Copy constructor. More...
 
Cylinderoperator= (Cylinder other)
 Assignment operator. More...
 
 ~Cylinder ()=default
 Destructor. More...
 
void setBaseCenter (const Point_3 &base_center)
 Sets the base center of the cylinder. More...
 
void setAxis (const Vector_3 &axis)
 Sets the axis of the cylinder. 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 (int num)
 Sets the number of radial divisions. More...
 
const Point_3baseCenter () const
 Gets the base center of the cylinder. More...
 
const Vector_3axis () const
 Gets the axis of the cylinder. More...
 
const Kernel::FT & radius () const
 Gets the radius of the cylinder. More...
 
const Kernel::FT & height () const
 Gets the height of the cylinder. More...
 
int numRadial () const
 Gets the number of radial divisions. More...
 
Polyhedron_3 generatePolyhedron ()
 Generates a polyhedron representation of the cylinder. More...
 
Surface_mesh_3 generateSurfaceMesh ()
 Generates a surface mesh representation of the cylinder. More...
 
double volume () const
 
double area () const
 

Detailed Description

Represents a cylinder in 3D space.

This class provides methods to generate a polyhedron and a surface mesh representation of a cylinder. It uses SFCGAL's Kernel for exact computations.

Constructor & Destructor Documentation

SFCGAL::Cylinder::Cylinder ( const Point_3 base_center = Point_3(0, 0, 0),
const Vector_3 axis = Vector_3(0, 0, 1),
const Kernel::FT &  radius = 1.0,
const Kernel::FT &  height = 1.0,
int  num_radial = 32 
)

Constructs a Cylinder object.

Parameters
base_centerThe center point of the base of the cylinder
axisThe axis of the cylinder
radiusThe radius of the cylinder
heightThe height of the cylinder
num_radialThe number of radial divisions
SFCGAL::Cylinder::Cylinder ( const Cylinder other)
default

Copy constructor.

SFCGAL::Cylinder::~Cylinder ( )
default

Destructor.

Member Function Documentation

double SFCGAL::Cylinder::area ( ) const
inline
const Vector_3& SFCGAL::Cylinder::axis ( ) const
inline

Gets the axis of the cylinder.

Returns
The axis vector
const Point_3& SFCGAL::Cylinder::baseCenter ( ) const
inline

Gets the base center of the cylinder.

Returns
The base center point
auto SFCGAL::Cylinder::generatePolyhedron ( )

Generates a polyhedron representation of the cylinder.

Returns
A CGAL::Polyhedron_3 object representing the cylinder
auto SFCGAL::Cylinder::generateSurfaceMesh ( )

Generates a surface mesh representation of the cylinder.

Returns
A CGAL::Surface_mesh object representing the cylinder
const Kernel::FT& SFCGAL::Cylinder::height ( ) const
inline

Gets the height of the cylinder.

Returns
The height
int SFCGAL::Cylinder::numRadial ( ) const
inline

Gets the number of radial divisions.

Returns
The number of radial divisions
auto SFCGAL::Cylinder::operator= ( Cylinder  other)

Assignment operator.

const Kernel::FT& SFCGAL::Cylinder::radius ( ) const
inline

Gets the radius of the cylinder.

Returns
The radius
void SFCGAL::Cylinder::setAxis ( const Vector_3 axis)

Sets the axis of the cylinder.

Parameters
axisThe new axis vector
void SFCGAL::Cylinder::setBaseCenter ( const Point_3 base_center)

Sets the base center of the cylinder.

Parameters
base_centerThe new base center point
void SFCGAL::Cylinder::setHeight ( const Kernel::FT &  height)

Sets the height of the cylinder.

Parameters
heightThe new height
void SFCGAL::Cylinder::setNumRadial ( int  num)

Sets the number of radial divisions.

Parameters
numThe new number of radial divisions
void SFCGAL::Cylinder::setRadius ( const Kernel::FT &  radius)

Sets the radius of the cylinder.

Parameters
radiusThe new radius
double SFCGAL::Cylinder::volume ( ) const
inline