geomc 1.0
A c++ linear algebra template library
Loading...
Searching...
No Matches
Cylinder< T, N > Class Template Reference

An N-dimensional cylinder, given by its radius and endpoints. More...

#include <geomc/shape/Cylinder.h>

Inheritance diagram for Cylinder< T, N >:
Dimensional< T, N >

Public Types

using elem_t
 The coordinate type of this object.
using point_t
 The type of a point in this object's space.

Public Member Functions

 Cylinder ()
 Construct a cylinder of radius and length 1, with axis along X+.
 Cylinder (const Vec< T, N > &p0, const Vec< T, N > &p1, T radius)
 Construct a cylinder with arbitrary radius and endpoints.
 Cylinder (T r)
 Construct a cylinder of radius r and length 1, with axis along X+.
Vec< T, Naxis () const
Rect< T, Nbounds () const
Vec< T, Nclip (Vec< T, N > p) const
bool contains (Vec< T, N > p) const
 Shape-point intersection test.
Vec< T, Nconvex_support (Vec< T, N > d) const
Rect< T, 1 > intersect (const Ray< T, N > &ray) const
 Ray/shape intersection test.
template<ConvexObject Shape>
bool intersects (const Shape &other) const
measure_boundary () const
 Measure the boundary (surface area) of the cylinder.
measure_interior () const
 Measure the interior (volume) of the cylinder.
Vec< T, Nnormal (Vec< T, N > p) const
bool operator== (const Cylinder< T, N > &other) const
Vec< T, Nproject (Vec< T, N > p) const
sdf (Vec< T, N > p) const
 Signed distance function.

Static Public Member Functions

static constexpr bool admits_cusps ()

Public Attributes

Vec< T, Np0
 Axis endpoint.
Vec< T, Np1
 Axis endpoint.
radius
 Cylinder radius.

Static Public Attributes

static constexpr index_t N
 The dimension of this object.

Detailed Description

template<typename T, index_t N>
class geom::Cylinder< T, N >

An N-dimensional cylinder, given by its radius and endpoints.

Represents an extrusion of an N-2 sphere. In other words, an extrusion of a disk in 3D; an extrusion of a sphere in 4D; and an extrusion of a line segment in 2D.

If p0 == p1, the behavior is undefined.

Member Typedef Documentation

◆ point_t

using point_t
inherited

The type of a point in this object's space.

An N-vector of T if N > 1, otherwise a T.

Constructor & Destructor Documentation

◆ Cylinder()

template<typename T, index_t N>
Cylinder ( const Vec< T, N > & p0,
const Vec< T, N > & p1,
T radius )
inline

Construct a cylinder with arbitrary radius and endpoints.

Parameters
p0An endpoint of the cylinder axis.
p1An endpoint of the cylinder axis.
radiusRadius of cylinder.

Member Function Documentation

◆ bounds()

template<typename T, index_t N>
Rect< T, N > bounds ( ) const
inline
Returns
An axis-aligned bounding box completely containing this cylinder.

The documentation for this class was generated from the following file: