Skip to content

fix(ariadne): fe_lab meshes intervals through cvc::tetrahedralize2 - #845

Merged
transfix merged 1 commit into
masterfrom
fix/fe-lab-tetrahedralize2
Oct 27, 2026
Merged

transfix merged 1 commit into
masterfrom
fix/fe-lab-tetrahedralize2

Conversation

@transfix

Copy link
Copy Markdown
Owner

fe_lab's interval mesher now calls cvc::tetrahedralize2. That was the follow-up planned once #808 fixed tetrahedralize2's interval path. #808 made tetrahedralize2 reach LBIE's TETRA2 mode and mesh the layer as the solid min(v - lo, hi - v) >= 0, with the isovalues in either order. fe_lab's tetrahedralize_interval had been building that same solid itself, as a Float volume, and meshing it with the single-isovalue tetrahedralize.

What changes

cvc::gl::ariadne::tetrahedralize_interval passes the original volume to tetrahedralize2 and only chooses the two bounds:

  • Bounds stay inclusive. A bound that samples sit on is passed on half way to the nearest value beyond it, so [1, 3] on labels meshes as [0.5, 3.5] and keeps labels 1 and 3. tetrahedralize2 on its own counts a sample on an isovalue as outside: on the same labels it keeps label 2 alone. A new check pins that down.
  • A bound past the data adds no sheet. A bound that no sample lies beyond is moved far enough past the data that the other bound's side of the min wins at every sample (H >= 2 vmax - L). With neither bound passed, the whole box is meshed.
  • The quarter-edge rule is dropped. The helper used to raise samples sitting on a bound so the surface stayed a quarter of a grid edge away from them. Since fix(LBIE): fitted tet boundaries in any units, a geometric flow that can't wreck tets, and real interval meshes #808's QEF clamping that is unnecessary: on the ball shell, with grid points on both bounds, there are no slivers and every boundary normal points out of the shell. The shell also no longer bulges at those samples.
  • Values and bounds are compared in float, as LBIE reads them.

fem_gallery --iso2 passes the two isovalues as given; tetrahedralize2 takes either order.

Acceptance test: cvcgl_fe_interval

The test meshes the SDF ball's shell 6 <= r <= 10 at 33³, with grid points on both bounds.

before #808 after #808, old helper this PR
Poisson peak vs exact 2.014 ~22% low 2.072 (+2.9%) 2.048 (+1.7%)
shell volume vs exact +2.1% +1.8%
slivers (< 1e-3 of the mean tet) many, by the inner sheet 0 0

The Poisson bound tightens from 30% to 10% (peak and mean error), and the sliver count is now a check (at most 0.1% of the tets).

Tests (Windows, MSVC Release, with libigl)

  • cvcgl_fe_interval: all checks pass, including the new tetrahedralize2 labels check: r in [5.25, 9.77], label 2 only.
  • cvcgl_tf_binding and cvcgl_ariadne_realize pass. The cvcgl_* tests are not part of CI's recipe jobs.
  • fem_gallery --mesh stanford.bunny --problem mesh --dim 48 --iso2 -0.012 gives an even shell: 230,713 tets, min/mean dihedral angle 0.2° / 46.3°.
  • clang-format is clean on the changed lines.

Docs: mesh_nodes.h, TRANSFER_FUNCTIONS.md §6, and GEOMETRY_API.md, which now says a sample exactly on an isovalue counts as outside a tetrahedralize2 layer.

#808 fixed tetrahedralize2's interval path: it reaches LBIE's TETRA2 mode and
meshes the layer as the solid min(v - lo, hi - v) >= 0, with the isovalues in either order.
fe_lab's tetrahedralize_interval built that same solid itself as a Float volume and meshed it
with the single-isovalue tetrahedralize, waiting for this fix. It now calls tetrahedralize2 with
the original volume and only chooses the two bounds:

- A bound samples sit on is passed on half way to the nearest value beyond it, so the interval
  stays inclusive ([1, 3] on labels is [0.5, 3.5]). tetrahedralize2 on its own counts a sample on
  an isovalue as outside and keeps label 2 alone; a new check pins that down.
- A bound no sample lies beyond is moved far enough past the data that the other bound's side of
  the min wins at every sample, so it adds no sheet; with neither passed, the whole box.
- The rule that raised samples on a bound to keep the surface a quarter of a grid edge away is
  gone: since #808's QEF clamping the ball shell has no slivers and every boundary normal points
  out of the shell without it, and the shell no longer bulges at those samples.

cvcgl_fe_interval, the acceptance test: on the SDF ball's shell 6 <= r <= 10 (grid points on both
bounds), Poisson's peak is 2.048 vs 2.014 exact (it was ~22% low before #808) and the shell's
volume is 1.8% over (2.1% before). The bound tightens from 30% to 10%, and the sliver count (0)
becomes a check.

fem_gallery's --iso2 passes the two isovalues as given (tetrahedralize2 takes either order). Docs:
mesh_nodes.h, TRANSFER_FUNCTIONS.md section 6, and GEOMETRY_API.md (samples on an isovalue count
as outside of a tetrahedralize2 layer).
@transfix
transfix enabled auto-merge (squash) October 27, 2026 22:22
@transfix
transfix merged commit 0c7f5f2 into master Oct 27, 2026
22 of 24 checks passed
@transfix
transfix deleted the fix/fe-lab-tetrahedralize2 branch October 29, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant