57 cout <<
"[Aleph Geometry Example] " << title <<
"\n";
58 cout <<
"============================================================\n";
80 cout << fixed << setprecision(3);
95 cout <<
"\nUnique sites: " <<
dt.sites.size() <<
endl;
96 cout <<
"Delaunay triangles: " <<
dt.triangles.size() <<
endl;
100 for (
size_t i = 0; i <
dt.triangles.size(); ++i)
102 const auto &
tr =
dt.triangles(i);
103 cout <<
" T" << i <<
": [" <<
tr.i <<
", " <<
tr.j <<
", " <<
tr.k <<
"] ";
114 cout <<
"\nVoronoi vertices: " <<
vor.vertices.size() <<
endl;
115 cout <<
"Voronoi edges: " <<
vor.edges.size() <<
endl;
116 cout <<
"Voronoi cells (raw): " <<
vor.cells.size() <<
endl;
123 cout <<
"Voronoi cells (clipped): " <<
clipped.size() <<
endl;
127 for (
size_t i = 0; i <
clipped.size(); ++i)
130 assert(c.site_index == i);
131 assert(c.polygon.is_closed());
132 assert(c.polygon.size() >= 3);
136 cout <<
"\nFirst 3 clipped cells:" <<
endl;
137 for (
size_t i = 0; i <
clipped.size()
and i < 3; ++i)
140 cout <<
" cell[" << c.site_index <<
"] site=";
142 cout <<
" vertices=" << c.polygon.size() <<
endl;
145 cout <<
"\nValidation OK: clipped cells are indexed and contain their site." <<
endl;
146 cout <<
"STATUS: OK" <<
endl;
Simple dynamic array with automatic resizing and functional operations.
Exact Delaunay triangulation using the Bowyer-Watson incremental algorithm.
Dynamic singly linked list with functional programming support.
T & append(const T &item)
Exact point-in-polygon classification via winding number.
Represents a point with rectangular coordinates in a 2D plane.
const Geom_Number & get_x() const noexcept
Gets the x-coordinate value.
const Geom_Number & get_y() const noexcept
Gets the y-coordinate value.
A general (irregular) 2D polygon defined by a sequence of vertices.
void add_vertex(const Point &point)
Add a vertex to the polygon.
Voronoi diagram derived as the dual of a Delaunay triangulation.
static Array< ClippedCell > clipped_cells_indexed(const Array< Point > &sites, const Polygon &clip)
Clip Voronoi cells and return explicit site-indexed records.
static Polygon make_clip_window()
static void print_point(const Point &p)
static void print_banner(const char *title)
Computational geometry algorithms.
Main namespace for Aleph-w library functions.
and
Check uniqueness with explicit hash + equality functors.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
double geom_number_to_double(const Geom_Number &n)
Converts a Geom_Number to its double precision representation.
The result of a Delaunay triangulation.
The complete result of a Voronoi diagram computation.