Repository navigation
fix(saved-mesh): close planar edges at used trim stations - #2256
shifatrHtH wants to merge 2 commits into
Conversation
Earcut can use a boundary station in one triangle and leave a longer one-sided edge through it. Split the incident triangle at the stored station while preserving vertex positions and winding. Refs DrunkOnJava#2250.
|
@shifatrHtH, thank you. The full Measure run you asked for is going on this head, against its merge base One thing from reading the code against |
|
@shifatrHtH, the full Measure run on
|
|
@DrunkOnJava Thanks for running Measure and flagging the budget. Commit In a generated T-junction, the split succeeds with exactly the required checks available. With one fewer check it leaves the original triangles in place, with no charge above either limit. On the checksum-pinned public RE1 Mechanical fixture, the affected carrier still goes from 27 to 28 triangles and from three to zero one-sided edges at all three weld tolerances. Its vertex buffer is byte-identical. Across the same 23 public fixtures, the new head matches all 1,159 selected rows from Your 612 added Revit-matching quantities and the same-project gate results are useful. Once the held-out comparison on |
|
@shifatrHtH, thank you for
Neither of your two commits is signed, which the branch rules require; I'll re-sign them when it lands, keeping you as their author. |
…-of-two face (#2256, never to land)
|
@shifatrHtH, the count I said I'd run. A scratch build of your
Next, ours: carry your two commits onto current |
…rrying #2256 (#2296) ## Summary Saved planar faces now split a one-sided triangle edge at a collinear trim station, even when another triangle already uses that station, so the face closes without a T-junction. On the BIM4LCA and Revit 2025 models, walls (`IfcWall`) gain `Height`, `GrossSideArea`, `GrossVolume` and their net values, beams (`IfcBeam`) their surface areas, volumes and `CrossSectionArea`, and proxies their `NetVolume`, each moving from missing to equal to Revit's; no value moves to different. No body changes its source: the only field that moves in any `diagnostics.json` is `total_entities`. This carries shifatrHtH's #2256 onto current `main`: their two commits, cherry-picked onto current `main` and re-signed with them as author, plus the changelog credit. The cherry-pick merged `native_saved_mesh.rs` automatically, since #2276 to #2280 have changed it since #2256's base. Supersedes #2256. Closes #2250. ## Motivation #2250: a complete saved mesh in RE1 Mechanical has three one-sided edges. Earcut uses a boundary station in one triangle but leaves a longer edge through it in the neighbouring one, and the existing boundary restoration treats an already-used station as restored. The branch rules require signed commits, which #2256's two aren't. ## Changes - `src/research/native_saved_mesh.rs` (shifatrHtH): `conform_used_planar_stations` splits a one-sided edge at each used boundary station within 1e-10 ft of it, keeping the authored vertex positions, the winding and a nonzero area, or else keeps the validated triangles. Its checks count against the face's `PLANAR_WORK_BUDGET`, with a pair limit of 1,000,000 shared across its rings. - `probes/examples/probe_2250_planar_boundary_stations.rs` and `tools/re/replay_planar_boundary_stations.py` (shifatrHtH): a public RE1 Mechanical probe and a two-binary replay. - `changelog.d/fixed/planar-boundary-stations.md`, with "Contributed by shifatrHtH." ## Testing - **The carry against `main`, unfiltered.** Measure [47623397328](https://github.com/DrunkOnJava/rvt-rs/actions/runs/47623397328) on `9c2389fb` against `main`, with the samples, the BIM4LCA models and the Revit 2025 set. Registered before the run: the 43 exports and 16 `diagnostics.json` that #2256's own head moved against its merge base ([47461981522](https://github.com/DrunkOnJava/rvt-rs/actions/runs/47461981522)), with the same quantity gains. Result: 43 of 101 exports differ, the same 43 by name, and the same 16 `diagnostics.json`, in each of which only `exported.total_entities` moves (no body source, refusal or skipped count). Every scorer line that differs is in four scorers: `qtos_vs_ifc` (missing to equal, below), `mcp_answers_vs_ifc` (the same quantities in the server's answers, 15 models), `wall_heights_vs_ifc` (2 to 5 more triangles read on four housing models) and `mesh_bodies_vs_ifc` (two equal furniture lines swap places on the office at permit), as on #2256's own run. Base quantities equal to Revit's rise by 612 with the same split by model: +38 and +42 on the concrete housing, +36 on each terrain model, +26 and +22 on the timber housing, +93 and +89 on the concrete office, +106 on each timber office, and +3 on each of six Revit 2025 room and stair models. `different` and "rvt-rs quantities Revit does not write" are unchanged on all 16. The same-project gates pass on `9c2389fb`. - **Held-out and BIMcollab models.** Measure [47623399402](https://github.com/DrunkOnJava/rvt-rs/actions/runs/47623399402), same head: the 10 held-out exports #2256's head moved ([47467256394](https://github.com/DrunkOnJava/rvt-rs/actions/runs/47467256394)), plus RE1 Architecture and RE1 Mechanical, which #2256's unfiltered run also moved. 7 of 7 diagnostics identical. Equal base quantities +193 with the same split (+2, +15, +24 on each of four saves, +20 on each of four saves); `different` and "values Revit does not write" unchanged. On RE1 Architecture, whose export has base quantities off, rvt-rs writes 127 against 122, counted apart. - **#2250's case on current `main`.** shifatrHtH's probe of RE1 Mechanical's element 439148, with a scratch count of the edges each carrier uses once, vertices welded by position at 1e-7 ft (Measure [47629195459](https://github.com/DrunkOnJava/rvt-rs/actions/runs/47629195459) on `main` plus the probe, [47629193042](https://github.com/DrunkOnJava/rvt-rs/actions/runs/47629193042) on this carry plus the probe; both scratch commits archived under `refs/archive/2026-12-06/`): 3 one-sided edges and 83 triangles on `main`, 0 and 84 here, as #2250 reports. - shifatrHtH's 1,159-row replay of 23 public pairs ran on #2256's head against `b2011374` and hasn't been rerun on this carry. - The station tolerance: of at least 11.4 million boundary stations on the 82 models that reach the conform step, none lies between 1e-10 and 1e-7 ft off an edge ([47620668497](https://github.com/DrunkOnJava/rvt-rs/actions/runs/47620668497), posted on #2256). - No unit tests. ## Breaking changes None. Co-authored-by: shifatrHtH <342213537+shifatrHtH@users.noreply.github.com> --------- Co-authored-by: shifatrHtH <342213537+shifatrHtH@users.noreply.github.com> Co-authored-by: shifatr <shifatr@harrythehirer.com.au>
|
@shifatrHtH, this landed as #2296 ( |
Summary
Saved planar faces now split a one-sided triangle edge at a collinear trim station even when another triangle already uses that vertex. The fix preserves the authored vertex positions and removes the T-junction.
Motivation
Issue #2250 shows a complete Saved mesh in RE1 Mechanical with three one-sided edges. Earcut uses the relevant station in one triangle but leaves a longer edge through it in the neighboring triangle. The existing boundary restoration treats an already-used index as restored.
Changes
Testing
tools/check-local.sh3e-14 ftin both arms.tools/bench.sh. This is a topology fix.Copy
probes/examples/probe_2250_planar_boundary_stations.rsinto the base checkout atb2011374and build the probe in each checkout.Audit-honesty checklist
Legal and contribution hygiene
Breaking changes
None.
Screenshots or output samples
{"publicElementId":439148,"oneSidedEdges":[3,0],"carrierTriangles":[27,28],"vertexBufferIdentical":true}Related issues
Refs #2250.