Skip to content

fix(saved-mesh): close planar edges at used trim stations - #2256

Draft
shifatrHtH wants to merge 1 commit into
DrunkOnJava:mainfrom
shifatrHtH:codex/planar-boundary-stations
Draft

shifatrHtH wants to merge 1 commit into
DrunkOnJava:mainfrom
shifatrHtH:codex/planar-boundary-stations

Conversation

@shifatrHtH

Copy link
Copy Markdown
Contributor

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

  • Search used boundary stations within the edge's dominant model-space coordinate interval. Apply a physical collinearity check and keep the original triangles if the bounded split cannot preserve winding and nonzero area.
  • Include a public RE1 Mechanical probe and a two-binary replay script.

Testing

  • tools/check-local.sh
  • The public IFC-ECS RE1 Mechanical pair is MIT-licensed and checksum-pinned in the witness registry. The affected carrier goes from 27 to 28 triangles and from three to zero one-sided edges at each of the three weld tolerances. Its vertex buffer is byte-identical. The whole element's bidirectional vertex, edge-midpoint and centroid comparison against the paired Revit IFC stays within 3e-14 ft in both arms.
  • The default and SharedBoundary paths each replay 1,159 selected owners across 23 public RVT/IFC pairs. In each path, 74 rows change geometry, with no identity or refusal changes. In the measured SharedBoundary arm, all 61 complete changed owners keep their vertex buffers, and 79 changed carriers close at all three welds. The bidirectional IFC distance maxima are unchanged for all 61.
  • @DrunkOnJava, could you run full Measure on this head before landing?
  • N/A for tools/bench.sh. This is a topology fix.

Copy probes/examples/probe_2250_planar_boundary_stations.rs into the base checkout at b2011374 and build the probe in each checkout.

cargo build --locked --profile ci -p rvt-probes --example probe_2250_planar_boundary_stations
python3 -B tools/re/replay_planar_boundary_stations.py BASE_PROBE HEAD_PROBE RE1-Mechanical.rvt

Audit-honesty checklist

  • The changelog describes only the planar edge repair. There is no public API change or new format claim.
  • The probe uses a public fixture from the witness registry.
  • N/A for reverse-engineering documentation. This corrects triangulation of existing decoded rings.

Legal and contribution hygiene

  • This contribution is licensable under Apache-2.0 and uses publicly documented inputs.
  • No model files or third-party implementation code are included.

Breaking changes

None.

Screenshots or output samples

{"publicElementId":439148,"oneSidedEdges":[3,0],"carrierTriangles":[27,28],"vertexBufferIdentical":true}

Related issues

Refs #2250.

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.

This branch has not been deployed

No deployments
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