Geogram Version 1.8.5
A programming library of geometric algorithms
Loading...
Searching...
No Matches
GEO::MeshSurfaceIntersection Class Reference

Computes surface intersections. More...

#include <geogram/mesh/mesh_surface_intersection.h>

Classes

class  RadialSort
 

Public Member Functions

 MeshSurfaceIntersection (Mesh &M)
 
void intersect ()
 
void remove_external_shell ()
 
void remove_internal_shells ()
 
void set_verbose (bool x)
 Display information while computing the intersection. Default is unset.
 
void set_delaunay (bool x)
 If set, compute constrained Delaunay triangulation in the intersected triangles. If there are intersections in coplanar facets, it guarantees uniqueness of their triangulation. Default is set.
 
void set_approx_incircle (bool x)
 If set, then Delaunay mode uses approximated incircle predicate (else it uses exact arithmetics). Default is unset.
 
void set_approx_radial_sort (bool x)
 If set, do not use exact geometry for ordering triangles around radial edge. Default is unset.
 
void set_detect_intersecting_neighbors (bool x)
 detect and compute intersections between facets that share a facet or an edge. Set to false if input is a set of conformal meshes. Default is set.
 
void set_radial_sort (bool x)
 Specifies whether surfaces should be duplicated and radial edges sorted in order to create the volumetric partition yielded by the intersection.
 
void set_normalize (bool x)
 Specifies whether coordinates should be normalized during computation. If set, original coordinates are restored at the end of intersect().
 
void save_exact (const std::string &filename)
 

Protected Member Functions

void lock ()
 Acquires a lock on this mesh.
 
void unlock ()
 Releases the lock associated with this mesh.
 
vec3HE exact_vertex (index_t v) const
 Gets the exact point associated with a vertex.
 
index_t find_or_create_exact_vertex (const vec3HE &p)
 Finds or creates a vertex in the mesh, by exact coordinates.
 
Meshtarget_mesh ()
 Gets the target mesh.
 
const Meshtarget_mesh () const
 Gets the target mesh.
 
const Meshreadonly_mesh () const
 Gets a copy of the initial mesh passed to the constructor.
 
bool radial_sort (vector< index_t >::iterator b, vector< index_t >::iterator e)
 Sorts a range of halfedges in radial order.
 
void build_Weiler_model ()
 
void mark_external_shell (vector< index_t > &on_external_shell)
 Marks all the facets that are on the external shell.
 
index_t halfedge_vertex (index_t h, index_t dlv) const
 
index_t alpha2 (index_t h) const
 
void sew2 (index_t h1, index_t h2)
 
index_t alpha3 (index_t h) const
 
index_t alpha3_facet (index_t f) const
 
void sew3 (index_t h1, index_t h2)
 
void save_triangle (const std::string &name, index_t h)
 
void save_radial (const std::string &name, vector< index_t >::iterator b, vector< index_t >::iterator e)
 

Protected Attributes

Process::spinlock lock_
 
Meshmesh_
 
Mesh mesh_copy_
 
Attribute< const vec3HE * > vertex_to_exact_point_
 
Attribute< index_tfacet_corner_alpha3_
 
Attribute< bool > facet_corner_degenerate_
 
std::map< vec3HE, index_t, vec3HELexicoCompareexact_point_to_vertex_
 
RadialSort radial_sort_
 
bool verbose_
 
bool delaunay_
 
bool detect_intersecting_neighbors_
 
bool approx_incircle_
 
bool use_radial_sort_
 
bool normalize_
 
vec3 normalize_center_
 
double normalize_radius_
 

Friends

class MeshInTriangle
 

Detailed Description

Computes surface intersections.

New vertices are stored with exact coordinates

Definition at line 64 of file mesh_surface_intersection.h.

Member Function Documentation

◆ alpha2()

index_t GEO::MeshSurfaceIntersection::alpha2 ( index_t  h) const
inlineprotected

Definition at line 253 of file mesh_surface_intersection.h.

◆ alpha3()

index_t GEO::MeshSurfaceIntersection::alpha3 ( index_t  h) const
inlineprotected

Definition at line 280 of file mesh_surface_intersection.h.

◆ alpha3_facet()

index_t GEO::MeshSurfaceIntersection::alpha3_facet ( index_t  f) const
inlineprotected

Definition at line 284 of file mesh_surface_intersection.h.

◆ exact_vertex()

vec3HE GEO::MeshSurfaceIntersection::exact_vertex ( index_t  v) const
protected

Gets the exact point associated with a vertex.

If the vertex has explicit exact coordinates associated with it, they are returned, else an exact vec3HE is constructed from the double-precision coordinates stored in the mesh

