Skip to main content

qualia_core_db/specialized_libs/computational_geometry/
mod.rs

1//! Native computational geometry for QualiaDB.
2//!
3//! A clean-room Rust implementation of the core computational-geometry algorithm
4//! families, built directly on the QualiaDB engine (10-D tensor, `.10d`
5//! container, `wgpu`/Forge, WASM, renderer). The functionality-specification
6//! reference is de Berg, Cheong, van Kreveld & Overmars, *Computational
7//! Geometry: Algorithms and Applications* (3rd ed.) — used as a public,
8//! textbook description of the algorithms and their correctness properties, not
9//! a source of code. Algorithms are expressed in Rust over caller-owned slices
10//! so the same implementation runs in the native engine and browser/WASM
11//! builds. Geometry is not renderer-only: the topology types are graph
12//! structures usable by the query, reasoning, simulation, and 10-D manifold
13//! layers.
14
15/// P13.5 — Advancing-front surface (2-D) and volume (3-D) meshing with
16/// deterministic shortest-edge/face-first ordering, self-crossing guards,
17/// and typed obstructions.
18pub mod advancing_front;
19/// P10.3 — Allocation counter for zero-heap hot-path verification (test-only).
20#[cfg(test)]
21pub mod allocation_counter;
22mod alpha_shape;
23/// P13.8 - Anisotropic remeshing with crease/feature preservation and
24/// BVH-pruned surface projection.
25pub mod anisotropic_remesh;
26/// P12.6 — Radial sort and Weiler 3-D arrangement model.
27pub mod arrangement_3d;
28/// P11.8 — Arrangements, point-line duality, and topological sweep.
29pub mod arrangements;
30/// P9.5 — Authoring ergonomics: primitives, transforms, scene graph, .10d export.
31pub mod authoring;
32/// P10.7 — Benchmark + adversarial corpus baseline (versioned corpora,
33/// reproducible latency/allocation/hash reports).
34pub mod benchmark_corpus;
35/// P11.2 — Bentley-Ottmann sweep and output-sensitive red/blue intersection.
36pub mod bentley_ottmann;
37pub mod boolean_2;
38pub mod boolean_3;
39/// P20.2 — Botanical crown envelopes: 6-point asymmetric hull (Cescatti),
40/// extruded-hull orthogonal silhouette intersection, paraboloid envelope.
41pub mod botanical_hulls;
42mod box_join;
43pub mod bvh;
44/// P11.13 — Rotating calipers (diameter, width, antipodal pairs) and
45/// smallest enclosing disk (Welzl randomized incremental, seeded determinism).
46pub mod calipers_enclosing_disk;
47/// P20.9 — Canopy radiative transfer: orthographic ID/depth rasterizer,
48/// periodic wrapping, SOC dome / solar track, per-organ PAR·STAR·LAI.
49pub mod canopy_radiation;
50/// P9.4 — qapp/MCP capability manifests (per-op resource limits; backends).
51pub mod capability_manifests;
52/// P12.4 — Per-facet exact constrained Delaunay re-triangulation.
53pub mod cdt_retriangulation;
54/// P20.7 — 2-D Chordal Axis Transform over CDT interior triangles
55/// (termination / sleeve / junction classification + spur pruning).
56pub mod chordal_axis_2d;
57/// P8.4 — CkNN density → graph Laplacian → Laplace-Beltrami.
58pub mod cknn_laplacian;
59mod combinatorial_map;
60mod connectivity;
61pub mod constrained_delaunay;
62/// Convex decomposition (Hertel-Mehlhorn + triangulation-only).
63pub mod convex_decomposition;
64/// P12.3 — Exact 3D mesh co-refinement (split meshes along intersection curves).
65pub mod corefine_3d;
66mod corpus_4;
67/// P12.9 — CSG/arrangement .10d sections and repair operations.
68pub mod csg_section;
69mod csr_adjacency;
70pub mod curve_skeleton;
71/// P11.3 — DCEL subdivision, overlay, and full polygon-set boolean output
72/// (union/intersection/difference/xor with boundary cycles + holes; Euler and
73/// area identities).
74pub mod dcel_overlay;
75pub mod ddg_operators;
76mod decimate_3;
77pub mod decimate_3_semantic;
78pub mod delaunay_2;
79mod delaunay_3;
80/// P13.2 — Delaunay refinement for PSLGs with Steiner points (Ruppert).
81pub mod delaunay_refine;
82mod determinism_corpus;
83pub mod deterministic_geometry;
84pub mod differential_growth;
85mod distance;
86pub mod dual_quaternion_skinning;
87/// P12.2 — Exact 2D arrangement with exact-construction intersection points.
88pub mod exact_arrangement;
89mod exact_construct_3;
90mod exact_kernel;
91mod expansion;
92mod features;
93pub mod fem_certificate;
94/// P10.6 — Independent oracle and fixture licence registry (origin, licence,
95/// checksum, permitted use; rejects copyleft; textbook = invariant reference
96/// only, no copied material).
97pub mod fixture_registry;
98pub mod geometry_integration;
99/// P10.5 — Geometry workspace: caller-owned arenas with byte budgets,
100/// deterministic partition/reduction order, and cancellation.
101pub mod geometry_workspace;
102pub mod gpu;
103pub mod gpu_3d;
104/// P8.7 — GPU acceleration + CPU oracle for P8 batches.
105pub mod gpu_oracle;
106/// P11.9 — Half-plane intersection (sort-and-intersect + deque) and 2-D
107/// randomized incremental linear programming (Seidel) with seeded determinism
108/// and feasible/infeasible/unbounded certificates.
109pub mod half_plane_lp;
110/// P11.14 — Ham-sandwich cuts, centrepoints, and directional-width coresets.
111pub mod ham_sandwich;
112pub mod heat_geodesics;
113mod hull;
114mod hull_3;
115mod incircle;
116mod insphere;
117mod isosurface;
118mod kd_tree;
119mod kernel;
120/// P11.7 — Kirkpatrick hierarchy for guaranteed O(log n) point location
121/// in triangulated planar subdivisions.
122pub mod kirkpatrick;
123mod laplacian_3d;
124pub mod math_geometry;
125pub mod medial_axis_3d;
126/// Standalone caller-buffered triangle mesh / plane section segments.
127pub mod mesh_plane_slice;
128/// P13.1 — Mesh quality metrics (tri/tet min/max angle, radius-edge, aspect,
129/// scaled Jacobian, dihedral) and isotropic size / anisotropic metric fields.
130pub mod mesh_quality;
131mod minkowski_2;
132pub mod mixed_cell_topology;
133pub mod motion_planning;
134/// P12.7 — Arbitrary n-ary boolean-expression evaluator.
135pub mod nary_boolean;
136/// P12.1 — N-ary CSG operations on 2D polygons and 2D mesh co-refinement.
137pub mod nary_csg;
138/// P8.5 — Natural-neighbour interpolation (Sibson / Laplace weights).
139pub mod natural_neighbour;
140/// P8.6 — Nearest-neighbour inference query (radius + kNN).
141pub mod nn_query;
142/// P20.3 — Non-uniform B-spline/NURBS evaluation, chord-length
143/// parameterization, least-squares curve fitting, curvature-adaptive
144/// discretization.
145pub mod nurbs_fitting;
146mod orient3d;
147pub mod parametric_cad;
148pub mod pbd_softbody;
149/// P8.2 — Persistent homology: deterministic reduction → barcode.
150pub mod persistence;
151/// P20.8 — Point-cloud differential geometry: Welzl miniball, PCA bounding
152/// primitives, Weiszfeld median, Monge jet curvatures, MST normal orientation.
153pub mod point_cloud_diff_geom;
154/// P11.6 — Point location in planar subdivisions (walking + slab decomposition).
155pub mod point_location;
156mod point_set_3d;
157pub mod poisson_disk;
158pub mod polygon_soup;
159/// P11.4 — Simple-polygon, polygon-with-holes, and PSLG validation.
160pub mod polygon_validation;
161pub mod power_diagram;
162mod primitives;
163/// P13.4 — Quadtree/octree balanced meshing (size-field refinement, 2:1
164/// balance, conforming 2-D triangulation with hanging-node templates, 3-D
165/// hex/tet extraction).
166pub mod quad_octree_mesh;
167pub mod query_frontend;
168/// P11.12 — Simplex/halfspace range reporting with partition and cutting trees.
169pub mod range_reporting;
170/// P11.10 — Interval, segment, hereditary segment, priority-search and range
171/// trees.
172pub mod range_trees;
173mod recon_section;
174mod reconstruct_3d;
175mod remesh_3;
176pub mod screened_poisson;
177pub mod sdf_ops;
178/// P11.1 — Robust segment/line/ray primitives and exact intersections.
179pub mod segment_intersection_2;
180/// P12.8 — Coplanar-region simplification and topology-preserving snap rounding.
181pub mod simplify_snap;
182/// P12.2 — Simulation of Simplicity for deterministic degeneracy resolution.
183pub mod sos;
184/// P20.5 — Seeded 3-D space colonization & graph colonization (Runions 2007)
185/// with perception cones, kill radii, whorls, and latent buds.
186pub mod space_colonization;
187pub mod sparse_voxel_octree;
188mod spatial_order;
189/// P8.3 — Statistical manifold: Fisher metric + KL as Bregman divergence.
190pub mod statistical_manifold;
191mod surface_mesh;
192mod surface_mesh_processing;
193/// P20.1 — Rotation-minimizing (Bishop / double-reflection) sweep frames,
194/// generalized profile extrusion with per-station scale+twist, swung surfaces,
195/// frustum/cone primitives, taper and IFS deformation.
196pub mod sweep_extrusion;
197/// Optional caller-buffered capped sweep derivative with hard cap normals.
198pub mod hard_cap_sweep;
199mod tda;
200/// P13.7 — Tetrahedral quality improvement and sliver handling
201/// (flip / smooth / insert / exude passes; domain + orientation preserved;
202/// monotonic quality improvement).
203pub mod tet_quality_improve;
204mod tool;
205mod topology;
206/// P11.6 gap — Trapezoidal map with randomized incremental point location
207/// (search DAG, seeded determinism, O(log n) expected query).
208pub mod trapezoidal_map;
209/// P20.6 — Point-cloud tree skeletonization: geodesic root-distance quotient
210/// bins (Xu 2007), Livny branch smoothing, pipe-model radii, anisotropic
211/// contraction (Tagliasacchi 2009).
212pub mod tree_skeleton_3d;
213mod tri_tri_3;
214/// P11.5 — Monotone partition, linear monotone triangulation, ear fallback.
215pub mod triangulation_2;
216/// P13.3 — Optimal fixed-vertex triangulation objectives (edge-flip hill-climbing).
217pub mod triangulation_opt;
218/// P20.4 — Stack-bounded 3-D L-system turtle with gravitropism/phototropism
219/// bending and generalized-cylinder / polygon meshing.
220pub mod turtle_3d;
221pub mod uv_atlas;
222mod voronoi_2;
223/// P11.11 — Segment-site, farthest-site and higher-order Voronoi diagrams.
224pub mod voronoi_variants;
225/// P8.1 — VR / alpha filtration over Tensor10D point cloud.
226pub mod vr_filtration;
227pub mod wheel_panel;
228
229#[cfg(test)]
230mod exact_test_helper;
231
232pub use advancing_front::{
233    advancing_front_tetrahedralise_3d, advancing_front_triangulate_2d, FrontError, FrontOptions2d,
234    FrontOptions3d, FrontResult2d, FrontResult3d,
235};
236pub use alpha_shape::{
237    alpha_shape_2d, alpha_shape_3d, alpha_shape_hash, max_triangles, AlphaEdge, AlphaShapeError,
238    AlphaShapeReport, EdgeClass, TriangleClass,
239};
240pub use anisotropic_remesh::{
241    anisotropic_remesh, required_anisotropic_output_capacity, AnisotropicRemeshError,
242    AnisotropicRemeshOptions, AnisotropicRemeshReport, FeatureEdge,
243};
244pub use arrangement_3d::{
245    build_arrangement_3d, radial_sort_around_edge, validate_arrangement, Arrangement3D,
246    ArrangementError as Arrangement3DError, EdgeKey, Region, Shell,
247};
248pub use arrangements::{dual_point_to_line, dual_round_trip, Line2};
249pub use benchmark_corpus::{
250    compute_p10_corpus_baseline_hash, run_p10_corpus, CorpusReport, CORPUS_VERSION,
251};
252pub use bentley_ottmann::{
253    bentley_ottmann_intersections, brute_force_intersections, brute_force_red_blue_intersections,
254    red_blue_intersections, SweepSegment,
255};
256pub use boolean_2::{
257    boolean_difference_area, boolean_intersection_area, boolean_union_area, point_in_or_on_polygon,
258    point_in_polygon, polygon_area, polygon_signed_area, verify_area_conservation, BooleanError,
259    BooleanOp,
260};
261pub use boolean_3::{
262    boolean_3, boolean_3_exact, boolean_3_with_kernel, required_triangles_3, required_vertices_3,
263    Boolean3Error, Boolean3Op,
264};
265pub use botanical_hulls::{
266    asymmetric_hull_capacity, asymmetric_hull_into, extruded_hull_into, fit_asymmetric_hull,
267    paraboloid_into, AsymmetricHullParams, BotanicalHullError,
268};
269pub use box_join::{box_join_brute_force, box_join_bvh, BoxJoinError, BoxPair};
270pub use bvh::{
271    build_bvh_recursive, query_closest, query_overlap, BvhError, BvhNode, BVH_NODE_SIZE,
272    MAX_BVH_DEPTH,
273};
274pub use calipers_enclosing_disk::{
275    diameter_and_width, rotating_calipers, smallest_enclosing_disk, AntipodalPair, CalipersError,
276    CalipersResult, Disk, EnclosingDisk,
277};
278pub use canopy_radiation::{
279    integrate_canopy_radiation, organ_surface_areas, periodize_id_depth_buffer,
280    rasterize_orthographic_id_buffer, soc_sky_dome_16, solar_track_sources, CanopyRadiationError,
281    CanopyRadiationReceipt, DirectionalSource, NO_ORGAN_ID,
282};
283pub use cdt_retriangulation::{cdt_retriangulate_facet, CdtError};
284pub use chordal_axis_2d::{
285    chordal_axis_transform_2d, is_acute_triangle_2d, prune_chordal_axis_spurs,
286    pseudo_circumcenter_2d, CatTriangleKind, ChordalAxisError, ChordalSegment,
287};
288pub use combinatorial_map::{
289    darts_to_half_edges, half_edges_to_darts, validate_combinatorial_map, CMapError, Dart,
290};
291pub use connectivity::{
292    compute_connectivity, count_boundary_loops, euler_characteristic, genus_from_euler,
293    label_components, ConnectivityError, ConnectivitySummary,
294};
295pub use constrained_delaunay::{
296    conforming_delaunay_2, constraint_edge_present, ConstrainedDelaunayError,
297};
298pub use convex_decomposition::{
299    convex_decomposition_hm, convex_decomposition_triangulation, is_convex_polygon,
300    verify_convex_decomposition,
301};
302pub use corefine_3d::{
303    corefine_3d, count_shared_vertices, verify_refinement_preserves_triangles,
304    CorefinementResult3D, Mesh3D as Mesh3DCorefine,
305};
306pub use corpus_4::{
307    corpus_hash, run_delaunay_corpus, run_full_corpus, run_incircle_corpus, run_orientation_corpus,
308};
309pub use csg_section::{
310    decode_csg_section, deserialize_expr, encode_csg_section, repair_mesh, serialize_expr,
311    CsgSection, CsgSectionError, DecodedCsgSection, RepairReport as MeshRepairReport, CSG_MAGIC,
312    CSG_TYPE_ARRANGEMENT, CSG_TYPE_EXPRESSION, CSG_TYPE_REPAIR_REPORT, CSG_VERSION,
313};
314pub use csr_adjacency::{
315    build_face_adjacency_csr, build_vertex_adjacency_csr, required_face_neighbours,
316    required_face_offsets, required_vertex_neighbours, required_vertex_offsets, CsrError,
317    CsrHeader, CsrSummary,
318};
319pub use curve_skeleton::{contract_to_skeleton, extract_skeleton_graph, CurveSkeletonError};
320pub use ddg_operators::{
321    boundary_of_boundary_is_zero, boundary_of_simplex, cotangent_laplacian, curvature_angle_defect,
322    encode_ddg_operator_section, face_vector_areas, geodesic_distances_dijkstra,
323    harmonic_parameterize_disk, heat_step, hodge_decomposition_summary, mean_curvature_flow_step,
324    parallel_transport_angle, solve_poisson_jacobi, surface_area_gradient, vertex_normals,
325    ChainTerm, CurvatureSample, DdgError, DdgReport, DdgSectionHeader, HodgeSummary, SparseEntry,
326    DDG_SECTION_MAGIC, DDG_SECTION_VERSION,
327};
328pub use decimate_3::{
329    decimate_qem, decimate_qem_with_kernel, required_triangles, required_vertices, DecimateError,
330    DecimateOptions, DecimateReport,
331};
332pub use decimate_3_semantic::{
333    compute_extended_collapse_cost, decimate_semantic_qem_3, decimate_semantic_qem_3_with_kernel,
334    interpolate_semantic_attributes, SemanticDecimateWeights, SemanticVertexAttributes,
335};
336pub use delaunay_2::{
337    delaunay_triangulation_2, triangulation_hash, verify_delaunay, DelaunayError,
338};
339pub use delaunay_3::{
340    delaunay_tetrahedralization_3, delaunay_tetrahedralization_3_with_kernel,
341    required_tetrahedra_3, tetrahedralization_hash, verify_delaunay_3,
342    verify_delaunay_3_with_kernel, Delaunay3Error,
343};
344pub use delaunay_refine::{
345    delaunay_refine_2, verify_refined_mesh, RefineError, RefineOptions,
346    RUPPERT_TERMINATION_BOUND_DEG,
347};
348pub use determinism_corpus::compute_corpus_hash;
349pub use deterministic_geometry::{
350    all_nearest_neighbours, beta_skeleton_graph, bichromatic_nearest_pair,
351    build_batch_dynamic_kd_tree, conflict_graph_pairs, deterministic_pack_u32,
352    deterministic_reduce_f64, deterministic_scan_u64, dynamic_kd_compact, dynamic_kd_delete,
353    dynamic_kd_insert, dynamic_kd_nearest, euclidean_mst, external_memory_nearest_tiles,
354    gabriel_graph, generate_spatial_points, greedy_spanner, knn_graph, list_rank_successors,
355    nearest_pair, reproducible_benchmark_report, reservation_batch_hull_2d,
356    seeded_incremental_order, smallest_enclosing_ball, tree_contract_roots, well_separated_pairs,
357    BatchDynamicKdTree, BenchmarkReport, ConflictEdge, DeterministicGeometryError, DynamicKdRecord,
358    EnclosingBall, NearestPair, SpatialGeneratorKind, WeightedEdge, WellSeparatedPair,
359};
360pub use differential_growth::{
361    differential_growth_step, edge_rest_lengths, split_stretched_edges, DifferentialGrowthError,
362};
363pub use distance::{
364    distance_2d, distance_3d, distance_sq_2d, distance_sq_3d, point_line_distance_sq_2d,
365    point_segment_distance_2d, point_segment_distance_sq_2d, point_segment_distance_sq_3d,
366    point_triangle_distance_sq_3d, ray_triangle_intersect_3d, segment_segment_intersect_2d, Aabb,
367    RayTriangleHit, RayTriangleResult, SegmentIntersection2d,
368};
369pub use dual_quaternion_skinning::{
370    dqs_blend, dqs_skin_vertex, DualQuaternion, DualQuaternionError,
371};
372pub use exact_arrangement::{
373    build_exact_arrangement, max_coordinate_error, verify_euler, verify_general_position_counts,
374    zone_traversal, ArrangementEdge, ArrangementError, ArrangementVertex, ExactArrangement,
375    ExactLine2, ZoneTraversal,
376};
377pub use exact_construct_3::checked as checked_exact_construct_3;
378pub use exact_construct_3::{
379    construct_segment_plane_intersection_3, construct_segment_triangle_intersection_3,
380    orient_3d_exact_3, segment_plane_parameter_sign, Exact3Error, ExactPoint3, ParameterSpan,
381    TriangleContainment,
382};
383pub use exact_kernel::{
384    construct_segment_intersection, orientation_2_exact, ExactConstructionKernel, ExactPoint2,
385};
386pub use expansion::{
387    compress_expansion, expansion_sum, fast_two_sum, grow_expansion, negate_expansion,
388    scalar_product, scalar_sum, scale_expansion, sign_of_expansion, two_diff, two_product, two_sum,
389    ExpansionError, Sign, MAX_EXPANSION_INCIRCLE, MAX_EXPANSION_INSPHERE, MAX_EXPANSION_ORIENT2,
390    MAX_EXPANSION_ORIENT3,
391};
392pub use features::{
393    encode_topology_features_10d, encode_topology_features_10d_with_connectivity, FeatureError,
394};
395pub use fem_certificate::{
396    build_fem_certificate, decode_fem_certificate, encode_fem_certificate, BoundaryMarker,
397    FemCertificate, FemCertificateError, MaterialRegion, FEM_CERT_ENCODED_LEN, FEM_CERT_MAGIC,
398    FEM_CERT_VERSION,
399};
400pub use fixture_registry::{
401    validate_records, FixtureOrigin, FixtureRecord, FixtureRegistry, FixtureRegistryError,
402    LicenceKind, UsePermission, SEED_FIXTURES,
403};
404pub use geometry_integration::{
405    build_section_header, cancel_stream_at, closeout_summary, encode_section_header,
406    plan_stream_chunks, renderer_descriptor, schema_descriptor, validate_conformance,
407    validate_conformance_matrix, validate_operation_descriptor, GeometryBackendKind,
408    GeometryCloseoutRecord, GeometryConformanceMatrixRow, GeometryConformanceRecord,
409    GeometryEvidenceLevel, GeometryOperationDescriptor, GeometryRenderableDescriptor,
410    GeometrySchemaDescriptor, GeometrySchemaKind, GeometrySectionHeader, GeometryStreamChunk,
411    IntegrationError, GEOMETRY_SECTION_MAGIC,
412};
413pub use geometry_workspace::{
414    deterministic_partition, deterministic_reduce, Cancellation, GeometryWorkspace, WorkspaceError,
415    DEFAULT_WORKSPACE_BUDGET,
416};
417pub use gpu::{
418    emit_geometry_wgsl, evaluate_orientation_batch_f32, GeometryGpuError, GeometryGpuKernel,
419    GeometryGpuSchedule, GPU_ORIENTATION_UNCERTAIN,
420};
421pub use gpu::{
422    evaluate_aabb_overlap_batch_f32, gpu_candidate_box_join, merge_aabb_overlap_results,
423    GPU_OVERLAP_NO, GPU_OVERLAP_UNCERTAIN, GPU_OVERLAP_YES,
424};
425pub use gpu_3d::{
426    evaluate_point_in_tetra_batch_f32, gpu_filter_point_in_tetra_f32, point_in_tetra_wgsl,
427    Gpu3dError, POINT_IN_TETRA_BOUNDARY, POINT_IN_TETRA_INSIDE, POINT_IN_TETRA_OUTSIDE,
428    POINT_IN_TETRA_STRIDE, POINT_IN_TETRA_UNCERTAIN,
429};
430pub use half_plane_lp::{
431    half_plane_intersection, linear_program_2d, HalfPlane, HalfPlaneIntersection, LpResult2d,
432};
433pub use ham_sandwich::{
434    centrepoint, directional_width, ham_sandwich_cut, tukey_depth, width, width_coreset,
435    Centrepoint, HamSandwichCut, WidthCoreset,
436};
437pub use heat_geodesics::{
438    heat_geodesic_distances, heat_vs_dijkstra_max_deviation, HeatGeodesicError,
439};
440pub use hull::{
441    convex_hull_2, convex_hull_indices_2, convex_hull_indices_2_with_kernel, convex_hull_tensor_xy,
442    convex_hull_tensor_xy_with_kernel, is_ccw_strongly_convex_2,
443    is_ccw_strongly_convex_2_with_kernel, HullError,
444};
445pub use hull_3::{convex_hull_3, convex_hull_3_with_kernel, required_hull_3_faces, Hull3Error};
446pub use incircle::incircle;
447pub use insphere::insphere;
448pub use isosurface::{isosurface_hash, marching_cubes, IsosurfaceError};
449pub use kd_tree::{
450    build_kd_tree_3d, query_nearest_3d, query_radius_3d, KdNode, KdTreeError, KD_NODE_SIZE,
451    MAX_KD_DEPTH,
452};
453pub use kernel::{
454    ConstructionKernel, ExactPoint2 as KernelExactPoint2, FilteredF64Kernel, GeometryKernel,
455    Unsupported,
456};
457pub use kirkpatrick::{KirkpatrickError, KirkpatrickHierarchy};
458pub use laplacian_3d::{
459    cknn_laplacian_3d, cknn_laplacian_normalised_3d, verify_laplacian_properties, LaplacianError,
460};
461pub use math_geometry::{
462    barycentric_tetra, best_translation_registration, caratheodory_reduce_3d,
463    convexity_certificate_polyline, cross_ratio_1d, curve_differential, frame_to_world,
464    householder_reflect, hyperplane_eval, point_from_projective, project_points_to_plane,
465    projective_from_point, quaternion_normalize, quaternion_slerp, quaternion_to_matrix,
466    schur_complement_2x2, separating_plane_aabb, so3_exp, so3_log, solve_diagonal_quadratic,
467    surface_patch_differential, world_to_frame, AffineFrame3, ConvexityCertificate,
468    CurveDifferential, HomogeneousPoint3, Hyperplane3, MathGeometryError, QuadraticSolution,
469    Quaternion, SeparatingPlane, SurfaceDifferential,
470};
471pub use medial_axis_3d::{extract_medial_axis_3d, tet_circumcenter, MedialAxisError, MedialSample};
472pub use mesh_plane_slice::{slice_mesh_with_plane, MeshPlaneSliceError};
473pub use mesh_quality::{
474    check_field_conformance_tet, check_field_conformance_tri, tet_mesh_quality_slice, tet_quality,
475    tet_quality_points, tri_mesh_quality_2d, tri_quality, tri_quality_points, tri_signed_area_2d,
476    AnisotropyField, FieldConformance, MeshQualityError, MetricTensor, SizeField,
477    TetMeshQualityStats, TetQuality, TriMeshQualityStats, TriQuality,
478};
479pub use minkowski_2::{
480    minkowski_difference_2, minkowski_sum_2, minkowski_sum_brute_force, minkowski_sum_convex,
481    minkowski_sum_non_convex, MinkowskiError,
482};
483pub use mixed_cell_topology::{
484    extract_boundary_faces, hex_to_tetrahedra, quad_to_triangles, tets_to_mixed,
485    triangles_to_mixed, validate_mixed_cells, BoundaryFace, MixedCell, MixedTopologyError,
486    MixedTopologyReport, CELL_KIND_HEX, CELL_KIND_QUAD, CELL_KIND_TETRA, CELL_KIND_TRIANGLE,
487};
488pub use motion_planning::{
489    belief_update_2d, configuration_obstacle_translate, continuous_segment_collision,
490    coverage_lawnmower, feedback_vector, forward_kinematics_2d, interpolate_pose2, jacobian_2d,
491    kinodynamic_propagate, multi_robot_conflict_free, normalize_pose, normalize_pose3,
492    pursuit_step, rrt_plan, seeded_roadmap, segment_collision_free, time_parameterize_path,
493    visibility_graph_path, BeliefState2, CollisionReport, Control2, Joint2, PlannedPath,
494    PlanningError, PolygonObstacle, Pose2, Pose3, TimedPose2,
495};
496pub use nary_boolean::{
497    evaluate_expr, nary_boolean, BoolExpr, MeshInput, NaryBoolError, RegionMask, MAX_OPERANDS,
498};
499pub use nary_csg::{
500    corefine_2d, nary_csg, verify_pairwise_inclusion_exclusion, CorefinementResult2D, Mesh2D,
501    NaryCsgError, NaryCsgResult, NaryOp, PolygonWithHoles as NaryPolygonWithHoles,
502};
503pub use nurbs_fitting::{
504    basis_functions, bspline_eval_knots, chord_length_parameterize,
505    discretize_bspline_by_curvature, find_knot_span, fit_bspline_least_squares, nurbs_eval_knots,
506    nurbs_patch_eval, NurbsFitError, MAX_SPLINE_DEGREE,
507};
508pub use orient3d::orient_3d;
509pub use parametric_cad::{
510    bezier_derivative_eval, bezier_eval, bspline_eval, bspline_insert_uniform_knot,
511    budgeted_evolution_optimize, classify_trim_uv, continuity_between_curves, helical_lattice,
512    latin_hypercube_samples, loft_profiles, nurbs_eval, offset_polyline, rbf_surrogate_predict,
513    revolve_profile, sdf_compose, sdf_eval, shape_distance, tensor_surface_eval,
514    tensor_surface_sample, tube_along_polyline, validate_parameters,
515    vascular_lattice_adapter_notice, CadError, ContinuityReport, DomainAdapterNotice,
516    NurbsControlPoint, OptimizationReport, ParameterConstraint, SdfOp, SdfPrimitive, ShapeDistance,
517    SurfaceSample, SurrogatePrediction,
518};
519pub use pbd_softbody::{pbd_step, PbdConstraint, PbdError, PbdReceipt};
520pub use point_cloud_diff_geom::{
521    monge_jet_principal_curvatures_3d, orient_normals_riemannian_mst, pca_bounding_primitives_3d,
522    smallest_enclosing_sphere_3d, weiszfeld_geometric_median_3d, EnclosingSphere3d,
523    PcaBoundingPrimitives3d, PointCloudGeomError, PointCurvatureInfo,
524};
525pub use point_location::{
526    build_slab_map, locate_point, point_in_triangle, point_strictly_in_triangle,
527    triangulation_to_subdivision, walk_locate, LocateResult, PointLocationError, SlabMap,
528    SubdivisionEdge,
529};
530pub use point_set_3d::{
531    average_spacing_3d, cknn_graph_3d, cknn_hash, knn_all_brute_force_3d, knn_brute_force_3d,
532    knn_hash, knn_search_3d, local_density_3d, mean_knn_distance_3d, remove_outliers_3d, CknnEdge,
533    KnnEntry, PointSetError, MAX_K,
534};
535pub use poisson_disk::{poisson_disk_2d, poisson_disk_3d, PoissonDiskError};
536pub use polygon_soup::{
537    build_face_adjacency, count_flipped, filter_degenerate_faces, merge_vertices,
538    orient_consistently, repair_polygon_soup, FaceAdjacencyEntry, RepairReport, SoupError,
539};
540pub use polygon_validation::{
541    canonicalize_polygon_with_holes, canonicalize_simple_polygon, repair_for,
542    validate_polygon_with_holes, validate_pslg, validate_simple_polygon, PolygonWithHoles,
543    PslgEdge, RepairSuggestion, ValidationIssue, ValidationReport,
544};
545pub use power_diagram::{
546    power_cell_vertex_2d, power_test_2d, power_test_2d_sign, regular_triangulation_2d,
547    PowerDiagramError, WeightedSite2d,
548};
549pub use primitives::{orientation_2, orientation_2_tensor_xy, Orientation, Point2, Point3};
550pub use quad_octree_mesh::{
551    balance_octtree_2to1, balance_quadtree_2to1, build_octtree, build_quadtree, const_size_fn_3d,
552    octtree_to_hexahedra, octtree_to_tetrahedra, quadtree_to_triangles, size_field_2d_fn,
553    size_target_refiner_2d, size_target_refiner_3d, OctLeaf, OctMeshError, OctMeshOptions, OctNode,
554    OctTree, QuadLeaf, QuadMeshError, QuadMeshOptions, QuadNode, QuadTree, OCT_MAX_LEVEL,
555    QUAD_MAX_LEVEL,
556};
557pub use query_frontend::{QueryFrontendError, QueryStats, SpatialIndexQuery};
558pub use range_reporting::{CuttingTree, Halfspace2, KdTree2, PartitionTree};
559pub use recon_section::{
560    crc32c, decode_recon_section, encode_recon_section, recon_hash, DecodedRecon,
561    ReconSectionError, RECON_HEADER_SIZE, RECON_MAGIC, RECON_TYPE_ALPHA_SHAPE_2D,
562    RECON_TYPE_ALPHA_SHAPE_3D, RECON_TYPE_ISOSURFACE, RECON_TYPE_LAPLACIAN, RECON_TYPE_PERSISTENCE,
563    RECON_VERSION,
564};
565pub use reconstruct_3d::{poisson_reconstruct_3d, ReconstructionError};
566pub use remesh_3::{
567    isotropic_remesh, isotropic_remesh_with_kernel, required_output_capacity, RemeshError,
568    RemeshOptions, RemeshReport,
569};
570pub use screened_poisson::{
571    required_screened_poisson_capacity, screened_poisson_reconstruct_3d, ScreenedPoissonError,
572    ScreenedPoissonOptions, ScreenedPoissonReport,
573};
574pub use sdf_ops::{
575    sdf_capsule, sdf_compose_smooth, sdf_metaballs, sdf_rounded_box, sdf_smooth_intersect,
576    sdf_smooth_subtract, sdf_smooth_union, sdf_sphere, SdfOpsError,
577};
578pub use segment_intersection_2::{
579    classify_and_construct, classify_segment_intersection_2, line_segment_intersection_2,
580    ray_segment_intersection_2, SegmentIntersectionClass, SegmentIntersectionResult, TJunctionSide,
581};
582pub use simplify_snap::{
583    simplify_coplanar_regions, snap_round_3d, SimplifyError, SimplifyOptions, SimplifyResult,
584};
585pub use sos::orient_3d_sos;
586pub use space_colonization::{
587    lateral_whorl_directions, space_colonization_3d, ColonizationError, SpaceColonizationConfig,
588    SpaceColonizationReceipt, ROOT_PARENT,
589};
590pub use sparse_voxel_octree::{Svo, SvoError, SvoNode, SvoRayHit, SVO_EMPTY};
591pub use spatial_order::{
592    hilbert_encode_2d, morton_decode_2d, morton_encode_2d, morton_encode_3d, sort_by_hilbert_2d,
593    sort_by_morton_2d, sort_by_morton_3d, SpatialOrderError, SpatialOrderHeader,
594};
595pub use statistical_manifold::{
596    fisher_distance, fisher_inner_product, kl_bregman_form, kl_divergence, neg_entropy,
597    neg_entropy_grad, simplex_project, simplex_project_idempotent, validate_probability,
598    StatManifoldError,
599};
600pub use surface_mesh::{
601    build_surface_mesh_maps, BoundaryLoopWalker, FaceLoopCirculator, OneRingCirculator,
602    SurfaceMeshError, SurfaceMeshView,
603};
604pub use surface_mesh_processing::{signed_volume, surface_area, MeshMeasureError};
605pub use sweep_extrusion::{
606    compute_bishop_frames, deform_taper_in_place, expand_ifs_points, extrude_profile_along_path,
607    frustum_into, swung_surface, ExtrusionStation, SweepError,
608};
609pub use tda::{
610    alpha_filtration_2d, compute_persistence, persistence_hash, PersistencePair, Simplex, TdaError,
611};
612pub use tet_quality_improve::{
613    improve_tet_mesh, verify_improvement, TetImproveError, TetImproveObjective, TetImproveOptions,
614    TetImproveResult,
615};
616pub use tool::{execute_geometry_tool_json, GeometryToolError};
617pub use topology::{
618    build_triangle_half_edges, build_triangle_half_edges_budgeted, BudgetedTopologyError, required_edge_slots, EdgeSlot, HalfEdge, TopologyError,
619    TopologySummary, INVALID_INDEX,
620};
621pub use trapezoidal_map::{TmSegment, Trapezoid, TrapezoidalMap, TrapezoidalMapError};
622pub use tree_skeleton_3d::{
623    carried_subtree_length, contract_points_anisotropic, pipe_model_radii,
624    skeleton_from_root_distance_bins, smooth_skeleton_positions, TreeSkeletonError,
625};
626pub use tri_tri_3::{
627    required_self_intersection_pairs, self_intersecting_pairs, self_intersecting_pairs_with_kernel,
628    tri_tri_intersect_3, tri_tri_intersect_3_exact, tri_tri_intersect_3_with_kernel,
629    ExactTriTriSegment, TriPair, TriTriError, TriTriSegment,
630};
631pub use triangulation_2::{
632    triangulate_ear_clipping, triangulate_monotone, triangulate_polygon, verify_triangulation,
633    Triangle,
634};
635pub use triangulation_opt::{
636    evaluate_objective, optimise_and_evaluate, optimise_triangulation, TriObjective,
637    TriangulationOptError,
638};
639pub use turtle_3d::{
640    execute_turtle_3d, TurtleCmd, TurtleError, TurtleMeshReceipt, TurtleState, MAX_POLYGON_VERTS,
641    MAX_RING_SLICES, MAX_TURTLE_STACK,
642};
643pub use voronoi_2::{
644    circumcenter, nearest_site_brute_force, nearest_site_via_delaunay, verify_voronoi_vertices,
645    voronoi_diagram_2, voronoi_hash, VoronoiEdge, VoronoiError, VoronoiVertex,
646};
647pub use voronoi_variants::{
648    dist_point_to_segment, dist_sq, dist_sq_point_to_segment, FarthestEdge, FarthestVertex,
649    FarthestVoronoi,
650};
651
652/// Versioned native geometry ABI. Increment only when public POD layouts or
653/// caller-buffer contracts change.
654pub const GEOMETRY_ABI_VERSION: u32 = 1;
655
656pub mod indexed_tetra_surface;
657
658pub mod surface_topology_qualification;
659pub use connectivity::{label_components_triangle_ordered, triangle_ordered_component_work, OrderedConnectivityError};
660
661pub mod tapered_branch_field;
662pub mod branch_graph_surface;
663pub use sdf_ops::sdf_smooth_union_stable;
664
665/// Bounded geometric collar projection with fixed authored boundary bands.
666pub mod smooth_junction;