SFCGAL 2.0.0
SFCGAL::Cylinder Class Reference

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

#include <Cylinder.h>

Public Types

using Point_3 = Kernel::Point_3
 
using Vector_3 = Kernel::Vector_3
 
using Polyhedron_3 = CGAL::Polyhedron_3<Kernel>
 
using Surface_mesh = CGAL::Surface_mesh<Point_3>
 

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.
 
 Cylinder (const Cylinder &other)=default
 Copy constructor.
 
Cylinderoperator= (Cylinder other)
 Assignment operator.
 
 ~Cylinder ()=default
 Destructor.
 
void setBaseCenter (const Point_3 &base_center)
 Sets the base center of the cylinder.
 
void setAxis (const Vector_3 &axis)
 Sets the axis of the cylinder.
 
void setRadius (const Kernel::FT &radius)
 Sets the radius of the cylinder.
 
void setHeight (const Kernel::FT &height)
 Sets the height of the cylinder.
 
void setNumRadial (int num)
 Sets the number of radial divisions.
 
const Point_3baseCenter () const
 Gets the base center of the cylinder.
 
const Vector_3axis () const
 Gets the axis of the cylinder.
 
const Kernel::FT & radius () const
 Gets the radius of the cylinder.
 
const Kernel::FT & height () const
 Gets the height of the cylinder.
 
int numRadial () const
 Gets the number of radial divisions.
 
Polyhedron_3 generatePolyhedron ()
 Generates a polyhedron representation of the cylinder.
 
Surface_mesh generateSurfaceMesh ()
 Generates a surface mesh representation of the cylinder.
 
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.

Member Typedef Documentation

◆ Point_3

using SFCGAL::Cylinder::Point_3 = Kernel::Point_3

◆ Polyhedron_3

using SFCGAL::Cylinder::Polyhedron_3 = CGAL::Polyhedron_3<Kernel>

◆ Surface_mesh

using SFCGAL::Cylinder::Surface_mesh = CGAL::Surface_mesh<Point_3>

◆ Vector_3

using SFCGAL::Cylinder::Vector_3 = Kernel::Vector_3

Constructor & Destructor Documentation

◆ Cylinder() [1/2]

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

◆ Cylinder() [2/2]

SFCGAL::Cylinder::Cylinder ( const Cylinder & other)
default

Copy constructor.

◆ ~Cylinder()

SFCGAL::Cylinder::~Cylinder ( )
default

Destructor.

Member Function Documentation

◆ area()

double SFCGAL::Cylinder::area ( ) const
inline

◆ axis()

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

Gets the axis of the cylinder.

Returns
The axis vector

◆ baseCenter()

const Point_3 & SFCGAL::Cylinder::baseCenter ( ) const
inline

Gets the base center of the cylinder.

Returns
The base center point

◆ generatePolyhedron()

auto SFCGAL::Cylinder::generatePolyhedron ( )

Generates a polyhedron representation of the cylinder.

Returns
A CGAL::Polyhedron_3 object representing the cylinder

◆ generateSurfaceMesh()

auto SFCGAL::Cylinder::generateSurfaceMesh ( )

Generates a surface mesh representation of the cylinder.

Returns
A CGAL::Surface_mesh object representing the cylinder

◆ height()

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

Gets the height of the cylinder.

Returns
The height

◆ numRadial()

int SFCGAL::Cylinder::numRadial ( ) const
inline

Gets the number of radial divisions.

Returns
The number of radial divisions

◆ operator=()

auto SFCGAL::Cylinder::operator= ( Cylinder other)

Assignment operator.

◆ radius()

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

Gets the radius of the cylinder.

Returns
The radius

◆ setAxis()

void SFCGAL::Cylinder::setAxis ( const Vector_3 & axis)

Sets the axis of the cylinder.

Parameters
axisThe new axis vector

◆ setBaseCenter()

void SFCGAL::Cylinder::setBaseCenter ( const Point_3 & base_center)

Sets the base center of the cylinder.

Parameters
base_centerThe new base center point

◆ setHeight()

void SFCGAL::Cylinder::setHeight ( const Kernel::FT & height)

Sets the height of the cylinder.

Parameters
heightThe new height

◆ setNumRadial()

void SFCGAL::Cylinder::setNumRadial ( int num)

Sets the number of radial divisions.

Parameters
numThe new number of radial divisions

◆ setRadius()

void SFCGAL::Cylinder::setRadius ( const Kernel::FT & radius)

Sets the radius of the cylinder.

Parameters
radiusThe new radius

◆ volume()

double SFCGAL::Cylinder::volume ( ) const
inline