geomc 1.0
A c++ linear algebra template library
|
An N-dimensional cylinder, given by its radius and endpoints. More...
#include <geomc/shape/Cylinder.h>
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+. | |
Rect< T, N > | bounds () const |
Vec< T, N > | clip (Vec< T, N > p) const |
Nearest point on the interior of the shape. | |
bool | contains (Vec< T, N > p) const |
Shape-point intersection test. | |
point_t | convex_support (point_t d) const |
Geometric convex support function. | |
Vec< T, N > | convex_support (Vec< T, N > d) const |
Rect< T, 1 > | intersect (const Ray< T, N > &ray) const |
Ray/shape intersection test. | |
bool | intersects (const Convex< T, N, Shape > &other) const |
Convex shape overlap test. | |
T | measure_boundary () const |
Measure the boundary (surface area) of the cylinder. | |
T | measure_interior () const |
Measure the interior (volume) of the cylinder. | |
Vec< T, N > | normal (Vec< T, N > p) const |
bool | operator== (const Cylinder< T, N > &other) const |
Vec< T, N > | project (Vec< T, N > p) const |
T | sdf (Vec< T, N > p) const |
Signed distance function. | |
Static Public Member Functions | |
static constexpr bool | admits_cusps () |
Public Attributes | |
Vec< T, N > | p0 |
Axis endpoint. | |
Vec< T, N > | p1 |
Axis endpoint. | |
T | radius |
Cylinder radius. | |
Static Public Attributes | |
static constexpr index_t | N |
The dimension of this object. | |
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.
|
inherited |
The type of a point in this object's space.
An N-vector of T if N > 1, otherwise a T.
|
inline |
Construct a cylinder with arbitrary radius and endpoints.
p0 | An endpoint of the cylinder axis. |
p1 | An endpoint of the cylinder axis. |
radius | Radius of cylinder. |
Nearest point on the interior of the shape.
If p
is on the interior of the shape, return p
unaltered; otherwise orthogonally project p
to the shape's surface.
Geometric convex support function.
Returns the point on the surface of this convex shape that is furthest along direction d
(i.e., has the highest dot product with d
).
All shapes which implement this function automatically support geometrical intersection tests with any other Convex object.
d | Direction along which to find a support plane. |
Convex shape overlap test.
other
; false otherwise.