VTriangleSolid solid. More...
#include <vtriangle.hpp>

Public Member Functions | |
VTriangleSurfaceSolid (double vertex_matching_eps=1.0e-9, double signed_volume_eps=1.0e-15) | |
Constructor for vertex triangle surface solid. More... | |
~VTriangleSurfaceSolid () | |
Destructor. More... | |
void | set_signed_volume_eps (double signed_volume_eps) |
Set signed volume tolerance. More... | |
Vec3D | vertex (uint32_t i) const |
Return vertex i coordinates. More... | |
void | prepare_for_inside () |
Prepare for inside tests. More... | |
bool | inside (const Vec3D &x) const |
Return if point x is inside solid. More... | |
void | get_bbox (Vec3D &min, Vec3D &max) const |
Return bounding box in vectors min and max. More... | |
void | remove_duplicate_triangles (void) |
Remove duplicate triangles. More... | |
void | check_data (void) const |
Check data. More... | |
void | clear (void) |
Clear surface. More... | |
void | debug_print (std::ostream &os) const |
Debug print. More... | |
![]() | |
VTriangleSurface (double vertex_matching_eps=1.0e-9) | |
Constructor for vertex triangle surface. More... | |
~VTriangleSurface () | |
Destructor. More... | |
void | set_vertex_matching_eps (double vertex_matching_eps) |
Set vertex matching tolerance. More... | |
uint32_t | vertexc (void) const |
Return vertex count. More... | |
const Vec3D & | vertex (uint32_t i) const |
Return vertex i coordinates. More... | |
uint32_t | trianglec (void) const |
Return triangle count. More... | |
const VTriangle & | triangle (uint32_t i) const |
Return triangle i. More... | |
uint32_t | add_vertex_no_check (const Vec3D &x) |
Add a vertex x without checking. More... | |
uint32_t | add_vertex (const Vec3D &x) |
Add a vertex x with duplicate vertex elimination. More... | |
uint32_t | add_triangle (const Vec3D &x1, const Vec3D &x2, const Vec3D &x3) |
Add a triangle consiting of vertices x1, x2 and x3 with duplicate vertex elimination. More... | |
uint32_t | add_triangle (const Vec3D x[3]) |
Add a triangle consiting of vertices x with duplicate vertex elimination. More... | |
uint32_t | add_triangle (uint32_t v1, uint32_t v2, uint32_t v3) |
Add a triangle consiting of already defined vertices v1, v2 and v3. More... | |
uint32_t | add_triangle (const uint32_t v[3]) |
Add a triangle consiting of already defined vertices v. More... | |
void | clear (void) |
Clear surface. More... | |
void | debug_print (std::ostream &os) const |
Debug print. More... | |
Additional Inherited Members | |
![]() | |
std::vector< Vec3D > | _vertex |
List of vertices for surface triangles. More... | |
std::vector< VTriangle > | _triangle |
List of surface triangles. More... | |
Detailed Description
VTriangleSolid solid.
Closed surface mesh constructed of vertex triangles and vertices. The test inside() is provided for testing for point inclusion in the solid. The prepare_for_inside() function must be called after constructing surface, before using inside().
Constructor & Destructor Documentation
◆ VTriangleSurfaceSolid()
VTriangleSurfaceSolid::VTriangleSurfaceSolid | ( | double | vertex_matching_eps = 1.0e-9 , |
double | signed_volume_eps = 1.0e-15 |
||
) |
Constructor for vertex triangle surface solid.
The vertex matching tolerance can be set with vertex_matching_eps (defaults to 1.0e-9) and signed volume tolerance used in inside test with signed_volume_eps (defaults to 1.0e-15).
◆ ~VTriangleSurfaceSolid()
VTriangleSurfaceSolid::~VTriangleSurfaceSolid | ( | ) |
Destructor.
Member Function Documentation
◆ check_data()
void VTriangleSurfaceSolid::check_data | ( | void | ) | const |
Check data.
- Triangle edge pairing. Every triangle must have exactly one neighbouring triangle for each of the three edges.
- Neighbouring triangles must be defined in same direction.
- No zero area triangles are allowed.
Throws an error if not valid.
◆ clear()
void VTriangleSurfaceSolid::clear | ( | void | ) |
Clear surface.
◆ debug_print()
void VTriangleSurfaceSolid::debug_print | ( | std::ostream & | os | ) | const |
Debug print.
◆ get_bbox()
Return bounding box in vectors min and max.
The prepare_for_inside() function must be called before using this function.
◆ inside()
bool VTriangleSurfaceSolid::inside | ( | const Vec3D & | x | ) | const |
Return if point x is inside solid.
Uses algorithm from R. Segura, F. R. Feito, J. Ruiz de Miras, C. Ogayar and J. C. Torres, "An Efficient Point Classification Algorithm for Triangle Meshes", Journal of Graphics, GPU, and Game Tools 10, issue 3, 2005.
The prepare_for_inside() function must be called before using this function.
◆ prepare_for_inside()
void VTriangleSurfaceSolid::prepare_for_inside | ( | ) |
Prepare for inside tests.
The inside() test algorithm is only capable of working in the positive octant. Therefore an offset is applied to the data and a boundary box test is performed to avoid forbidden tests.
The bounding box and offset are computed with this function after constructing the surface data. Call exactly once after defining solid.
◆ remove_duplicate_triangles()
void VTriangleSurfaceSolid::remove_duplicate_triangles | ( | void | ) |
Remove duplicate triangles.
◆ set_signed_volume_eps()
void VTriangleSurfaceSolid::set_signed_volume_eps | ( | double | signed_volume_eps | ) |
Set signed volume tolerance.
Defaults to 1.0e-15.
◆ vertex()
|
inline |
Return vertex i coordinates.
The documentation for this class was generated from the following files:
- vtriangle.hpp
- vtriangle.cpp