|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Constrained Delaunay Triangulation via Sloan's flip-based method. More...
#include <geom_algorithms.H>
Classes | |
| struct | CrossingEdge |
| Collect edges that cross segment (u,v) by scanning all mesh edges. More... | |
| struct | IndexedEdge |
| struct | Result |
| struct | Tri |
Public Types | |
| using | IndexedTriangle = DelaunayTriangulationBowyerWatson::IndexedTriangle |
Public Member Functions | |
| Result | operator() (const DynList< Point > &points, const DynList< Segment > &constraints) const |
| Compute constrained Delaunay triangulation. | |
| Result | operator() (const std::initializer_list< Point > points, const std::initializer_list< Segment > constraints) const |
| Convenience overload using initializer lists. | |
Static Public Member Functions | |
| static DynList< Triangle > | as_triangles (const Result &result) |
| Convert indexed triangulation to geometric triangles. | |
Static Private Member Functions | |
| static bool | lexicographic_less (const Point &p1, const Point &p2) |
| static size_t | find_point_index (const Array< Point > &pts, const Point &p) |
| Find index of point p in sorted unique array, or NONE. | |
| static size_t | local_of (const Tri &t, const size_t id) |
| Return local index (0,1,2) of vertex id in triangle t, or NONE. | |
| static size_t | adj_of (const Tri &t, const size_t n) |
| Return the local index of the edge shared with neighbor n. | |
| static size_t | edge_opposite (const Tri &t, const size_t a, const size_t b) |
| Return the local edge index for edge (a,b) in triangle t. | |
| static void | build_adjacency (Array< Tri > &tris, const Array< IndexedTriangle > &dt_tris) |
| Build adjacency mesh from DT output. | |
| static bool | edge_exists (const Array< Tri > &tris, const size_t u, const size_t v, size_t &out_tri, size_t &out_local) |
| Check if edge (u,v) already exists in the mesh. | |
| static bool | is_convex_quad (const Array< Point > &pts, const size_t a, const size_t b, const size_t c, const size_t d) |
| True if diagonal (a,d) in quad (a,b,d) + (a,d,c) forms a convex quad. | |
| static void | flip_edge (Array< Tri > &tris, const size_t tri_a, const size_t tri_b) |
| Flip the diagonal of the quad formed by tri_a and tri_b. | |
| static Array< CrossingEdge > | find_crossing_edges (const Array< Point > &pts, const Array< Tri > &tris, const size_t u, const size_t v) |
| static void | mark_constrained (Array< Tri > &tris, const size_t u, const size_t v) |
| Mark edge (u,v) as constrained in the mesh. | |
| static void | enforce_constraint (Array< Point > &pts, Array< Tri > &tris, const size_t u, const size_t v) |
| Enforce a single constraint edge (u,v) using Sloan's flip approach. | |
| static void | lawson_flip (const Array< Point > &pts, Array< Tri > &tris) |
| Lawson flip pass: restore Delaunay for non-constrained edges. | |
| static Array< Point > | merge_and_deduplicate (const DynList< Point > &points, const DynList< Segment > &constraints) |
| Merge input points, constraint endpoints, and constraint-constraint intersection points; then deduplicate. | |
| static Array< IndexedEdge > | map_constraints (const Array< Point > &sites, const DynList< Segment > &constraints) |
| Split constraints at interior collinear points. | |
Static Private Attributes | |
| static constexpr size_t | NONE = ~static_cast<size_t>(0) |
Constrained Delaunay Triangulation via Sloan's flip-based method.
Computes a triangulation that:
Definition at line 2896 of file geom_algorithms.H.
| using Aleph::ConstrainedDelaunayTriangulation::IndexedTriangle = DelaunayTriangulationBowyerWatson::IndexedTriangle |
Definition at line 2899 of file geom_algorithms.H.
|
inlinestaticprivate |
Return the local index of the edge shared with neighbor n.
Definition at line 2959 of file geom_algorithms.H.
References Aleph::ConstrainedDelaunayTriangulation::Tri::adj, and NONE.
Referenced by find_crossing_edges(), and flip_edge().
|
inlinestatic |
Convert indexed triangulation to geometric triangles.
Definition at line 3643 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), k, Aleph::ConstrainedDelaunayTriangulation::Result::sites, and Aleph::ConstrainedDelaunayTriangulation::Result::triangles.
|
inlinestaticprivate |
Build adjacency mesh from DT output.
Definition at line 2982 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), edge_opposite(), Aleph::GeomTriangleAdjacencyUtils::for_each_sorted_edge_group(), and NONE.
|
inlinestaticprivate |
Check if edge (u,v) already exists in the mesh.
Definition at line 3024 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), edge_opposite(), and NONE.
|
inlinestaticprivate |
Return the local edge index for edge (a,b) in triangle t.
The edge (v[(i+1)%3], v[(i+2)%3]) is "opposite" v[i].
Definition at line 2968 of file geom_algorithms.H.
References Aleph::and, Aleph::divide_and_conquer_partition_dp(), NONE, and Aleph::ConstrainedDelaunayTriangulation::Tri::v.
Referenced by build_adjacency(), and edge_exists().
|
inlinestaticprivate |
Enforce a single constraint edge (u,v) using Sloan's flip approach.
Definition at line 3280 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp().
|
inlinestaticprivate |
Definition at line 3225 of file geom_algorithms.H.
References adj_of(), Aleph::and, Aleph::divide_and_conquer_partition_dp(), Aleph::Segment::intersects_properly_with(), and NONE.
|
inlinestaticprivate |
Find index of point p in sorted unique array, or NONE.
Definition at line 2936 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), lexicographic_less(), and NONE.
|
inlinestaticprivate |
Flip the diagonal of the quad formed by tri_a and tri_b.
tri_a contains edge (p, q) at local index la (opposite vertex). tri_b is the neighbor across that edge. After flipping, the new diagonal connects the two "opposite" vertices.
Definition at line 3075 of file geom_algorithms.H.
References adj_of(), Aleph::divide_and_conquer_partition_dp(), and NONE.
|
inlinestaticprivate |
True if diagonal (a,d) in quad (a,b,d) + (a,d,c) forms a convex quad.
The four points of the quadrilateral are a, b, d, c where:
Definition at line 3050 of file geom_algorithms.H.
References Aleph::COLLINEAR, Aleph::divide_and_conquer_partition_dp(), and Aleph::orientation().
|
inlinestaticprivate |
Lawson flip pass: restore Delaunay for non-constrained edges.
Definition at line 3358 of file geom_algorithms.H.
References Aleph::and, Aleph::CCW, Aleph::COLLINEAR, Aleph::CW, Aleph::divide_and_conquer_partition_dp(), Aleph::in_circle_determinant(), and Aleph::orientation().
|
inlinestaticprivate |
Definition at line 2925 of file geom_algorithms.H.
References Aleph::Point::get_x(), and Aleph::Point::get_y().
Referenced by find_point_index().
|
inlinestaticprivate |
Return local index (0,1,2) of vertex id in triangle t, or NONE.
Definition at line 2951 of file geom_algorithms.H.
References NONE, and Aleph::ConstrainedDelaunayTriangulation::Tri::v.
|
inlinestaticprivate |
Split constraints at interior collinear points.
Definition at line 3471 of file geom_algorithms.H.
References Aleph::and, Aleph::Array< T >::append(), Aleph::Segment::contains(), Aleph::divide_and_conquer_partition_dp(), Aleph::Segment::get_src_point(), Aleph::Segment::get_tgt_point(), Aleph::HTList::Iterator::has_curr(), Aleph::quicksort_op(), and Aleph::Array< T >::size().
|
inlinestaticprivate |
Mark edge (u,v) as constrained in the mesh.
Definition at line 3266 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp().
|
inlinestaticprivate |
Merge input points, constraint endpoints, and constraint-constraint intersection points; then deduplicate.
Definition at line 3432 of file geom_algorithms.H.
References Aleph::all(), Aleph::Array< T >::append(), Aleph::divide_and_conquer_partition_dp(), Aleph::Segment::get_src_point(), Aleph::Segment::get_tgt_point(), Aleph::HTList::Iterator::has_curr(), Aleph::quicksort_op(), Aleph::Array< T >::reserve(), and Aleph::segment_intersection_point().
|
inline |
Compute constrained Delaunay triangulation.
| points | Input points. |
| constraints | Constraint segments (must connect input points). |
Definition at line 3545 of file geom_algorithms.H.
References Aleph::and, Aleph::DynList< T >::append(), Aleph::COLLINEAR, Aleph::divide_and_conquer_partition_dp(), Aleph::orientation(), and Aleph::ConstrainedDelaunayTriangulation::Result::sites.
|
inline |
Convenience overload using initializer lists.
Definition at line 3626 of file geom_algorithms.H.
References Aleph::DynList< T >::append(), and Aleph::divide_and_conquer_partition_dp().
|
staticconstexprprivate |
Definition at line 2915 of file geom_algorithms.H.
Referenced by adj_of(), build_adjacency(), edge_exists(), edge_opposite(), find_crossing_edges(), find_point_index(), flip_edge(), and local_of().