Parameters
[in]va vertex of the mesh
Returns
the exact coordinates of this vertex, as a vector in homogeneous coordinates stored as expansions

◆ find_or_create_exact_vertex()

index_t GEO::MeshSurfaceIntersection::find_or_create_exact_vertex ( const vec3HE p)
protected

Finds or creates a vertex in the mesh, by exact coordinates.

If there is already a vertex with coordinates p, then the existing vertex is returned, else a new vertex is constructed. Note that only the vertices created by find_or_create_vertex() can be returned as existing vertices. Mesh vertices stored as double- precision coordinates are not retreived by this function.

Parameters
[in]pthe exact coordinates of a point
Returns
the index of a mesh vertex with p as coordinates

◆ halfedge_vertex()

index_t GEO::MeshSurfaceIntersection::halfedge_vertex ( index_t  h,
index_t  dlv 
) const
inlineprotected

Definition at line 247 of file mesh_surface_intersection.h.

◆ intersect()

void GEO::MeshSurfaceIntersection::intersect ( )

A facet attribute of type index_t named "operand_bit" can indicate for each facet to which operand of a n-ary boolean operation it corresponds to (the same facet might belong to several operands). It is taken into account by the two variants of mesh_classify_intersections()

◆ lock()

void GEO::MeshSurfaceIntersection::lock ( )
inlineprotected

Acquires a lock on this mesh.

A single thread can have the lock. When multiple threads want the lock, the ones that do not have it keep waiting until the one that owns the lock calls unlock(). All threads that modify the target mesh should call this function

See also
unlock()

Definition at line 161 of file mesh_surface_intersection.h.

◆ radial_sort()

bool GEO::MeshSurfaceIntersection::radial_sort ( vector< index_t >::iterator  b,
vector< index_t >::iterator  e 
)
protected

Sorts a range of halfedges in radial order.

Parameters
[in]b,eiterators in a vector of halfedge indices
Return values
trueif everything went well
falseif two triangles are coplanar with same normal orientation

◆ readonly_mesh()

const Mesh & GEO::MeshSurfaceIntersection::readonly_mesh ( ) const
inlineprotected

Gets a copy of the initial mesh passed to the constructor.

It is used by the multithreaded mesh intersection algorithm. Each thread needs to both access the initial geometry and create new vertices and triangles in the target mesh. Creating new mesh elements can reallocate the internal vectors of the mesh, and change the address of the elements. This should not occur while another thread is reading the mesh. Copying the initial geometry in another mesh prevents this type of problems.

Returns
a const reference to the mesh that was copied from the one passed to the constructor

Definition at line 225 of file mesh_surface_intersection.h.

◆ save_radial()

void GEO::MeshSurfaceIntersection::save_radial ( const std::string &  name,
vector< index_t >::iterator  b,
vector< index_t >::iterator  e 
)
inlineprotected

Definition at line 310 of file mesh_surface_intersection.h.

◆ save_triangle()

void GEO::MeshSurfaceIntersection::save_triangle ( const std::string &  name,
index_t  h 
)
inlineprotected

Definition at line 299 of file mesh_surface_intersection.h.

◆ set_approx_incircle()

void GEO::MeshSurfaceIntersection::set_approx_incircle ( bool  x)
inline

If set, then Delaunay mode uses approximated incircle predicate (else it uses exact arithmetics). Default is unset.

Definition at line 106 of file mesh_surface_intersection.h.

◆ set_approx_radial_sort()

void GEO::MeshSurfaceIntersection::set_approx_radial_sort ( bool  x)
inline

If set, do not use exact geometry for ordering triangles around radial edge. Default is unset.

Definition at line 114 of file mesh_surface_intersection.h.

◆ set_delaunay()

void GEO::MeshSurfaceIntersection::set_delaunay ( bool  x)
inline

If set, compute constrained Delaunay triangulation in the intersected triangles. If there are intersections in coplanar facets, it guarantees uniqueness of their triangulation. Default is set.

Definition at line 98 of file mesh_surface_intersection.h.

◆ set_detect_intersecting_neighbors()

void GEO::MeshSurfaceIntersection::set_detect_intersecting_neighbors ( bool  x)
inline

detect and compute intersections between facets that share a facet or an edge. Set to false if input is a set of conformal meshes. Default is set.

Definition at line 123 of file mesh_surface_intersection.h.

◆ set_normalize()

void GEO::MeshSurfaceIntersection::set_normalize ( bool  x)
inline

Specifies whether coordinates should be normalized during computation. If set, original coordinates are restored at the end of intersect().

Parameters
[in]xtrue if coordinates should be normalized. Default is set.

Definition at line 145 of file mesh_surface_intersection.h.

◆ set_radial_sort()

void GEO::MeshSurfaceIntersection::set_radial_sort ( bool  x)
inline

Specifies whether surfaces should be duplicated and radial edges sorted in order to create the volumetric partition yielded by the intersection.

Parameters
[in]xtrue if radial edges should be sorted. Default is set

Definition at line 134 of file mesh_surface_intersection.h.

◆ set_verbose()

void GEO::MeshSurfaceIntersection::set_verbose ( bool  x)
inline

Display information while computing the intersection. Default is unset.

Definition at line 88 of file mesh_surface_intersection.h.

◆ sew2()

void GEO::MeshSurfaceIntersection::sew2 ( index_t  h1,
index_t  h2 
)
inlineprotected

Definition at line 267 of file mesh_surface_intersection.h.

◆ sew3()

void GEO::MeshSurfaceIntersection::sew3 ( index_t  h1,
index_t  h2 
)
inlineprotected

Definition at line 288 of file mesh_surface_intersection.h.

◆ target_mesh() [1/2]

Mesh & GEO::MeshSurfaceIntersection::target_mesh ( )
inlineprotected

Gets the target mesh.

Returns
a modifiable reference to the mesh that was passed to the constructor

Definition at line 200 of file mesh_surface_intersection.h.

◆ target_mesh() [2/2]

const Mesh & GEO::MeshSurfaceIntersection::target_mesh ( ) const
inlineprotected

Gets the target mesh.

Returns
a const reference to the mesh that was passed to the constructor

Definition at line 209 of file mesh_surface_intersection.h.

◆ unlock()

void GEO::MeshSurfaceIntersection::unlock ( )
inlineprotected

Releases the lock associated with this mesh.

Definition at line 168 of file mesh_surface_intersection.h.

Friends And Related Symbol Documentation

◆ MeshInTriangle

friend class MeshInTriangle
friend

Definition at line 461 of file mesh_surface_intersection.h.

Member Data Documentation

◆ approx_incircle_

bool GEO::MeshSurfaceIntersection::approx_incircle_
protected

Definition at line 456 of file mesh_surface_intersection.h.

◆ delaunay_

bool GEO::MeshSurfaceIntersection::delaunay_
protected

Definition at line 454 of file mesh_surface_intersection.h.

◆ detect_intersecting_neighbors_

bool GEO::MeshSurfaceIntersection::detect_intersecting_neighbors_
protected

Definition at line 455 of file mesh_surface_intersection.h.

◆ exact_point_to_vertex_

std::map<vec3HE,index_t,vec3HELexicoCompare> GEO::MeshSurfaceIntersection::exact_point_to_vertex_
protected

Definition at line 451 of file mesh_surface_intersection.h.

◆ facet_corner_alpha3_

Attribute<index_t> GEO::MeshSurfaceIntersection::facet_corner_alpha3_
protected

Definition at line 449 of file mesh_surface_intersection.h.

◆ facet_corner_degenerate_

Attribute<bool> GEO::MeshSurfaceIntersection::facet_corner_degenerate_
protected

Definition at line 450 of file mesh_surface_intersection.h.

◆ lock_

Process::spinlock GEO::MeshSurfaceIntersection::lock_
protected

Definition at line 445 of file mesh_surface_intersection.h.

◆ mesh_

Mesh& GEO::MeshSurfaceIntersection::mesh_
protected

Definition at line 446 of file mesh_surface_intersection.h.

◆ mesh_copy_

Mesh GEO::MeshSurfaceIntersection::mesh_copy_
protected

Definition at line 447 of file mesh_surface_intersection.h.

◆ normalize_

bool GEO::MeshSurfaceIntersection::normalize_
protected

Definition at line 458 of file mesh_surface_intersection.h.

◆ normalize_center_

vec3 GEO::MeshSurfaceIntersection::normalize_center_
protected

Definition at line 459 of file mesh_surface_intersection.h.

◆ normalize_radius_

double GEO::MeshSurfaceIntersection::normalize_radius_
protected

Definition at line 460 of file mesh_surface_intersection.h.

◆ radial_sort_

RadialSort GEO::MeshSurfaceIntersection::radial_sort_
protected

Definition at line 452 of file mesh_surface_intersection.h.

◆ use_radial_sort_

bool GEO::MeshSurfaceIntersection::use_radial_sort_
protected

Definition at line 457 of file mesh_surface_intersection.h.

◆ verbose_

bool GEO::MeshSurfaceIntersection::verbose_
protected

Definition at line 453 of file mesh_surface_intersection.h.

◆ vertex_to_exact_point_

Attribute<const vec3HE*> GEO::MeshSurfaceIntersection::vertex_to_exact_point_
protected

Definition at line 448 of file mesh_surface_intersection.h.


The documentation for this class was generated from the following file: