Three-dimensional polyhedron.
using triangle_array = std::vector< triangle_type >
using triangle_type = Triangle< T, N >
using box_type = Rectangle< T, N >
using index_type = typename face_type::value_type
using size_type = size_t
using face_array = std::vector< face_type >
using vertex_array = std::vector< vertex_type >
using face_type = Face< 3 >
using vertex_type = Vertex< T, N >
using scalar_type = T
object(std::ostream & out) const -> void
gnuplot(std::ostream & out) const -> void
mass_moments_below(int dimension, scalar_type level) const -> Mass_moments< T, N >
mass_moments() const -> Mass_moments< T, N >
Calculate volume, centre of mass and inertia tensor. Uses algorithm from [4].
rotate(int dimension, int degrees) -> void
Rotate the geometry by angle which is multiple of 90 degrees.
mirror(int dimension) -> void
Extend the geometry by mirroring it over the specified axis.
flip(int dimension) -> void
Flip the geometry over specified axis.
wall(scalar_type thickness) -> void
Shrink or extend the geometry by thickness
in the direction of centroid.
scale(const vertex_type & ratio) -> void
Scale the geometry by specified ratio
over each dimension.
move(const vertex_type & delta) -> void
move_to_centre_of_bounding_box() -> void
Move origin to centre of bounding box.
move_to_centre_of_mass() -> void
Move origin to centre of mass.
blitz_faces() const -> blitz_face_array
blitz_vertex_normals() const -> blitz_vertex_array
blitz_vertices() const -> blitz_vertex_array
triangles() const -> triangle_array
empty() const -> bool
remove_face(index_type vertex) -> void
remove_face(const vertex_type & vertex) -> void
cut_duplicate_faces() -> void
clean() -> void
Remove unused vertices.
split() const -> std::vector< Polyhedron >
split(std::vector< Polyhedron > & parts) const -> void
Split into independent polyhedrons and append them to parts
array.
operator+=(const Polyhedron & rhs) -> Polyhedron &
merge(const Polyhedron & rhs) -> void
Add all vertices, faces and normals from rhs
.
unique() -> void
Remove duplicate vertices and faces.
reorder() -> void
Fix face indices winding order.
normalise_vertices() -> void
Compute vertex normals from face normals.
normalise_faces() -> void
Compute face normals only.
normalise() -> void
Compute face and vertex normals in one loop.
signed_volume_below_centroid(int dimension) const -> scalar_type
swap(Polyhedron & rhs) -> void
bounds(int dimension) const -> Bounds< T >
bounding_box() const -> box_type
centroid_below(int dimension, scalar_type level) const -> vertex_type
centroid() const -> vertex_type
centre() const -> vertex_type
signed_volume_below(int dimension, scalar_type level) const -> scalar_type
signed_volume() const -> scalar_type
average_face_area() const -> scalar_type
area() const -> scalar_type
shrink_to_fit() -> void
clear_normals() -> void
clear() -> void
faces() const -> const face_array &
face_normals(vertex_array && rhs) -> void
face_normals(const vertex_array & rhs) -> void
face_normals() const -> const vertex_array &
vertex_normals() -> vertex_array &
vertex_normals() const -> const vertex_array &
vertices() -> vertex_array &
vertices() const -> const vertex_array &
template <class Surface>
Polyhedron(const Surface & surface, size_type resolution_u, size_type resolution_v)
Polyhedron(const triangle_array & triangles)explicit
Polyhedron(const blitz_vertex_array & vertices, const blitz_face_array & faces)explicit
Polyhedron(vertex_array && vertices, vertex_array && vertex_normals, face_array && faces, vertex_array && face_normals)explicit
Polyhedron(const vertex_array & vertices, const vertex_array & vertex_normals, const face_array & faces, const vertex_array & face_normals)explicit
Polyhedron(const vertex_array & vertices, const vertex_array & vertex_normals, const face_array & faces)explicit
Polyhedron(vertex_array && vertices, face_array && faces)explicit
Polyhedron(const vertex_array & vertices, const face_array & faces)explicit
operator=(Polyhedron &&) -> Polyhedron &
Polyhedron(Polyhedron &&)
operator=(const Polyhedron &) -> Polyhedron &
Polyhedron(const Polyhedron &)
~Polyhedron()
Polyhedron()
template <class T, int N>
winding_number(const Polyhedron< T, N > & geometry, const Vertex< T, N > & origin) -> T
template <class T, int N>
inertia_tensor(const Polyhedron< T, N > & body) -> Inertia_tensor< T, N >
Calculate inertia tensor (matrix) of a body as a sum of inertia tensors for tetrahedrons. Uses formulae from [13].
template <class T, int N>
area(const Polyhedron< T, N > & polyhedron) -> T
template <class T, int N>
swap(Polyhedron< T, N > & lhs, Polyhedron< T, N > & rhs) -> void
template <class T, int N>
operator>>(vtb::core::bstream & in, Polyhedron< T, N > & rhs) -> vtb::core::bstream &
template <class T, int N>
centroid(const Polyhedron< T, N > & geometry) -> Vertex< T, N >
template <class T, int N>
signed_volume(const Polyhedron< T, N > & geometry) -> T
template <class T, int N>
operator+(const Polyhedron< T, N > & lhs, const Polyhedron< T, N > & rhs) -> Polyhedron< T, N >
template <class T, int N>
volume(const Polyhedron< T, N > & geometry) -> T
template <class T, int N>
operator<<(vtb::core::bstream & out, const Polyhedron< T, N > & rhs) -> vtb::core::bstream &