Skip to content

Wall profile openings: Revit writes the pockets of a profile against its convex hull; RE-151's rectangle rule writes openings Revit does not on 10 walls and misses wall 1387731's (follow-up of #1600) #1607

Closed

Description

@DrunkOnJava

State as of PR #1608 (RE-380; the comments keep the working). Revit's wall-profile openings are the pockets of the profile against its convex hull. RE-151's rule (elevation_profile_cuts, "each run of lines leaving the profile's bounding rectangle cuts the region between it and the rectangle's edge") matches Revit's export on one wall of the five Revit 2024 files and writes an opening Revit does not write on ten.

Runs. 42614629885 (all models, #1604's code against b969296e), 42616460564 and 42618842627 (the scorer prints each opening's mesh corners; commits c9de5fb8 and 4ccce43d), 42619901187 and 42635378158 (probe_1607_wall_profile_lines, commit 80808447, which prints every wall's sketch lines with their ElementIds and ends: the five Revit 2024 files, and Autodesk's 2024 sample projects). The commits are archived under refs/archive/2026-11-09/cited/.

The rule, wall by wall. A wall's loop is its sketch lines in its vertical plane; its pockets are the stretches of the loop between two hull corners that the hull edge cuts off. A pocket is closed by the hull edge where one end of the edge stands off the loop's bounding rectangle (terrain 1387731: four corners; 7 of the 15 pockets Revit exports), or through the rectangle's corner where the edge's ends stand on two adjacent sides, neither at a corner (Core Interior's 55840: nine points, 301.65 ft2, where the stretch and the edge hold 71.23; 8 of the 15). The opening's Tag is the first line of the stretch in the loop's counter-clockwise walk on 12 of the 15 pockets, and the last line on the 3 of one Snowdon wall.

File Walls with sketch lines Pockets Revit's export
Core Interior 2 (55840, 34362) 2 55840: opening Tag 55859, nine points; 34362: a wall neither export holds
BIM4LCA terrain 2 (1351524, 1387731) 1 (1387731) opening Tag 1389018, the same four corners
BIM4LCA office, as built and at permit 14 none no opening on any of them
Snowdon Towers Architectural (local only) 9 13 on 7 walls those 13 openings and no other; none on the other 2 walls

None of Revit's 30 (as built) and 24 (at permit) openings of no cutter in an office wall is on a wall with sketch lines; they are RE-321's rectangular openings. So the pocket rule predicts an opening on 10 of the 27 walls with sketch lines (16 pockets) and none on the other 17; Revit's export holds exactly the 15 pockets it can and none on the 17. Of the other Revit 2024 files in the corpus, Autodesk's sample projects rac_basic, rme_advanced and rme_basic hold 10 more pockets (three of them notches) with no Revit export to measure; no pocket of any file has a hull edge that ends otherwise.

What the first builds got wrong (2026-11-09). The first #1608 commit closed every pocket by its hull edge, because the scorer's corners and boxes were the same for 55840 either way; the test of #227 (tests/wall_profile_openings.rs) reads the opening's area and failed (71.233 ft2 against Revit's 301.649). unfilled_openings_vs_ifc now compares the opening's volume. The second design cut every region in the wall's body and also wrote the pockets as openings, and the Tag was the highest id of the stretch; Snowdon Towers showed that IfcOpenShell evaluates the body of wall 698311, cut and with an opening on the cut, as the uncut box, and that the highest id is right on 6 of the 15 (the first line on 12, the lowest id on 8). A region a pocket equals is now the pocket (the wall keeps its box); any other region is cut in the body.

The Tag's residual. On Snowdon's wall 698364, Revit names the last line of each of its three stretches, and the first-line rule writes another line: those 3 openings do not pair in unfilled_openings_vs_ifc (3 extras and 3 missing, on a file no gate has). Checked and the same on all 13 Snowdon openings: the extrusion direction against the wall's y, the polygon's winding in the wall's frame, the profile axis against the wall's x. Revit's polygon starts at the end of the stretch beside the line it names; what fixes that end is not read.

Why it is Revit's rule is not read from its source: the exporter's AddClippingsToBaseExtrusion and the extrusion calculator it uses are in RevitAPIIFC, closed. The open-source WallExporter.cs (TryToCreateAsExtrusion, ExportWall) shows the shape of it: the wall is a footprint extrusion with clippings, and the openings that call returns ("cut pairs") are written by OpeningUtil.CreateOpeningsIfNecessary. Read that way, the hull's sloped edges are the clip planes (they run on to the wall's end, which is what #1473 sees as Revit keeping the slope past the profile's end) and a pocket is what no plane can cut. That is a reading of measured walls.

Not measured: a pocket on a wall outside Revit 2024; arcs in a profile (RE-151 leaves a sketch with an arc alone); a notch against Revit's export (the notch writes the polygon RE-151 wrote); a cut body with an opening that overlaps the cut other than the one case avoided.

Done when: rvt-rs writes the profile openings Revit writes, with Revit's host and polygon within 0.01 ft, on the files with Revit's export, and none Revit does not, by pockets against the convex hull, with the rest of the profile's cut in the body in a way that is not an opening, and the walls' tops, heights and volumes still Revit's on all 1,560; or a measured negative says where the pocket rule fails. #1608 does this; the Tag of one wall's three openings is the measured negative.

Activity

  1. added
    area:ifc
    priority:P2
    type:bug
    on Nov 9, 2026
  2. DrunkOnJava commented on Nov 9, 2026

    @DrunkOnJava
    OwnerAuthor

    The shapes of the other openings, from run 42618842627 (main at f0842b30; the scorer prints the mesh corners of every opening of no cutter in a wall):

    • The office's eight walls, as built and at permit. The openings rvt-rs writes are slivers 0.75 to 0.79 ft high and 4.7 to 5.7 ft long. The two walls that run along x (2070689 and 2070691) give three corners in x and height, (116.630, 183.075), (116.630, 183.849) and (121.353, 183.849): a right triangle above a top that rises to the box's top at the right end. The other six run along y and give two positions along the wall and two heights each (2058501: 75.015 and 80.381 ft along y, 183.085 and 183.834 ft high), which the scorer does not pair. Revit's export has no opening on any of the eight.
    • Core Interior's 55840, the one wall where the rule matches Revit: the opening has five distinct heights (58.500, 61.833, 63.083, 69.167 and 76.000 ft) and five positions along the wall (51.083, 56.917, 60.500, 71.417 and 77.417 ft), the same in both exports, so a polygon of five corners or more, not a triangle or a sliver. The scorer pairs corners for walls along x only, so the shape itself is not printed yet.

    So on the nine walls where rvt-rs's opening is a plain cut above a sloped top (the office's eight and 1351524) Revit's export has none, while the two openings of Revit's on a profile-edited wall (Core Interior's 55840, and the first three lines of 1387731's top) are something other than a plain slope. That is a reading of the measurements, not a rule.

  3. DrunkOnJava commented on Nov 9, 2026

    @DrunkOnJava
    OwnerAuthor

    A reading that fits the terrain walls corner for corner: Revit's openings on a profile-edited wall are the pockets of the profile against its convex hull, not the regions between a run of lines and the bounding rectangle.

    • Wall 1387731. The hull of the loop's seven corners has the edge from (122.404, 196.522) to (215.944, 192.408) in x and height, and then the edge from (215.944, 192.408) down to (296.260, 183.090). The loop's lines between the first two hull corners, through (138.808, 195.699) and (171.639, 192.408), leave the hull on the profile's side; that pocket, closed by the hull edge, has the four corners of Revit's opening exactly. The last line lies on a hull edge, so it adds nothing. (Computed from the lines in the wall's record; the hull and its pocket are the only part of the reading I ran.)
    • Wall 1351524. The slope steepens to the right, so the profile is convex: the hull is the profile, there is no pocket, and Revit writes no opening.
    • The office's eight. A single straight sloped top is convex too, so the reading predicts no opening there, as in Revit's export. This and Core Interior's 55840 (a pocket with five or more corners) are to be checked against the sketch lines the probe in run 42619901187 prints for the five Revit 2024 files.

    In Autodesk's open-source exporter (WallExporter.cs, TryToCreateAsExtrusion and ExportWall) a wall is built as an extrusion of its footprint with clippings, and the native call AddClippingsToBaseExtrusion hands back the "cut pair" openings that OpeningUtil.CreateOpeningsIfNecessary writes; the rule inside that call is not in the open source, so the hull reading is a measurement, not something read. It would also say why Revit's body here is the profile with no opening for a plain slope: the clipping planes are the hull's sloped edges, and only what the planes cannot cut (a pocket) becomes an opening.

    What this changes in #1607's plan: RE-151's rule takes the region between a run and the rectangle; the pocket rule takes the region between a hull edge and the lines that leave it, which agree where the hull edge is the rectangle's (Core Interior) and part where it is a slope. The wall's body would be the hull (the box clipped at its sloped hull edges), with one opening per pocket.

  4. DrunkOnJava commented on Nov 9, 2026

    @DrunkOnJava
    OwnerAuthor

    The probe in run 42619901187 (probe_1607_wall_profile_lines, main at f0842b30 plus the probe) prints the sketch lines of every wall that lists any, with their ElementIds and ends, on the five Revit 2024 files with Revit's export. Computing each wall's loop, its convex hull and the pockets of the loop against the hull gives, wall by wall:

    Wall Hull pockets Highest line id of the pocket Revit's export
    Core Interior 55840 1, eight corners 55859 Tag 55859, the same five heights and five positions
    terrain 1387731 1, four corners (122.404, 196.522), (138.808, 195.699), (171.639, 192.408), (215.944, 192.408) 1389018 Tag 1389018, the same four corners
    terrain 1351524 none no opening
    office, the eight walls of RE-358, as built and at permit none no opening
    office, 3025796, 3026297, 3027380 none no opening
    Core Interior 34362 1, the same eight corners as 55840 34381 none in the Revit export

    RE-151's rule (a run of lines leaving the bounding rectangle) gives the same region as the hull on Core Interior's two walls, where the hull edge is the rectangle's top, and a region Revit does not write on 13 others: 1387731 (Tag 1389150 against Revit's 1389018), 1351524 and 11 of the office's 14 walls. rvt-rs writes an opening for the two terrain walls and the office's eight; the runs of the other three office walls are not written, for a reason I did not check. The pocket rule is right, in Tag and in corners, on both walls where Revit writes an opening that can be set against it (55840 and 1387731) and on all 15 walls where Revit writes none (1351524 and the office's 14: none of Revit's 30 and 24 openings of no cutter sits on one of them). It is wrong only on Core Interior's 34362, which has 55840's shape and no opening in Revit's export; rvt-rs writes none for it either, so the wall is probably not exported (not checked).

    Two readings of why this is Revit's rule, neither read from its source (the extrusion calculator the open-source exporter calls is in RevitAPIIFC): the exporter clips the footprint extrusion at the planes of the profile's hull edges, so a pocket is what no plane can cut, and the wall's body in Revit's export is the profile because the clip planes run on to the wall's ends (which is what #1473 sees as the sloped top that Revit keeps sloping past the profile's end).

    What this asks of rvt-rs. Writing an opening per pocket, tagged by the highest line id, equals Revit's on every wall above. The wall's body then needs the hull's sloped edges as clips, since the box less the pockets alone is the hull's bounding rectangle, not the hull: today the cuts between the hull and the rectangle are written as openings too, and those are the openings of rvt-rs's that Revit does not write (the office's eight and the terrain's two, the last with the pocket merged into it).

  5. changed the title [-]Wall profile openings: rvt-rs writes one on 10 walls of the office and terrain files where Revit's export writes none or another, and matches Revit only on Core Interior's wall 55840 (RE-151, follow-up of #1600)[/-] [+]Wall profile openings: Revit writes the pockets of a profile against its convex hull; RE-151's rectangle rule writes openings Revit does not on 10 walls and misses wall 1387731's (follow-up of #1600)[/+] on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:ifcpriority:P2type:bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions