Repository navigation
fix(saved-mesh): close planar edges at used trim stations (#2250), carrying #2256 - #2296
Merged
Merged
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 #2250.
7 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) gainHeight,GrossSideArea,GrossVolumeand their net values, beams (IfcBeam) their surface areas, volumes andCrossSectionArea, and proxies theirNetVolume, 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 anydiagnostics.jsonistotal_entities. This carries shifatrHtH's #2256 onto currentmain: their two commits, cherry-picked onto currentmainand re-signed with them as author, plus the changelog credit. The cherry-pick mergednative_saved_mesh.rsautomatically, 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_stationssplits 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'sPLANAR_WORK_BUDGET, with a pair limit of 1,000,000 shared across its rings.probes/examples/probe_2250_planar_boundary_stations.rsandtools/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
main, unfiltered. Measure 47623397328 on9c2389fbagainstmain, with the samples, the BIM4LCA models and the Revit 2025 set. Registered before the run: the 43 exports and 16diagnostics.jsonthat fix(saved-mesh): close planar edges at used trim stations #2256's own head moved against its merge base (47461981522), with the same quantity gains. Result: 43 of 101 exports differ, the same 43 by name, and the same 16diagnostics.json, in each of which onlyexported.total_entitiesmoves (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) andmesh_bodies_vs_ifc(two equal furniture lines swap places on the office at permit), as on fix(saved-mesh): close planar edges at used trim stations #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.differentand "rvt-rs quantities Revit does not write" are unchanged on all 16. The same-project gates pass on9c2389fb.differentand "values Revit does not write" unchanged. On RE1 Architecture, whose export has base quantities off, rvt-rs writes 127 against 122, counted apart.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 onmainplus the probe, 47629193042 on this carry plus the probe; both scratch commits archived underrefs/archive/2026-12-06/): 3 one-sided edges and 83 triangles onmain, 0 and 84 here, as Saved planar triangulation leaves T-junctions at already-used boundary stations #2250 reports.b2011374and hasn't been rerun on this carry.Breaking changes
None.
Co-authored-by: shifatrHtH 342213537+shifatrHtH@users.noreply.github.com