Skip to content

tiler_bunny_test: the contour tiler end to end on the Stanford bunny (SDF, ortho slices, isocontours, tiling, Hausdorff) - #1352

Merged
transfix merged 1 commit into
masterfrom
p3b/tiler-bunny
Nov 18, 2026
Merged

transfix merged 1 commit into
masterfrom
p3b/tiler-bunny

Conversation

@transfix

Copy link
Copy Markdown
Owner

An end-to-end test of the contour tiler (P3b, #1332 and #1334) on the Stanford bunny, as Joe asked: take the bunny's SDF, slice it with the ortho slicer, trace each slice's zero isocontours, tile them, and check that the surface comes back within a tolerance of the original mesh.

What tiler_bunny_test does

  1. The bunny: the built-in test.bunny (34,835 vertices), scaled to span 100 units. The tiler's tolerances are absolute and set for coordinates of order 1 to 10^4; the built-in bunny spans about 0.15.
  2. Its SDF: cvc::sdf(..., SDF_V1) on a 72^3 grid, with 3 voxels of padding so every isocontour closes inside its slice. Spacing h = 1.54.
    • Not SDF_V2: bun_zipper is open at its base, and V2's sign leaks through the holes, so "inside" reaches the grid border.
    • Not n = 48: V1 then gives spurious contours (167 in place of 95).
  3. The ortho slicer: cvc::extract_slice(sdf, slice_axis::z, k) for every k.
  4. Isocontours: marching squares in the test, in doubles. Crossings are shared between neighbouring cells so loops close, and saddles are split by the cell mean. The 50 slices give 95 contours, up to 5 in one slice (ears and body).
  5. Tiling: cvc::tile_contours, with curation_delta = 0. The contours are level sets of one field and never cross, and curating them doubled the tiling time for the same surface.
  6. Comparison: distances in both directions, from every vertex and triangle centroid of one surface to the other. They come from a uniform-grid point-to-triangle search in the test, so libigl isn't needed (several CI lanes build without it).

Measured (Windows, MSVC 19.44, Release), in slice spacings h

max mean tolerance
bunny → tiled 1.78 h (near a hole's rim in the base) 0.25 h max < 2.5 h, mean < 0.4 h
tiled → bunny, above the base band (bottom 3 h) 1.38 h < 2 h
tiled → bunny, all 3.54 h (the caps over the base's holes) 0.28 h mean < 0.4 h
Hausdorff 3.54 h < 5 h

The tiler also warns six times: four untiled regions it can't trace ("No chord was legal") and two medial-axis fills it abandons. These are legacy behaviours, as in the branch parity case. They leave small gaps, which the bunny → tiled distance bounds.

Cost and where it runs

About 45–60 s in Release: the SDF and the tiling take about half each, and the distances about 1.5 s. The suite is named TilerBunnyIntegration, which puts it with ci.yml's heavy suites (STRESS_REGEX): skipped on PRs and run on Release pushes to master. So this PR's CI builds the test but doesn't run it. It is built only with CVC_ENABLE_SDF, and it skips without cvc::planar.

The roadmap's P3b section gets a short paragraph with these numbers.

Checked locally: Windows, MSVC 19.44, Release: passes, about 45 s; git-clang-format is clean. Not run locally: Linux, macOS and Debug (CI's Release push runs the first two).

The bunny's signed distance field (cvc::sdf, SDF_V1, 72^3) is cut into z
slices by the ortho slicer (cvc::extract_slice). Each slice's zero isocontours
are traced by marching squares (in the test) into a cvc::contour_stack, and
cvc::tile_contours puts a surface through them. That surface is measured
against the bunny mesh both ways, with a small uniform-grid point-to-triangle
search (no libigl needed).

Measured on Windows (MSVC, Release), in slice spacings h:
- every bunny point is within 1.78 h of the tiled surface;
- every tiled point above the base band is within 1.38 h of the bunny;
- the mean distance is 0.28 h one way and 0.25 h the other;
- the Hausdorff distance is 3.54 h, from the tiled surface capping the holes
  in the bunny's base (bun_zipper is open there).
The tolerances are about 1.4 times these.

SDF_V2's sign leaks through those holes, so the test uses SDF_V1. Tiling
skips curation: the contours are level sets of one field and never cross.
It takes about a minute in Release, so the suite name holds "Integration",
which puts it with ci.yml's heavy suites (Release pushes, not every PR).
Built only with CVC_ENABLE_SDF; it skips without cvc::planar.
@transfix
transfix merged commit af3870f into master Nov 18, 2026
29 checks passed
@transfix
transfix deleted the p3b/tiler-bunny branch November 18, 2026 18:51
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