EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Namespaces | Classes | Enumerations | Functions
EBGeometry::DCEL Namespace Reference

Namespace containing various double-connected edge list (DCEL) functionality. More...

Namespaces

namespace  ReconcileDetail
 Internals of DCEL::ReconcileSchedule and DCEL::reconcile().
 
namespace  VertexDetail
 Helpers shared by VertexT::computeVertexNormalAngleWeighted() and DCEL::reconcile().
 

Classes

class  EdgeIteratorT
 Half-edge iterator class for navigating the half edge mesh. More...
 
class  EdgeT
 Half-edge class for navigating a DCEL mesh. More...
 
class  FaceT
 Face class for navigating a DCEL mesh. More...
 
class  MeshT
 DCEL mesh class - stores a doubly-connected edge mesh. More...
 
class  ReconcileSchedule
 Which faces touch each vertex of a mesh, checked and stored once, for DCEL::reconcile(). More...
 
class  VertexT
 Vertex class for navigating a DCEL mesh. More...
 

Enumerations

enum class  InsideOutsideAlgorithm { SubtendedAngle , CrossingNumber , WindingNumber }
 Supported algorithms for testing whether a point projects to the inside of a polygon face. More...
 

Functions

template<class T >
void reconcile (Pool &a_pool, const MeshT< T > &a_mesh, const ReconcileSchedule &a_schedule)
 Reconcile the copy of a_mesh that lives in a_pool, after its vertices have moved: every face's normal, centroid, area and projection axes, and every half-edge's and vertex's pseudonormal, as MeshT::reconcile() computes them.
 

Detailed Description

Namespace containing various double-connected edge list (DCEL) functionality.

DCEL is short for doubly-connected edge list, and is data structure for navigating surface meshes.

Enumeration Type Documentation

◆ InsideOutsideAlgorithm

Supported algorithms for testing whether a point projects to the inside of a polygon face.

A 3D point projected onto a face's plane lies inside or outside the polygon; the test reduces to 2D by dropping the coordinate of the largest normal component (see FaceT). These are the well-known 2D inside/outside tests.

Enumerator
SubtendedAngle 

Sums the subtended angle of the point with each polygon edge; the point is inside if the sum is +-2*pi (360 degrees) and outside if it is 0.

CrossingNumber 

Casts a ray from the point along +x and counts how many times it crosses a polygon edge; the point is inside if the crossing count is odd (even-odd rule).

WindingNumber 

Computes the winding number of the polygon boundary around the point; the point is inside if the winding number is non-zero.

Function Documentation

◆ reconcile()

template<class T >
void EBGeometry::DCEL::reconcile ( Pool &  a_pool,
const MeshT< T > &  a_mesh,
const ReconcileSchedule &  a_schedule 
)
inline

Reconcile the copy of a_mesh that lives in a_pool, after its vertices have moved: every face's normal, centroid, area and projection axes, and every half-edge's and vertex's pseudonormal, as MeshT::reconcile() computes them.

DCEL::reconcile() reads the arrays.

For vertices that move without changing the mesh's topology. Runs where a_pool's memory is, in three passes, one per face, per half-edge and per vertex: on a device-accessible pool, each pass is one GPU::parallelFor() (device kernels in a CUDA or HIP build, host loops over emulated device memory in a host build); on a host pool, each is a host loop. a_pool is the mesh's own pool or any mirror of it.

In host memory the result is MeshT::reconcile()'s, byte for byte. On a device it agrees to rounding: device compilers fuse multiplies and adds by default, and the device's std::acos differs from the host's in the last bits.

How the vertices were moved is the caller's business (any kernel, any library, a copy from the host), as long as that work has finished: the passes run on the default stream, and reconcile() returns once they are done. One reconcile at a time per schedule and pool: the passes share the schedule's status word in that pool, so two reconciles of the same pool's mesh running at once (from two host threads, say) would race on it. A mesh SDF over the mesh also needs its BVH refitted (BVH::refit()) before it is queried again.

Aborts, in every build, on a schedule built in a pool of another mirror chain or for another mesh, and on the geometry MeshT::reconcile() aborts on, with its message: a vertex and its two neighbors on a face (of non-zero area) with coincident positions. The status word the vertex pass sets is read back after the passes (4 bytes from a device), and only when it is set is the vertex found on the host (in place when the host can read the pool, in a host mirror otherwise). With several such vertices, the message names the first in vertex order, as MeshT::reconcile() does, whatever order the device's threads found them in.

Template Parameters
TFloating-point precision.
Parameters
[in,out]a_poolThe pool whose copy of the mesh is reconciled: the mesh's own pool or a mirror.
[in]a_meshThe mesh, as built (a handle to its own pool).
[in]a_scheduleThe schedule built for a_mesh.