Skip to content

fix(saved-mesh): anchor a curved edge's end to the plane's saved corner when it lies on the plane but off that corner - #2246

Open
oguzhanakk wants to merge 1 commit into
DrunkOnJava:mainfrom
sitekeephq:fix/shared-edge-tolerance
Open

oguzhanakk wants to merge 1 commit into
DrunkOnJava:mainfrom
sitekeephq:fix/shared-edge-tolerance

Conversation

@oguzhanakk

Copy link
Copy Markdown

Summary

refined_plane_edge takes the plane's own saved sample for a curved face's end sample that lies on the plane but off that saved sample by less than PLANE_ANCHOR_LIMIT, as it already does for an end sample that leaves the plane. Such an edge was refused as shared edge surface samples disagree, and its element stayed a record box.

Motivation

Families of round sections cut by planes (piles, round columns, cylinders with flat ends) are refused when the cylinder face's edge ends a few hundredths of a millimetre from the corner the plane saved: the end projects onto the plane (residual under 1e-14), but 1e-6 to 1e-4 ft from the plane's own sample, against close's 1e-7. #2085's anchor handles the same gap when the end sample leaves the plane, not when it stays on it but moves along it. The samples between the ends are unaffected and still must agree.

Changes

  • src/research/native_saved_mesh.rs, refined_plane_edge's anchor: an end sample needs no anchor only when it projects onto the plane and onto the plane's saved sample (close); otherwise the existing test applies (model distance to the plane's sample within PLANE_ANCHOR_LIMIT, 3.9e-4 ft). Strictly a widening: every edge accepted before is accepted the same way.
  • changelog.d/fixed/shared-edge-corner-anchor.md.

Testing

Unit tests are banned here; none added.

  • cargo fmt --check and tools/release/changelog.py check pass; cargo clippy --release --lib (Rust 1.100) finds nothing in the changed code (its one finding, enum_variant_names in partition_name_candidates.rs, is on main too). I did not run the whole tools/check-local.sh.
  • Autodesk's sample projects (11 files as listed in research/autodesk-sample-projects.tsv, 2024-2027), main at a79664d against this branch: no change in elements, IFC classes, body sources or refusals on any of them; time and peak RSS within noise.
  • On private infrastructure models (Revit 2027) the gap at the refused ends was 1e-6 to 1e-4 ft, every refused edge's mid samples agreed within 1e-12, and every element refused for this reason alone is now drawn from its saved mesh; a render shows the round sections where record boxes were. Peak RSS rises a little where many such elements are, as their meshes replace boxes. I cannot share the models or numbers from them.
  • Not measured: Measure's corpus with Revit's exports.

Audit-honesty checklist

Breaking changes

None in the API. IFC output changes for the elements above (body source and representation).

Legal and contribution hygiene

  • I agree this work is licensable under Apache-2.0.
  • No Autodesk proprietary source, decompiled internals or SDK content; the change reads only what rvt-rs already decodes.
  • No test fixture is added.
  • The commit is not signed; "Allow edits by maintainers" is on.

Related: #2243 (the same contributor's saved-mesh change for hollow framing and overrunning walls). This pull request is independent of it and applies to main on its own.

…er when it lies on the plane but off that corner

An end sample on the plane but up to PLANE_ANCHOR_LIMIT off the plane's own
saved sample was refused as 'shared edge surface samples disagree', leaving
round piles and columns with flat ends as record boxes.
@shifatrHtH

Copy link
Copy Markdown
Contributor

@oguzhanakk @DrunkOnJava I found a related public reproduction for closing a stored trim corner. The affected carrier here has only planes, so it exercises a separate case from this PR's plane-to-curved-edge anchor.

On the pinned BIM4LCA Housing Concrete As-Built pair, public element 2000732 is an IfcSpace. With rvt-ifc from exact #2246 head 0541ea0d, --saved-meshes --saved-mesh-graph-values 2000000 --large-model --export-decisions reports saved_mesh_not_used with partial: disconnected UV boundary for it. There is one 0.00002373 ft gap. The reciprocal edge records reach three planes whose intersection determines the corner. The repair reads the adjusted endpoints on those same records. It verifies closure with the other 16 faces as one carrier.

The local reader trial retains the authored stations for paired planar spans. Between any two stations the charts are affine, so the larger endpoint discrepancy bounds the whole span. Both incident faces use the same positions. The result has 66 triangles, zero one-sided or overused edges and zero same-direction edge pairs. Revit's own IFC for the same save also has 66 triangles for that GlobalId. An independent comparison of vertices and triangle centroids gave maxima of 0.00000792 ft toward Revit and 0.00000266 ft toward the reader mesh. Both runs reproduced the same buffers. Across all 12 BIM4LCA pairs, the other 60 elements selected by this refusal reproduced their previous native rows, including the mixed-surface carriers.

Would you prefer a separate reader patch for the all-planar case? I would keep the retry local to the carrier and retain the existing refusal unless the shared trim passes the full closed, oriented body check.

@oguzhanakk

Copy link
Copy Markdown
Author

@shifatrHtH thanks, that's a clear public reproduction. As you say, it's a different mechanism: an all-planar carrier whose stored corner doesn't close, while this PR only anchors a curved edge's end to the plane's saved corner. So I'd keep #2246 as it is and take this as a separate reader patch.

Your approach sounds right to me: keep the retry local to the carrier, use the same positions on both incident faces, and keep the existing refusal unless the shared trim passes the full closed, oriented body check. The 66-triangle match with Revit's own IFC for that GlobalId, plus the other 60 elements reproducing their previous rows across all 12 BIM4LCA pairs, is the evidence I'd want with it. Please go ahead, or tell me if you'd rather I open it and you review.

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.

2 participants