Class Polyhedron

Class Documentation

class brille::Polyhedron

Public Types

using ind_t = brille::ind_t
using shape_t = typename bArray<double>::shape_t

Public Functions

Polyhedron()
Polyhedron(const bArray<double> &v)

Create a convex-hull Polyhedron from a set of points.

Polyhedron(const bArray<double> &v, const bArray<double> &p)

Build a Polyhedron from vertices and vectors pointing to face centres.

Polyhedron(const bArray<double> &v, const bArray<double> &p, const std::vector<std::vector<int>> &fpv, const std::vector<std::vector<int>> &vpf)
Polyhedron(const bArray<double> &v, const bArray<double> &p, const bArray<double> &n)

Build a Polyhedron from vertices, on-face points, and face normals.

Polyhedron(const bArray<double> &v, const bArray<double> &p, const bArray<double> &n, const std::vector<std::vector<int>> &fpv, const std::vector<std::vector<int>> &vpf)
Polyhedron(const bArray<double> &v, const std::vector<std::vector<int>> &vpf)
Polyhedron(const bArray<double> &v, const bArray<double> &p, const bArray<double> &n, const std::vector<std::vector<int>> &vpf)
Polyhedron(const Polyhedron &other)
Polyhedron &operator=(const Polyhedron &other)
Polyhedron mirror(void) const
template<class T>
Polyhedron rotate(const std::array<T, 9> rot) const
template<class T>
Polyhedron translate(const bArray<T> &vec) const
Polyhedron operator+(const Polyhedron &other) const
size_t num_vertices() const
size_t num_faces() const
bArray<double> get_vertices(void) const
bArray<double> get_points(void) const
bArray<double> get_normals(void) const
std::vector<std::vector<int>> get_faces_per_vertex(void) const
std::vector<std::vector<int>> get_vertices_per_face(void) const
bArray<double> get_half_edges(void) const
std::string string_repr(void) const
double get_volume(void) const
bArray<double> get_centroid(void) const
double get_circumsphere_radius(void) const
Polyhedron centre(void) const
std::vector<bool> contains(const std::vector<std::array<double, 3>> &x) const
std::vector<bool> contains(const bArray<double> &x) const
bool intersects(const Polyhedron &other) const
Polyhedron intersection(const Polyhedron &other) const
template<class T>
Polyhedron divide(const bArray<T> &n, const bArray<T> &p)
bArray<double> rand_rejection(const size_t n, const unsigned int seed = 0) const

Public Static Functions

template<class T>
Polyhedron bisect(const Polyhedron &pin, const bArray<T> &n, const bArray<T> &p)

Find the polyhedron which results from slicing an existant polyhedron by one or more plane passing through its volume. The part closest to the origin is retained.

Protected Functions

void keep_unique_vertices(void)
void special_keep_unique_vertices()
void find_convex_hull(void)
void find_all_faces_per_vertex(void)
void polygon_vertices_per_face(void)
void purge_central_polygon_vertices(void)
void actual_vertex_purge(void)
void sort_polygons(void)
void purge_extra_vertices(void)
void find_face_points_and_normals(void)

Protected Attributes

bArray<double> vertices
bArray<double> points
bArray<double> normals
std::vector<std::vector<int>> faces_per_vertex
std::vector<std::vector<int>> vertices_per_face