|
Graphite Version 3
An experimental 3D geometry processing program
|
Detects and retriangulates a set of coplanar facets for MeshSurfaceIntersection. More...
#include <geogram/mesh/mesh_surface_intersection_internal.h>
Public Types | |
| typedef MeshSurfaceIntersection::ExactPoint | ExactPoint |
Public Member Functions | |
| CoplanarFacets (MeshSurfaceIntersection &I, bool clear_attributes, double angle_tolerance=0.0) | |
| Constructs a CoplanarFacets object associated with a MeshSurfaceIntersection. | |
| void | get (index_t f, index_t group_id) |
| Gets the set of coplanar facets from a given facet and group id. | |
| void | mark_vertices_to_keep () |
| Marks the vertices that need to be kept in the simplified facets. | |
| void | save_borders (const std::string &filename) |
| For debugging purposes, saves border edges to a file. | |
| void | save_facet_group (const std::string &filename) |
| For debugging purposes, saves all the facets of the group to a file. | |
| void | triangulate () |
| Triangulates the kept vertices. | |
| index_t | nb_facets () |
| Gets the number of coplanar facets. | |
| void | mark_facets (vector< index_t > &facet_is_marked) |
| Marks the facets. | |
Public Attributes | |
| ExactCDT2d | CDT |
Static Public Attributes | |
| static constexpr index_t | NON_MANIFOLD = index_t(-2) |
Protected Member Functions | |
| void | find_coplanar_facets () |
| Finds all the pairs of coplanar facets. | |
| bool | triangles_are_coplanar (const vec3 &p1, const vec3 &p2, const vec3 &p3, const vec3 &q1, const vec3 &q2, const vec3 &q3) const |
| Tests whether two triangles are coplanar. | |
| bool | edges_are_colinear (const ExactPoint &P1, const ExactPoint &P2, const ExactPoint &P3) const |
| Tests whether two edges are co-linear. | |
Detects and retriangulates a set of coplanar facets for MeshSurfaceIntersection.
Definition at line 493 of file mesh_surface_intersection_internal.h.
Definition at line 496 of file mesh_surface_intersection_internal.h.
| GEO::CoplanarFacets::CoplanarFacets | ( | MeshSurfaceIntersection & | I, |
| bool | clear_attributes, | ||
| double | angle_tolerance = 0.0 |
||
| ) |
Constructs a CoplanarFacets object associated with a MeshSurfaceIntersection.
No set of facets is identified. One needs to call get().
| [in] | I | a reference to the MeshSurfaceIntersection |
| [in] | clear_attributes | if set, resets facet_chart and keep_vertex |
| [in] | angle_tolerance | angle tolerance for detecting coplanar facets and colinear edges (in degrees) |
|
protected |
Tests whether two edges are co-linear.
| [in] | P1,P2,P3 | the vertices of the two edges |
| true | if [P1,P2] and [P2,P3] are co-linear, and P2 is between P1 and p3 |
| false | otherwise |
uses angle_tolerance specified to the constructor (if set to zero, uses exact computation)
|
protected |
Finds all the pairs of coplanar facets.
Initializes c_is_coplanar_[], a vector of booleans indexed by facet corners.
Gets the set of coplanar facets from a given facet and group id.
Uses the "group" facets attribute. If f's group is uninitialized (NO_INDEX), determines the facets of the group geometrically and initializes the attribute, else gets the facets based on the attribute.
| [in] | f | the facet |
| [in] | group_id | the facet group id |
Marks the facets.
| [out] | facet_is_marked | on exit, set to 1 for facets present in the list of coplanar facets. Needs to be of size mesh_.facets.nb(). |
Definition at line 613 of file mesh_surface_intersection_internal.h.
| void GEO::CoplanarFacets::mark_vertices_to_keep | ( | ) |
Marks the vertices that need to be kept in the simplified facets.
A vertex is kept if it is incident to at least two non-colinear edges on the border. The status of the vertices is stored in the "keep" vertex attribute.
|
inline |
Gets the number of coplanar facets.
Definition at line 603 of file mesh_surface_intersection_internal.h.
| void GEO::CoplanarFacets::save_borders | ( | const std::string & | filename | ) |
For debugging purposes, saves border edges to a file.
| [in] | filename | the file where to store the borders. |
| void GEO::CoplanarFacets::save_facet_group | ( | const std::string & | filename | ) |
For debugging purposes, saves all the facets of the group to a file.
| [in] | filename | the file where to store the facets of the group. |
|
protected |
Tests whether two triangles are coplanar.
This is used to determine the facets that can be merged
| [in] | p1,p2,p3 | the vertices of the first triangle |
| [in] | q1,q2,q3 | the vertices of the second triangle |
| true | if the two triangles are coplanar |
| false | otherwise |
uses angle_tolerance specified to the constructor (if set to zero, uses exact computation)
| void GEO::CoplanarFacets::triangulate | ( | ) |
Triangulates the kept vertices.
One can get the triangle through the (public) CDT member (ExactCDT2d).
| ExactCDT2d GEO::CoplanarFacets::CDT |
Definition at line 597 of file mesh_surface_intersection_internal.h.
Definition at line 495 of file mesh_surface_intersection_internal.h.