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_typeusing size_type = size_tusing 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 = Tobject(std::ostream & out) const -> voidgnuplot(std::ostream & out) const -> voidmass_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) -> voidExtend the geometry by mirroring it over the specified axis.
flip(int dimension) -> voidFlip 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) -> voidmove_to_centre_of_bounding_box() -> voidMove origin to centre of bounding box.
move_to_centre_of_mass() -> voidMove origin to centre of mass.
blitz_faces() const -> blitz_face_arrayblitz_vertex_normals() const -> blitz_vertex_arrayblitz_vertices() const -> blitz_vertex_arraytriangles() const -> triangle_arrayempty() const -> boolremove_face(index_type vertex) -> voidremove_face(const vertex_type & vertex) -> voidcut_duplicate_faces() -> voidclean() -> voidRemove 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() -> voidCompute vertex normals from face normals.
normalise_faces() -> voidCompute face normals only.
normalise() -> voidCompute face and vertex normals in one loop.
signed_volume_below_centroid(int dimension) const -> scalar_typeswap(Polyhedron & rhs) -> voidbounds(int dimension) const -> Bounds< T >bounding_box() const -> box_typecentroid_below(int dimension, scalar_type level) const -> vertex_typecentroid() const -> vertex_typecentre() const -> vertex_typesigned_volume_below(int dimension, scalar_type level) const -> scalar_typesigned_volume() const -> scalar_typeaverage_face_area() const -> scalar_typearea() const -> scalar_typeshrink_to_fit() -> voidclear_normals() -> voidclear() -> voidfaces() const -> const face_array &face_normals(vertex_array && rhs) -> voidface_normals(const vertex_array & rhs) -> voidface_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)explicitPolyhedron(const blitz_vertex_array & vertices, const blitz_face_array & faces)explicitPolyhedron(vertex_array && vertices, vertex_array && vertex_normals, face_array && faces, vertex_array && face_normals)explicitPolyhedron(const vertex_array & vertices, const vertex_array & vertex_normals, const face_array & faces, const vertex_array & face_normals)explicitPolyhedron(const vertex_array & vertices, const vertex_array & vertex_normals, const face_array & faces)explicitPolyhedron(vertex_array && vertices, face_array && faces)explicitPolyhedron(const vertex_array & vertices, const face_array & faces)explicitoperator=(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) -> Ttemplate <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) -> Ttemplate <class T, int N> swap(Polyhedron< T, N > & lhs, Polyhedron< T, N > & rhs) -> voidtemplate <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) -> Ttemplate <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) -> Ttemplate <class T, int N> operator<<(vtb::core::bstream & out, const Polyhedron< T, N > & rhs) -> vtb::core::bstream &