Long-run spikes: findings
The roadmap's long-run section (§6) admitted work whose shape was unknown until an investigation wrote it down: findings before code. This page is that write-up for its three groups — scale, NURBS, and skin to CAD — as of October 2026. The new-capabilities section (§7) admitted one more spike, surface booleans, written up at the end in November 2026. Each finding ended in a decision, the roadmap was narrowed to match, and the section closed that month once the last of its items landed; what was decided against is in its non-goals.
Scale at 10M cells
The question. Memory-mapped reads halve the peak of a large read, and the XDMF series appender and Python's chunked write_dataset write a series or a dataset without holding it, but nothing writes one mesh larger than memory and no operation streams. The roadmap asked for the operations harness to be run at --tier XL (a Kuhn cube of 10,368,000 tetrahedra on 1,771,561 points) before deciding whether streaming writes (6.1.1) or out-of-core operations (6.1.2) matter.
The harness itself did not fit. meshioplusplus_bench_ops --tier XL was killed by the out-of-memory killer at 13.6 GB on a 15 GiB machine, during setup, before its first row: it built every derived input of every row up front (the jittered, doubled, quadratic, green-refined, narrowed and ragged copies of the cube) and held them all. The harness now builds each derived input on first use, so a run selected with --ops holds only what its rows read; the change is digest-neutral (every row's digest at tier S is identical before and after). That is a finding about the harness, not the library — but it is the first sign of what a 10M-cell workload costs when several copies of a mesh coexist.
Operations. Each row was then run alone, SEQ backend, one thread, one timed run after the warmup, on a 4-core machine with 15 GiB and no swap; the peak is the process's resident high-water mark. Building the input cube and its skin alone peaks at 6.4 GB (the generator's own temporaries; the cube itself is 0.4 GB), so a peak equal to that means the operation stayed under it.
Of 76 rows, 70 completed, 54 of them in under 30 seconds on one thread; the slowest that finished were optimize_volume (823 s), pipeline_smooth_surface (345 s), smooth_volume (317 s) and interpolate_cells (268 s). The heaviest that fit added about 5 GB over the setup peak (feature_edges on the volume, agglomerate, the skin-extracting renders): roughly a dozen times the 0.4 GB cube. Six did not finish (the table below is that first run; two of the three kills have since been fixed, and the third, undo_green, completes after what landed). Three were killed by the out-of-memory killer at 13.3 GB, and all three read a copy of the cube that the harness builds for them: reorder_ragged and simplexify_ragged the cube as 10M polyhedra, undo_green a green-refined cube with its refinement hierarchy recorded. simplexify_ragged was rerun alone on an idle machine and died the same way. Three exceeded the 15-minute cap on a warmup plus one timed run (so more than about 7.5 minutes each) without using memory beyond the setup peak: remesh_volume, and the two rows that sample the distance from every volume point to the skin, sample_distance and distance_to_surface. Times are one thread on the SEQ backend; the four-thread OpenMP times of the render rows in the terminal-rendering page are about six times shorter.
| Row | Time (s) | Peak (GB) | |
|---|---|---|---|
extract_surface | 29.38 | 6.3 | |
extract_skin | 28.39 | 6.3 | |
smooth | 0.98 | 6.3 | |
smooth_volume | 317.41 | 7.3 | +1.1 GB over setup |
pipeline_smooth_surface | 344.85 | 8.1 | +1.8 GB over setup |
refine | 16.40 | 6.3 | |
elevate | 8.33 | 6.3 | |
merge | 9.07 | 6.3 | |
clean | 11.35 | 6.3 | |
clean_weld | 25.93 | 6.3 | |
compute_sdf | 21.73 | 6.3 | |
decimate | 24.04 | 6.3 | |
partition | 13.24 | 6.3 | |
reorder | 6.77 | 6.3 | |
reorder_hilbert | 1.83 | 6.3 | |
linearize_ragged | 3.10 | 6.3 | |
subdivide_ragged | 36.96 | 10.0 | +3.7 GB over setup |
quality | 9.27 | 6.3 | |
quality_ragged | 36.37 | 6.3 | |
data_average | 1.03 | 6.3 | |
data_average_ragged | 6.07 | 6.4 | |
interpolate_cells | 268.24 | 7.8 | +1.5 GB over setup |
partition_ragged | 33.87 | 6.7 | +0.4 GB over setup |
feature_edges_ragged | 37.52 | 9.9 | +3.6 GB over setup |
read_ragged_ensight | 3.75 | 6.3 | |
read_ragged_tecplot | 30.67 | 10.9 | +4.6 GB over setup |
read_stl | 0.36 | 6.3 | |
read_obj | 0.13 | 6.3 | |
write_obj | 0.32 | 6.3 | |
read_tetgen | 5.69 | 6.3 | |
read_triangle | 6.06 | 6.3 | |
read_freefem | 2.84 | 6.3 | |
read_ugrid | 1.93 | 6.3 | |
read_openfoam | 28.47 | 10.5 | +4.2 GB over setup |
read_elmer | 7.34 | 8.7 | +2.4 GB over setup |
optimize_volume | 822.85 | 10.5 | +4.2 GB over setup |
segment | 0.12 | 6.3 | |
fit_primitives | 0.07 | 6.3 | |
reorder_ragged | — | 13.3 | killed (OOM) |
agglomerate | 51.66 | 11.0 | +4.8 GB over setup |
region_adjacency | 39.25 | 10.3 | +4.1 GB over setup |
find_interface | 36.20 | 7.4 | +1.1 GB over setup |
split | 2.67 | 6.3 | |
undo_green | — | 13.3 | killed (OOM); 2.05 s at 12.0 GB after the fixes in what landed |
hessian | 21.42 | 7.9 | +1.7 GB over setup |
compute_normals | 0.10 | 6.3 | |
compute_curvature | 0.09 | 6.3 | |
feature_edges | 56.85 | 11.3 | +5.0 GB over setup |
render_frame_160x96 | 19.83 | 10.2 | +3.9 GB over setup |
render_ss4_800x480 | 19.92 | 10.2 | +3.9 GB over setup |
render_streamlines_320x192 | 26.60 | 10.5 | +4.3 GB over setup |
render_synthwave_320x192 | 20.31 | 10.5 | +4.3 GB over setup |
hausdorff | 118.76 | 6.3 | |
shrinkwrap | 6.36 | 6.3 | |
voxelize | 0.02 | 6.3 | |
remesh | 1.08 | 6.3 | |
remesh_volume | > 450 | 10.0 | timeout; 18.87 s after the distance query's BVH |
sample_distance | > 450 | 6.3 | timeout; 9.56 s after the distance query's BVH |
distance_to_surface | > 450 | 6.3 | timeout; 9.51 s after the distance query's BVH |
distance_build | 0.12 | 6.3 | |
isosurface | 3.09 | 6.3 | |
slice | 2.12 | 6.3 | |
linearize | 0.98 | 7.3 | +1.1 GB over setup |
interpolate | 59.72 | 9.9 | +3.7 GB over setup |
repair | 0.33 | 6.3 | |
sobolev_deform | 0.65 | 6.3 | |
gradient | 30.48 | 7.2 | +1.0 GB over setup |
gradient_gg | 9.27 | 6.3 | |
gradient_narrow | 8.00 | 6.3 | |
gradient_surface | 0.08 | 6.3 | |
diff | 1.83 | 6.3 | |
diff_narrow | 2.62 | 6.3 | |
refine_narrow | 24.91 | 9.7 | +3.4 GB over setup |
linearize_narrow | 1.78 | 7.3 | +1.1 GB over setup |
elevate_narrow | 8.32 | 7.6 | +1.3 GB over setup |
simplexify_ragged | — | 13.3 | killed (OOM) |
Writes. One XL cube (357 MB of points and connectivity) written through the Python API with the native writers where the build has them, the resident set sampled during the write:
| Format | Extra memory while writing | Write time | File |
|---|---|---|---|
vtu (binary, zlib) | +1,024 MB (2.9× the mesh) | 17.7 s | 111 MB |
vtk (legacy binary) | +399 MB (1.1×) | 2.2 s | 476 MB |
gmsh (4.1 binary) | +413 MB (1.2×) | 1.7 s | 450 MB |
su2 | +334 MB (0.9×) | 7.3 s | 438 MB |
exodus (netCDF4, Python) | +333 MB (0.9×) | 3.8 s | 357 MB |
xdmf (HDF5 through h5py) | +29 MB | 5.4 s | 61 MB |
medit | +12 MB | 4.5 s | 432 MB |
Decision on 6.1.1 (streaming writes of one mesh). No writer needs more than three times the mesh it writes, and most need about one: a mesh that fits in memory writes. A mesh that does not fit has no producer in meshio++ to begin with — every reader, operation and binding builds a whole Mesh — so a general streaming writer would serve only callers that generate a mesh piecewise, and none has asked. The item is narrowed to the one real multiple: the VTU writer holds every array's compressed form beside the raw one; compressing and writing block by block brings it to the others' footprint. Kept, narrowed, S–M.
Decision on 6.1.2 (out-of-core operations). Not needed for 10M cells: every operation that failed did so holding at most a few copies of a mesh that itself fits comfortably, and the ones that ran long did so in memory. Streaming the block-local operations through a mesh that does not fit would not fix any row above. The item is replaced by what the measurement did find: the peak memory of the copying paths — the ragged (polyhedral) paths of reorder and convert_cells and undo_green hold their input, their output and full-size scratch at once, more than 7 GB over the setup peak for a 0.4 GB tetrahedral cube at XL, and are the first to fail as meshes grow. Replaced, S–M, with --tier XL --ops as the probe. The two distance rows' run time is a performance question, recorded here rather than reopened: the roadmap's performance section is closed and its landing rules apply to any change. The two rows, and remesh_volume, finish in 10 to 19 seconds since the nearest-triangle search became a bounding-volume hierarchy (roadmap 5.3, benchmarks).
What landed
Both items were then fixed with every output byte unchanged: the VTU, VTP, VTR, VTS and VTI files written before and after are identical, and every operation digest of the harness at tiers S and M agrees with the earlier build on the SEQ backend and with OPENMP at one and four threads.
6.1.1, the VTK XML writers. Each binary array now goes through a streaming encoder that asks the writer for its bytes 8 MiB at a time, compresses that batch's 32 KiB blocks in parallel into one buffer of compressed bytes, and writes the base64 text as it goes; the VTU writer generates its padded points and, for fixed-size cell blocks, the connectivity, offsets and types a window at a time instead of building them whole. Only the compressed bytes are ever held (the block header, written first, needs every block's size). Writing the XL cube as binary zlib VTU now needs +178 MB, half the mesh, where it needed +1,024 MB, and takes 11.2 s instead of 17.7 s. Ragged and polyhedral blocks and ASCII output still build their cell arrays before writing them, through the same encoder.
6.1.2, the copying paths. Each row's largest scratch is released or never built:
reorderon a ragged mesh: the node adjacency was a vector per node fed every ordered pair of a cell's node list, so a polyhedron, which lists each corner once per face, added each edge nine times and the rows rounded up to 8 KiB per node (14 GB at XL). It is now one flat array of raw entries over each cell's distinct nodes, 32-bit when the ids fit, counted and then filled; the rows are the same sets, so the CSR and the Reverse Cuthill-McKee order are too.convert_cells(simplexify): the tetrahedra and triangles are written straight into their final arrays, where they were staged in a vector and copied (4 GB at XL); the parent of each child is built only when cell data orrecord_parent_idsreads it; the sources of the new points are freed before the blocks are added.undo_green: the classification's scratch (copies of the threerefine:*columns, the coarse id lookup, the sibling order) is released before the output is built, roles are one byte, and the sibling sort is skipped when the parent ids arrive in order, asrefinewrites them.
| Row | XL before | XL after | XL time after | L peak before → after |
|---|---|---|---|---|
reorder_ragged | killed at 13.3 GB | 6.3 GB (the setup peak) | 42.5 s | 1,209 → 470 MB |
simplexify_ragged | killed at 13.3 GB | 9.7 GB | 61.7 s | 1,111 → 726 MB |
undo_green | killed at 13.3 GB | 12.0 GB | 2.05 s | 1,294 → 1,039 → 994 MB |
undo_green was still killed at XL after its scratch was released, and by its input more than by itself: the harness's green-refined cube (every seventh cell refined and closed red-green, about 83M tetrahedra with their hierarchy) leaves the process at 11.1 GB once built, and the 3.6 GB output was expected to need about 16 GB beside it. At tier L its peak above that input fell from 0.48 GB to 0.23 GB. Reading the refine:* columns in place and narrower group ids landed next (the third L figure above): each refine:* column is now read through a view per block, which is the array itself for the Int64 columns refine writes (a column of another dtype is converted one block at a time), the group ids are 32-bit and the per-group sizes are gone, and with a coarse mesh that records no hierarchy, as the harness's, the coarse id table is never built. At XL that removes about 2 GB of column copies, 0.33 GB of group ids and 0.25 GB of coarse ids from the classification; at tier L the row also runs in 0.24 s instead of 1.34 s, and every digest at tiers S, M and L is unchanged. The probe on a 23 GB machine (SEQ, one thread, a warmup and one timed run, --ops undo_green) closes it: the row completes at XL in 2.05 s with a peak resident set of 12,335 MB (12.0 GB), below the 16 GB the input-plus-output estimate gave, and its wall time with the setup is 33 s; the row is in benchmark/xl_ops_seq.csv. It was not rerun on the 15 GiB machine of the first study, where 12.0 GB should fit.
How far the data model stretches
The question (formerly roadmap 6.2.1). A CellBlock is a cell-type string and a node-index array; a rational Bézier or NURBS patch also needs weights and knot vectors, which have nowhere to live. Does a side-channel struct suffice, or does the Mesh need a second entity kind?
What exists. The MFEM reader is the only NURBS reader: it samples each patch into its knot-span elements as Lagrange cells (quad9, hexahedron27, the VTK Lagrange types for higher orders), evaluates NURBS grid functions at the nodes, and discards the knots, weights and control points. VTK's Bézier cell types (ids 75–81) exist only in the name tables, and nothing reads RationalWeights or HigherOrderDegrees, so a rational Bézier VTU loses its weights. The precedent for format data the Mesh cannot hold is the side-channel struct — MedInfo, GmshInfo, ExodusInfo, MdpaInfo — filled by a reader overload, consumed by a writer overload, carried explicitly by the Python binding and through mio_format_info in the C API, and pinned by the ABI layout tests.
Finding. A NurbsInfo side channel — per patch: the parametric dimension, the degrees, one knot vector per direction, the weights and the control net as an NDArray, plus the map from the sampled Lagrange cells back to their patch and knot span — carries everything read-only ingestion needs, and gives MFEM's patches a round trip, without touching Mesh, the mesh backends or any existing layout. It does not make NURBS a first-class citizen: no operation could act on a patch, and a trimmed surface's trimming curves would be one more side table. A real IGA model (patches, control nets and trimming curves as entities beside cells, with evaluation) needs a second entity kind in the Mesh, every backend, every binding and the ABI: a major version. Decision: the side channel first, filled by MFEM (roadmap 6.2.1, M); the IGA model stays XL and unscheduled (6.2.3). (Taken further in the isogeometric layer.)
What landed. The side channel, as found (v16.40.0): NurbsInfo (nurbs.hpp) holds per patch the degrees, the knot vector of each direction, the control net, the weights and the control values of every NURBS field read with it, then the file's patch topology and the cell-to-patch-and-span map. The MFEM reader fills it in both engines and the MFEM writer writes it back as an MFEM NURBS mesh in MFEM's global form, so all six NURBS fixtures make an exact round trip of mesh, field and side channel, and the two engines write the same bytes; it reaches C, Fortran, Julia, R, WASM and the MCP server through the format side-channel paths (MFEM). The Bézier half took a different shape than the roadmap first sketched: the VTK Bézier types became cell types (ragged, in the Lagrange node order), and the VTU RationalWeights and HigherOrderDegrees markers name a point array and a cell array of those names on every surface, so a rational Bézier VTU needs no side channel; a VTU written with them is read by VTK with its weights. Checking them against VTK turned up an older defect, fixed with them: VTK 9.1 swapped the nodes of edges 10 and 11 of its higher-order hexahedra and marks the new order by file version (XML 2.2, legacy 5.1), so the VTK_LAGRANGE_HEXAHEDRON cells meshio++ wrote as VTU 0.1 or legacy 4.2 were read by VTK with those nodes exchanged. The writers now declare XML 2.2 when such cells are present and convert on a 4.2 write, and the readers convert an older file. The IGA model (then 6.2.2) stayed unscheduled until the standalone layer below.
Trimmed B-reps. The NurbsInfo finding held for trimmed geometry too, as a second side channel rather than a wider first one. Kratos keeps its IGA geometry in CAD JSON beside the .mdpa deck, whose Geometries blocks take only Lagrange names; BrepInfo (brep.hpp) carries that file's faces, trimming loops, edges, vertices and the members meshio++ does not model, exactly, and STEP, IGES and fit_cad fill the same struct, so a CAD model becomes Kratos geometry by a format conversion (Kratos CAD JSON). The sampling follows the non-goal on constrained triangulation: each knot span is a Lagrange cell, and a trimmed face keeps the cells whose centre its loops contain. Two small core-private kernels came with it, a JSON DOM (the core had only the optional nlohmann submodule) and a NURBS evaluator whose fixed arithmetic order its Python twin repeats, so both engines sample bit for bit.
The isogeometric layer
The question (formerly roadmap 6.2.2). The side channels carry patches, control nets, weights, knots and trimming curves, but operations only ever saw their sampling. Is the fix a second entity kind inside Mesh, or operations on the side channel?
Finding. Everything an isogeometric consumer asks of a model, evaluate it, refine it exactly, sample it again, is an operation on the model, and none of it needs the model to live in the mesh: evaluation and refinement read and write the control net and the knot vectors, and a sampler turns the result into cells. A second entity kind would buy operations that act on patches (partition, smooth, …) at the price of every backend, binding and the ABI, and no such operation is asked for. Decision: a standalone layer beside Mesh (v16.43.0, isogeometric layer); the in-Mesh entity kind is a non-goal with a stated condition for reopening it.
What landed. iga_evaluate, iga_refine and iga_sample on every surface. One line-wise kernel does both refinements: a control net is held homogeneous, (w x, w f…, w), so geometry, weights and every NURBS field refine together with one rounding, and a direction's lines are refined independently, which covers curves, surfaces and volumes alike (knot insertion is A5.4, degree elevation A5.9, derivatives A2.3 with the rational quotient rule). Facts the work turned up:
- A knot vector of an MFEM model is shared between patches through the
edgestable and runs along each patch's own first edge, so the directions of two patches have no common orientation: per-direction refinement of an MFEM model would break the conformity the writer checks, and the layer refuses it (subdivisions=(2, 3)) rather than writing an inconsistent file. Uniform refinement keeps every shared knot vector refined alike, and the refined model writes back throughwrite_mfem. - The homogeneous round trip
w x / wcan move a rational control point by one ulp, so an identity refinement returns each patch as it was; and an MFEM model that is only sampled (subdivisions=0) keeps its control points as read and takes only the cell maps from the MFEM sampler, which regathers them from MFEM's global numbering. - A trimmed face refines without touching its trimming loops, because they live in the parameter space, which knot insertion and degree elevation do not change; its Kratos control-point ids are cleared, being the ids of nodes that no longer exist.
- Writing the sampler's blocks by VTK type alone merged faces of degrees 3 and 4 (
VTK_LAGRANGE_QUADRILATERALwith 16 and 25 nodes) into one block; the CAD JSON sampler, which this layer reuses, is now keyed by node count too. - The Python twin repeats the core's order of operations on numpy arrays that vectorise over lines and points without reordering any one of them, and the two return the same bits on every fixture (the native build compiles with
-ffp-contract=off).
The OpenCASCADE dependency
The question (formerly roadmap 6.2.4 and 6.3.5). Reading STEP or IGES robustly, and writing fitted analytic faces as a valid solid, both mean a CAD kernel; the only open one of production quality is Open CASCADE Technology.
Facts checked. OCCT is distributed under the GNU LGPL 2.1 with the additional exception in its OCCT_LGPL_EXCEPTION.txt; the current major version is 8.0. The Python route stl2curves uses, the cadquery-ocp wheels, installs OCCT 8.0.1 (libTKernel.so.8.0.1, cadquery-ocp 8.0.1.1) and with its VTK dependency took 1.2 GB here. It is what validated the step writer: STEPControl_Reader, BRepCheck_Analyzer and GProp read every file the tests write as a valid solid of the mesh's volume. stl2curves, the reference for the whole skin-to-CAD pipeline, is MIT-licensed and built on cadquery-ocp, NumPy and SciPy; meshio++ read its README only.
Finding. Everything that needs no kernel has shipped: segment, fit_primitives and the faceted step writer, on every surface (see skin to CAD). The STEP writer needed no kernel because a faceted solid is only planes and lines; the roadmap's description of it — ADVANCED_FACEs bounded by POLY_LOOPs — is not valid AP214 (an advanced face takes EDGE_LOOPs), and the writer emits the edge-loop form, which also lets neighbouring faces share their edges. What remains — CAD faces on the fitted cylinders, cones, spheres and tori, B-spline faces for the rest, fillets and threads, and reading STEP — is trimming, sewing and validating surfaces, which is the kernel's work and not something to re-implement.
Decision. An OpenCASCADE backend, if it comes, follows the KaHIP / ADIOS2 / MMG rule: MESHIOPLUSPLUS_WITH_OCCT, off by default, bring-your-own through find_package(OpenCASCADE CONFIG), never vendored or downloaded, linked dynamically, absent from the wheels, the WASM build and the native CLI binaries, its licence implications stated on its page, and Unsupported naming the flag wherever it is absent (Python raises NotImplementedError; there is no numpy twin of a kernel). One backend serves reading (now 6.2.1) and writing (6.3.3). Not scheduled: the fits are already useful as measurements and the faceted solid already opens in CAD; the backend is worth its weight when a consumer asks for editable CAD faces rather than a measured skin.
Taken. The backend landed under exactly that rule, with OpenCASCADE 7.6 as the floor (Ubuntu 24.04's packages, which the CI leg installs): fit_cad builds the analytic faces, sews and checks the solid and writes STEP, demoting any face the kernel rejects to facets. Two things the kernel did not do by itself had to be done around it: parameter-space curves continuous around each loop, since OpenCASCADE's own projection splits a boundary that runs along a seam and its missing-seam repair then drops the wire; and a sphere's pole axis chosen away from the patch, so a cap or a band closes in parameter space. Reading (6.2.1), the freeform fallback (6.3.2) with its splitting of patches no flattening parametrises, and constant-radius fillets and thread flanks (6.3.1) then landed on the same backend; a ring-shaped fillet needed the pipe made periodic along its spine, since GeomFill_Pipe returns it closed but not periodic, and the missing-seam repair otherwise drops one of its loops. STEP and IGES read as a BRepMesh triangulation plus the shape as a NURBS B-rep; converting the whole shape with BRepBuilderAPI_NurbsConvert, not each face's surface on its own, was what kept every trimming curve in its converted surface's parameters. fit_cad fits a B-spline face to a patch no primitive explains, over its plane or an unrolled cylinder, and holds the fit to half the tolerance at the vertices and the tolerance at the facet centres, since the solid's own check measures the face against the skin between vertices, where a smooth surface lies a facet's chordal error from it.
Revised (October 2026, v17.9.0): the kernel is assumed. With the skin-to-CAD chain giving its best result only through OpenCASCADE (trimmed, sewn and checked faces, freeform, fillet and thread faces, a measured solid), the bring-your-own rule left almost every user on the fallback. MESHIOPLUSPLUS_WITH_OCCT is now on by default and auto-detected, like HDF5: a system OpenCASCADE 7.6 or later links dynamically when found. The PyPI wheels and the release CLI binaries link it statically, built from the same pinned commit as the full WASM artifact by build/build-occt.sh (the pin and configuration live in build/occt-recipe.sh), with MESHIOPLUSPLUS_REQUIRE_OCCT refusing to build one without it. Those binaries are therefore MIT AND (LGPL-2.1-only WITH OCCT-exception-1.0): THIRD_PARTY_NOTICES.md and OpenCASCADE's licence texts ship with each, and the relink recipe is the build script itself. A build without the kernel keeps working: fit_cad's kernel-free native backend is the fallback, announced once, and STEP/IGES reading raises naming the flag. The original decision above is kept as the record of why the backend started optional.
The last features (formerly roadmap 6.3.1). Fillets whose radius varies along them, blends beside freeform faces and threads with rounded roots and crests, or with no cylinder or cone beside them, landed last (v16.44.0, fillets, blends and threads), as two OpenCASCADE-free fits in detail/feature_fit and B-spline faces built through grids, not as new kernel features: a rolling ball against any two surfaces given by their closest points, with its radius per vertex fitted as a law along the rail, and a helical surface of any profile whose screw is the one most nearly tangent to the patch (Pottmann and Randrup's kinematic fit, refined with the profile). What the work turned up:
- A ball resting on a fitted freeform face touches it where its normal happens to point. A B-spline held within half the tolerance of the skin has normals that wander by a few degrees, and a ball tangent to a nearly flat stretch slides its foot a tenth of its radius for that; the centres and radii stay put. The blend's face is therefore built from smooth laws through the solved centres (judged across the spine only: along it, a centre's place is the rail's arc length, which a wavering rail stretches) and its arcs widened past their feet.
- The rail cannot be the patch's boundary. A segmentation boundary along a tangent junction zigzags between two rows of facets, so a chain of boundary vertices folds back on itself; it orders the vertices, and the rail is the feet of the vertices' own balls on the first surface, binned along that order. A vertex's parameter is its ball's foot, not its own nearest rail point, which drifts along a rail whose radius varies.
- A freeform neighbour ends with its patch. A ball solved past the end of a fitted face touches it, if at all, at its edge, so the sections past an open rail's ends continue the laws linearly instead of being solved, and a vertex on a blend's own boundary is held to the whole tolerance, since its tangent neighbours are held to half.
- One screw, or none. The 6 × 6 kinematic fit has one vanishing eigenvalue on a helical surface and two or more on a plane, a cylinder or a sphere, which every screw about their axes leaves unchanged; requiring the second eigenvalue a hundred times the first, and a non-zero advance, refuses those and surfaces of revolution without a special case. The linear estimate rests on vertex normals, which a coarse grid only approximates, so it is refined together with the profile by Levenberg-Marquardt, against the residual the face is judged by.
- OpenCASCADE 7.6 and 7.9 differ where it shows. 7.9's whole-shape NURBS conversion throws on a trimmed cylinder or one wound several turns round, empties the surface of a face that already was a B-spline, and can stop a converted surface short of its trims; the side channel now checks the conversion and, failing it, approximates each surface and curve in its own parameters. 7.6 meshes a long, thin approximated B-spline with few knot spans far coarser than the deflection asked of it, which put a blend's re-meshed face a tolerance off a skin it lay on to a tenth of one; the blend's grid is therefore interpolated, a knot at every row and column. The CI leg runs 7.6 and the work was checked on both.
- The existing results did not move. The new fits run only once the pipe and the straight helicoid have failed, and the STEP files of the earlier fixtures are byte for byte what they were. What stayed out then — vertex blends, chamfers, tapered threads — landed in v17.2.0 with the full WebAssembly build (chamfers, conic blends, vertex blends and tapered threads), under the same rule: each runs only where every earlier fit failed, and the earlier fixtures' STEP files did not move.
Skin to CAD, iterative
The question (October 2026, after v17.10.0). fit_cad explains a patch once: a primitive fit_primitives accepted, a feature fit (fillet, blend, chamfer, thread) or one freeform attempt, else facets. Its segmentation is never revisited, and its freeform faces are height fields over a plane or an unrolled cylinder. How much more of a skin can become real CAD faces if segmentation, fitting and freeform approximation iterate against the tolerance, without moving a single byte of today's output when the new stages are off?
What the code does today (v17.10.0). These facts are what the work starts from, checked against the source.
- Options.
FitCadOptions(56 bytes, pinned intest_abi_layout.cpp) holdsmTolerance(0: three times the largest acceptedfit:patch_tolerance, or1e-3of the bounding-box diagonal),mExactEdges(true),mTypes(all five primitives),mMeshDeflection(0: a quarter of the tolerance),mMaxDemotionRounds(8),mFreeform(true),mFreeformDegree(3, the highest degree; the lowest is always 3),mFreeformMaxControl(64),mFreeformSplit,mFillets,mThreads,mMergeFaces(all true) andmBackend(Auto). The C structmio_fit_cad_opts(80 bytes) has 12 reserved bytes left,mio_fit_cad_report(192) none, andmio_fit_cad_report_ex(128) tenint64_t. - Input.
fit_cadreadssegment:patchand thefit:patch_*table; without them it runssegment(primitive method) andfit_primitivesitself (fcn_annotate, shared by both backends). An unexplained patch isfit:patch_type0 with NaN parameters; a label missing from the table is facets. - Freeform faces.
detail/patch_flattenparametrises a patch over its best-fit plane, or unrolls it around a cylinder whose axis is the direction its normals are most perpendicular to; a flattening with mixed triangle orientations is refused. The offset is resampled on a uniform grid over the flattened bounding box (outside the patch, continued from the nearest boundary edge), andGeomAPI_PointsToBSplineSurfaceapproximates that grid (iso-parametric, degree 3 tomFreeformDegree, C2, tolerance0.1·tol), OpenCASCADE placing the knots. The grid starts near √n a side and doubles up tomFreeformMaxControl. There is no parameter correction: the fit is accepted when every vertex lies within0.5·toland every facet centroid withintolat the affinely mapped parameters. A patch neither flattening parametrises is halved along the median ofn · eup to four times (patch_split_until_flat); a patch that flattens but fails the fit is facets. - Edges and vertices. Between two faces the edge is first the exact intersection (
GeomAPI_IntSS, freeform faces included; only fillet, thread, vertex-blend and chamfer faces skip it), else a smoothed B-spline through the chain moved onto both surfaces (GeomAPI_PointsToBSplineat0.25·tol). A junction among analytic faces is moved onto all of them by averaged alternating projection. Faces are sewn withBRepBuilderAPI_Sewingat the full tolerance. - Demotion. A face is demoted to facets when the B-rep check rejects it, sewing leaves an edge of it free, its boundary cannot be built, a re-meshed vertex lies further than its allowance from the skin (the tolerance, or for an analytic face up to 1.05 times its own chordal sag), or a skin vertex of its patch lies further than the tolerance from the solid. After
mMaxDemotionRoundsrounds a failing patch takes its neighbours with it.mMaxDeviationis the vertex-to-vertex Hausdorff distance (no face samples), a lower bound. - Fixtures. No STEP file or report of
fit_cadwas committed: the existing tests check counts and volumes, write one STEP file twice and compare the Python and C++ pipelines' bytes. "The STEP files did not move" was checked by hand.
Decision: three gated stages and a golden harness. Each stage is off by default and runs only where today's code ends, so every default output is unchanged, and that is now proved rather than claimed.
- Phase 0, the harness.
tests/cpp/test_fit_cad_goldens.cpppins the STEP bytes, the returned mesh and every report scalar of nine generated fixtures (tests/cpp/fit_cad_fixtures.hpp) for the native backend and, keyed byfit_cad_occt_version(), for OpenCASCADE;tests/python/test_fit_cad_goldens.pydoes the same through Python for three trig-free skins (NumPy dispatchessin/costo SIMD kernels by CPU, so curved fixtures built in NumPy can differ in their last bits between machines), opt-in withMESHIOPLUSPLUS_FIT_CAD_GOLDENS=1since the kernel's build enters the bits too. The C++ digests are pinned on x86-64 Linux with glibc, whosesin/costhe C++ fixtures call. Pinning them found one real leak: the native backend, a write entry point, never reset the provenance record, so a note an earlier operation left on the thread reached its STEP header; it now resets on entry. CI checks them on OpenCASCADE 7.6 (Ubuntu's packages, theocctleg) and 7.9.3 (built from the recipe's newMIO_OCCT_PIN=7.9pin, theocct-79leg); 8.0 is not tested. The shared numerics are OpenCASCADE-free and core-private:detail/sparse_solve(compressed rows, Jacobi-preconditioned CG and BiCGSTAB, every dot product summed over fixed chunks so no result depends on the thread count),detail/dense_chol(Cholesky, LDLᵀ with a damping shift, and a skyline LDLᵀ for banded normal equations) anddetail/bspline_lsq(clamped knots, basis derivatives to any order, a thin-plate term by Gauss-Legendre quadrature, regularised least squares and Newton projection). Eigen is not used: it is an optional submodule only the MED reader reaches. - Phase 1, refinement. A public operation
refine_patches(andfit_cad'srefine_segmentation) runs a variational shape approximation seeded bysegment's patches (Cohen-Steiner, Alliez and Desbrun 2004, with Wu and Kobbelt's 2005 hybrid proxies): plane, sphere, cylinder, cone and torus proxies plus freeform and facet ones, flooding from per-region seeds by a priority queue that never crosses a crease, refitting with geometric Levenberg-Marquardt, and splitting, merging and absorbing regions until the partition stops changing. It writes the samesegment:patchandfit:*layout, sofit_cadreads it unchanged.fit_primitivesandsegmentkeep their numpy twins and golden digests untouched; the stable parametrisations of Lukacs, Marshall and Martin (1998) go into a refit helper only refinement uses. Its RANSAC split draws from an in-house splitmix64 seeded by an option, never from a standard-library distribution, whose output differs between standard libraries. The seed is auint64in C++ and C, but R, JavaScript and the pipeline's JSON hold it as a double, so it is exact there below 2⁵³. - Phase 2, general freeform faces. Tried after today's freeform attempt fails, before the split: a disc parametrisation by least-squares conformal maps or mean-value coordinates (non-symmetric, hence BiCGSTAB), a cubic B-spline on uniform knots fitted by regularised least squares, then parameter correction, damped tangent-distance steps and knot insertion where the residual is above the tolerance, until it is met or the pole and iteration budgets run out. OpenCASCADE receives only the final poles and knots. Acceptance is unchanged (
0.5·tolat vertices,tolat facet centroids). - Phase 3, topology. Extended-surface intersections for freeform junctions, a least-squares junction point, a
sew_tolerancewhose default 0 keeps today's full tolerance, per-face two-sided Hausdorff distances and a closed-solid flag in the report. - ABI. Phase 0 adds one declaration (
fit_cad_occt_version), Tier C. Phases 1 to 3 growFitCadOptionsandFitCadResult, which bumpsMESHIOPLUSPLUS_ABI_VERSION; the C API gains new option and report structs with reserved tails instead of stretching the full ones, and per-patch and per-face rows travel as field data on the returned mesh, which every binding already reads.
Outcome (v17.11.0). All three phases landed, each off by default; the golden digests did not move. Measured on the nine golden fixtures (OpenCASCADE 7.6.3, one thread, seconds on the development container; faces / faceted / demoted; r refinement, g general freeform, esd extended edges, junction snapping and face deviation):
| Fixture | Default | r | rg | rgesd |
|---|---|---|---|---|
| box, capped cylinder, filleted plate, saddle box | unchanged | unchanged | unchanged | unchanged, corners snapped |
| turned part | 6 / 0 / 0, max deviation 0.0158, 0.3 s | 6 / 0 / 0, 0.0099, 1.0 s | same | same |
| noisy turned part | 7 / 0 / 0 (one B-spline), 0.0128, 0.7 s | 6 / 0 / 0 (all primitives), 0.0105, 1.3 s | same | same |
| wavy band | 4 / 0 / 0 (two B-splines), 7 s | refinement not kept, 9 s | same | same |
| threaded rod | 137 / 128 / 0, 22 s | refinement not kept, 34 s | 49 / 0 / 0 (two general B-splines), 64 s | 49 / 1 / 1, 13 extended edges, 128 s |
| rounded box | 26 / 0 / 0, 10 s | refinement not kept, 13 s | same | same, deviation 0.0028 |
Where the implementation departs from the plan. (1) refine_patches accepts a primitive as fit_primitives does (RMS within the tolerance, nine points in ten within it), not with every point within it: the strict rule called most of a rounded box's fillet and corner patches freeform and cut them into strips, and made the refinement's verdict disagree with the fit table it writes. (2) Even so, refinement knows primitives only, and a blend or corner the feature fits explain whole can still come out in strips, so fit_cad builds the OpenCASCADE solid both ways and keeps the refined one unless the other is better (refinement_kept), and honours the refinement's freeform verdict over a looser primitive (a torus fitted to a saddle took the box's planes down with it). (3) No annulus cut: a patch that is not a disc is halved until its pieces are. (4) extend_surfaces intersects extended copies only where the surfaces find no branch along a chain, and keeps a branch only where it stays on both faces' own surfaces; swapping the extensions in for the faces themselves made the threaded rod four times slower with more demotions. (5) The general fit's target is a quarter of the tolerance, not a half, leaving room for the edges and the re-mesh; it uses no ghost samples or margin (both tried, both cost accuracy). (6) face_deviation samples vertices and triangle centres of both sides rather than a separate hausdorff_face_samples budget.
Known limitations. A genuinely freeform surface is cut into primitive strips by refinement with allow_split (the comparison then keeps the unrefined solid, at the cost of a second build); refinement roughly doubles fit_cad's time and the general fit can double it again on a part with many unexplained patches; extend_surfaces has not yet paid off on a fixture; the digests are pinned only on x86-64 Linux with glibc; OpenCASCADE 8.0 is untested. The optional fourth phase landed in two parts: quad layouts as the patch network of the freeform modes (v17.12.0), and constrained fitting as constrain_primitives (constrained primitives, v17.23.0), which closed the roadmap's former §5; what was measured and left out is in fit CAD's measured and parked notes.
Surface booleans (formerly roadmap 7.8)
The question (November 2026). find_intersections decides every triangle pair exactly but rounds its segment endpoints; the planar triangulation and the fast winding number (detail/tri_bvh) exist. Can an arrangement-based union, intersection and difference of two closed triangle surfaces be built on the core's exact predicates within a stated size, and how robust and fast is it? B-rep booleans stay the CAD kernel's; this is about meshes.
The decision rule, stated before measuring. Queue a public mesh_boolean only if the synthetic corpus passes cleanly (every result watertight and free of self-intersections, the coplanar classes included) and the implementation stays within a few thousand lines; otherwise record it as a non-goal with the measured reason. Either way the decision is provisional until the Thingi10K run below.
What was built. A private prototype in the core, not installed and with no binding, ABI or API change:
src/cpp/src/detail/expansion.hpp(57 lines): Shewchuk's expansion arithmetic, whichpredicates.cppalready had, exposed to the rest of the core asexp_sum,exp_sub,exp_scale,exp_mul,exp_estimateandexp_sign; the predicates themselves are unchanged and their tests pin them.src/cpp/src/detail/mesh_boolean.{hpp,cpp}(111 + 931 lines):mesh_boolean_spike(A, B, op)and the volume oracleclosed_surface_volume. Candidate pairs come fromsoup_box_pairsand are decided by exactorient3dsigns. Every arrangement vertex is an input vertex or an edge of one surface crossing the plane of a triangle of the other, held as exact homogeneous coordinates in expansions ((d_p q - d_q p) / (d_p - d_q)withd_p = n · (p - a)); while neither input intersects itself no other point arises (two curves inside a face meet only on the other surface's edges, so no three-plane point is needed). Each pair's segment is the set of those points lying in both triangles, decided by exactorient2don the homogeneous coordinates in the dominant-axis projection. Each cut triangle is retriangulated in its plane by exact point location and edge flips (no Delaunay, only orientation), points on a shared edge go to both triangles beside it, and an exact orientation check of every piece guards the step. Patches bounded by the curves are flood-filled and labelled inside or outside the other surface by the parity of an exact ray cast (re-cast along another of eight directions when it grazes an edge); union keeps both outsides, intersection both insides, difference A's outside and B's inside turned over. Only at output are the points rounded to doubles.src/cpp/benchmark/boolean_spike.cpp(382 lines): themeshioplusplus_boolean_spikeharness, built with the tests, which runs the three operations on a pair of files or on a seeded synthetic corpus and prints one JSON line per run: success or the named failure, watertight (surface_watertight_check), free of self-intersections (find_intersectionson the rounded output), the pieces rounding collinearised or turned over, the inclusion–exclusion errors|V(A∪B) + V(A∩B) − V(A) − V(B)|and|V(A−B) − V(A) + V(A∩B)|relative toV(A) + V(B), sizes and per-stage times.tools/boolean_corpus.pywithtools/boolean_corpus/manifest.json(289 lines):syntheticruns the generated corpus;fetchdraws a seeded sample of Thingi10K's closed, manifold, oriented STL models throughtools/tet_corpus.py's fetch;runpairs each model with itself turned and moved by a fifth to a half of its size and with the next model (both in the unit box), runs the harness on each pair in its own process under a time limit, andsummaryprints the table below. The weeklyboolean_corpusworkflow runs it;tests/cpp/test_mesh_boolean.cppandtests/python/test_boolean_corpus.pytest the prototype and the tool.
About 1,400 lines of C++ in all, of which 1,100 are the boolean.
Measured. meshioplusplus_boolean_spike --synthetic 78 200, one thread on the development container, three operations per case. Inputs: icosahedral spheres (1,280 and 320 triangles), boxes with 2 × 2 grids per face (48 triangles), tori of 40 × 16 quads (1,280 triangles), under seeded rigid motions; "rounding turned pieces" is the share of successful runs where at least one exactly positive piece became collinear or reversed when its points were rounded.
| Class | Runs | Ok | Watertight | Free of self-intersections | Rounding turned pieces | Worst identity error | Median / max s | Failures |
|---|---|---|---|---|---|---|---|---|
| boxes moved along the diagonal | 3 | 100% | 100% | 100% | 0% | 2.2e-16 | 0.002 / 0.002 | - |
| nested spheres | 3 | 100% | 100% | 100% | 0% | 1.3e-15 | 0.001 / 0.001 | - |
| disjoint spheres | 3 | 100% | 100% | 100% | 0% | 5.5e-16 | 0.001 / 0.002 | - |
| offset spheres | 120 | 100% | 100% | 100% | 0% | 5.8e-15 | 0.048 / 0.090 | - |
| sphere and rotated box | 120 | 100% | 100% | 28% | 98% | 6.6e-15 | 0.064 / 0.147 | - |
| two rotated boxes | 120 | 100% | 81% | 22% | 81% | 3.7e-15 | 0.038 / 0.134 | - |
| crossing tori | 120 | 100% | 100% | 38% | 82% | 9.3e-15 | 0.068 / 0.133 | - |
| torus and sphere | 120 | 100% | 100% | 66% | 56% | 9.6e-15 | 0.104 / 0.219 | - |
| boxes sharing a face, overlapping coplanar faces, identical spheres | 9 | 0% | - | - | - | - | 0.002 / 0.034 | coplanar contact |
| spheres touching at a vertex | 3 | 0% | - | - | - | - | 0.001 / 0.001 | coplanar contact |
| a box's vertex on another's face | 3 | 0% | - | - | - | - | 0.003 / 0.003 | a segment's ends coincide in its triangle's plane |
| Thingi10K pairs | - | - | - | - | - | - | - | pending the first boolean_corpus run |
In all, 624 runs: 609 succeeded and 310 of those were watertight and free of self-intersections. Retriangulation takes 78% of the time, the exact segments 14%, classification 3% and the pairs 1%. The Thingi10K row is filled from the workflow's job summary: python tools/boolean_corpus.py fetch --dest boolean-corpus, then python tools/boolean_corpus.py run --dest boolean-corpus --harness <build>/meshioplusplus_boolean_spike --out boolean-corpus.jsonl and summary boolean-corpus.jsonl (the dataset's host refuses the development container, so it has not run yet).
What the numbers say.
- The exact arrangement is right. No transversal case failed, no patch label disagreed with its neighbour's (zero conflicts in 609 runs), and the volumes meet both identities to 1e-14 relative, where a wrong patch would move them by its whole volume; offset boxes give the analytic 1.875, 0.125 and 0.875 to rounding.
- Rounding the output is the gap. Where the surfaces cross at shallow angles or near vertices, the arrangement has pieces thinner than a double's spacing; rounding their points to doubles collapses or turns them over, which
find_intersectionsthen reports as self-intersections, and where two such points round to one, an edge loses its partner (all 23 outputs that are not watertight, every one a rotated-box case, had a turned piece). Of the 228 successful runs that rounding left untouched, 219 are clean; the other nine (eight crossing tori, one torus and sphere) self-intersect where rounded points moved neighbouring thin pieces through each other without turning any. Fixing it is not a tweak: it needs snap rounding of the arrangement (Hobby 1999) or exact output coordinates, the whole of what Cherchi et al.'s 2020 and 2022 booleans and Zhou et al.'s 2016 mesh arrangements spend on robustness, plus the self-intersecting inputs (three-plane points) those handle and this spike refuses. - Coplanar contact is not handled, and it is the common case in engineering geometry: boxes on boxes, a part and its copy, faces flush by construction. The two point contacts fail too: a box's vertex on another's face gives a segment of zero length, for which the retriangulation has no rule, and two spheres touching at a vertex have six of their 36 touching pairs flagged coplanar by the pair test, which the spike did not trace further (to settle before any reopening). A coplanar treatment (splitting both triangles by each other's edges in the shared plane, then the shared-face rules per operation) is a second arrangement of its own.
- Size and speed are not the obstacle. About 1,100 lines and a tenth of a second for 2,500 input triangles, with the flips, not the exact arithmetic, taking most of it.
Decision: no public mesh_boolean is queued. The rule above is not met: transversal results are watertight and exact in topology, but fewer than two in three of the curved and rotated cases survive rounding, and every coplanar class fails. Making the prototype an operation means snap rounding or exact output and a coplanar arrangement first, each larger than the spike, which is the library-in-its-own-right the volume-meshing non-goal describes; mesh booleans go to the CAD kernel (OpenCASCADE's BRepAlgoAPI) for B-reps and to dedicated libraries for meshes. The prototype stays in detail/ with its tests and harness, so the decision can be revisited on evidence: reopen it when the Thingi10K run disagrees with the synthetic one, or when a design pass bounds snap rounding and the coplanar case on the core's predicates.
Known limitations of the prototype. Inputs must be closed, manifold, oriented and free of self-intersections (the first three are checked; the last is assumed); coplanar and zero-length contacts fail by name; output points are rounded, with the cost above; the retriangulation is not Delaunay, so pieces are as thin as the arrangement makes them; and the ray parity is exact but cast from a rounded sample point, which a sliver patch thinner than a double's spacing could misplace (not seen in the corpus).
Follow-up (roadmap 9.1, optional backend provider). Following the decision above to leave mesh booleans to dedicated libraries, the core now exposes a BooleanProvider registry (providers.hpp), mesh_boolean(a, b, options) (operations/mesh_boolean.hpp, Python mesh_boolean/has_boolean_provider, MCP mesh_boolean), and an optional Apache-2.0 Manifold provider (src/cpp/providers/manifold/manifold_provider.cpp, MESHIOPLUSPLUS_WITH_MANIFOLD, OFF by default). When no provider is registered, mesh_boolean refuses by name (Unsupported). Running the Thingi10K/synthetic corpus benchmark against a compiled Manifold build remains open under roadmap 9.1.
Surface booleans through Manifold
Roadmap 9.1.1 and 9.1.2, November 2026: the spike's synthetic corpus (tools/boolean_corpus.py synthetic, seed 78, 200 seeded pairs plus the eight fixed degenerate contacts, three operations each, 624 runs) through mesh_boolean with the Manifold 3.5.5 provider (--backend provider), beside the spike prototype on the same machine (4 cores, release build):
| backend | runs | ok | watertight | watertight and self-intersection free | worst identity error | median seconds (spheres offset / tori crossing) |
|---|---|---|---|---|---|---|
| spike prototype | 624 | 609 | 586 | 310 | 9.6e-15 | 0.029 / 0.040 |
| Manifold | 624 | 624 | 624 | 624 | 9.1e-15 | 0.003 / 0.005 |
Manifold passes every case the spike failed: the coplanar contacts (boxes sharing or overlapping a face, identical spheres, spheres touching at a vertex) and the box vertex on a face, and every curved result is free of self-intersections, where rounding left the spike's sphere–box, rotated-box and crossing-tori results intersecting in 34 to 78 per cent of runs; it is also about ten times faster. The volume identities hold to the same 1e-14. This meets the spike's criteria, so the backend landed as the BooleanProvider (-DMESHIOPLUSPLUS_WITH_MANIFOLD=ON, the meshioplusplus-manifold add-on); CI's providers job reruns 40 seeded pairs on every pull request and boolean_corpus.yml the Thingi10K sample weekly (--backend provider). See surface booleans.
Discrete exterior calculus (formerly roadmap 15.2.3)
The question. mesh_operator exposes vertex-indexed sparse matrices (cotangent Laplacian, lumped and consistent mass, graph Laplacian, and cell-gradient) on triangle surfaces and now tetrahedra. Roadmap 15.2.3 asked whether exposing the underlying discrete exterior calculus (DEC) factorization — coboundary operators $d_0$ (vertex-to-edge) and $d_1$ (edge-to-face) together with diagonal Hodge stars $\star_0$, $\star_1$, $\star_2$ — is worth adding to the public API and flat bindings.
What was verified. On closed orientable triangle meshes (unit icosahedral sphere and torus, verified in tests/cpp/test_roadmap_9_11_15_6.cpp), oriented edge-vertex incidence $d_0 \in \mathbb{R}^{E \times V}$ and face-edge incidence $d_1 \in \mathbb{R}^{F \times E}$ satisfy the cochain complex identity $d_1 d_0 = 0$ identically, and the primal-dual assembly $d_0^\top \star_1 d_0$ with cotangent edge weights $\star_{1,e} = \tfrac{1}{2}(\cot \alpha_e + \cot \beta_e)$ matches mesh_operator(..., CotangentLaplacian) to machine precision ($\approx 10^{-15}$ relative error).
What the findings show. Three constraints argue against a public DEC surface right now:
- No canonical edge or face indexing on
Mesh.Meshindexes vertices and cells; no mesh file format in meshio++ stores a canonical global edge or interior-face numbering. Exposing $d_0$, $d_1$, $\star_1$, and $\star_2$ publicly would require returning and documenting edge-pair and face-tuple side-channel tables across Python, C, Fortran, Julia, R, Octave, and WASM so callers know which row of $d_0$ corresponds to which geometric edge. - Circumcentric duals fail on obtuse elements. On non-Delaunay triangle meshes (and especially on 3-D tetrahedral meshes), circumcentric Hodge stars $\star_1$ and $\star_2$ can become zero or negative on obtuse simplices; guaranteeing positive-definite duals requires intrinsic Delaunay triangulation (iDT) or barycentric duals, neither of which matches the simple P1 FEM stiffness assembly already shared with
tet_fem.hpp. - Existing consumers only need vertex-indexed operators. Every downstream operation in meshio++ —
smooth_field,laplacian_eigenmodes,geodesic_distance,shortest_path(heat_trace),spectral_descriptors(HKS/WKS), andtransfer_operator— operates on vertex-indexed CSR matrices (L,M,G,P), whichmesh_operatorandmio_sparse_operatoralready expose without edge/face side channels.
Decision: no public DEC operator API is queued. Keep mesh_operator focused on vertex-indexed operators across triangle surfaces and tetrahedral volumes, exposed uniformly through mio_sparse_operator in the C API and flat bindings. Reopen DEC only if a concrete curl/div 1-form or 2-form consumer (such as Helmholtz–Hodge decomposition or electromagnetic edge-element export) needs public edge-indexed cochains.