Repository navigation
feat(elements): draw shed roofs along their slope from their sketch lines' slope blocks (RE-56) - #362
Merged
Merged
Conversation
…ines' slope blocks (RE-56) Each sketch line of a footprint roof carries its edge's slope block: the slope angle (9:12 by default), 16 zero bytes, 32 ff, a small negative i64, a u32, u32 7, then flags 00 00 01 00, or 01 01 01 00 on an edge that defines the roof's slope followed by -rise/run (partition_roof_slopes). A roof type's layers follow its name and u32 0; the "2d 00" framing RE-53 recorded on 2025 floors was a type named "-". find_layers now accepts any length-prefixed name there, and Snowdon and Core Interior are unchanged by it. A 2024 roof with exactly one defining edge gets that edge, its angle and its type's thickness (attach_roof_slopes), and is drawn rising from the edge with the thickness square to the slope, as an IfcFacetedBrep, only when that reproduces its record box height within 1e-4 ft. On the Autodesk tutorial house the one sloped roof, 1:12 over 20.458 ft with a 1.25 ft type, gives 2.9591938797 ft against the recorded 2.959193880 ft. Hip and gable roofs and roofs sloped some other way stay level plates.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_674b573e-3faf-40ed-b1ab-22f79cb91e8d) |
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
Shed roofs are drawn along their slope (RE-56, #356).
IfcFacetedBrepin IFC, and drawn in glTF and the viewer. It is drawn so only when the rise and thickness reproduce the roof's recorded height to 1e-4 ft.u32 0. The "2d 00framing" RE-53 saw on 2025 floors was that same pattern, with types named "-".find_layersnow accepts any length-prefixed name there.Measured on the Autodesk tutorial house (MIT 4.567 copy, Revit 2024, local only, no export of Revit's own):
IfcOpenShell meshes rvt-rs's IFC of roof 169835 as a faceted brep: its underside lies at the base plus its distance from the edge over 12, and its top 1.25 / cos θ above, to 2e-6 ft.
Motivation
A sloped roof exported as a level plate its whole rise tall was the most visible wrong shape left on a house. #356 needed an oracle; the tutorial house supplies one, with the record box as the check.
Changes
edge_slope/scan_edge_slopesread the block. On a defining edge the stored rise/run must equal −tan of the angle.attach_roof_slopesrequires a sketch outline, a type, a slope block on every edge (exactly one defining), and the defining edge's bounded line. It records the edge, angle and type thickness;roof_slope_from_fieldsreads them back.sloped_slab_mesh.roof_slope_solidandBodySourcepartition_roof_slope.Testing
End to end, against real files. No unit tests were added.
763f239e…):rvt-ifc, meshed by IfcOpenShell as above.What this does not do
Audit-honesty checklist
Legal and contribution hygiene
Breaking changes
None.
Related issues
Refs #356.
Note
Medium Risk
Changes partition parsing and IFC body selection for roofs with a new geometry path, but scope is narrow (2024 shed roofs with one defining edge) and fails closed on the height check.
Overview
Shed roofs (RE-56) now export as sloped geometry instead of flat plates when partition data supports it.
The PR adds
partition_roof_slopesto read per-edge slope blocks from Revit 2024 roof sketch lines (angle, defining-edge flags, −rise/run).attach_roof_slopeswires roofs that have a sketch outline, type layers, a slope block on every edge, and exactly one defining edge—recording the edge line, angle, and summed type thickness on the element.IFC/glTF/viewer bodies use
sloped_slab_meshandroof_slope_solid, emitting anIfcFacetedBrepwith thickness measured square to the slope, only when rise plus vertical thickness matches the record box height within 1e-4 ft. Hip/gable roofs, roofs without a defining edge, and other slope mechanisms (e.g. slope arrows) stay level plates.partition_compound_structure::find_layersis broadened so roof type layer stacks parse behind any printable UTF-16 type name (not only the hyphen framing seen on some 2025 floor types), enabling roof thickness for the slope solid.Reviewed by Cursor Bugbot for commit 68d9c22. Configure here.