Skip to content

feat(saved-graphics): a cylinder face bounded by two trim loops, a hole, two regions or a seamless tube, is meshed (#1191) - #2102

Merged
DrunkOnJava merged 8 commits into
mainfrom
feat/cylinder-tube-loops
Nov 20, 2026
Merged

DrunkOnJava merged 8 commits into
mainfrom
feat/cylinder-tube-loops

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

On the full Measure, rows 1, 3, 4 and 5 hold. Row 2 fails only on the BIM4LCA offices' 30 Stay_Wall_Mounted_:VAR-1 grab bars a file, which Revit's own export draws as a square along their legs (read). They ship drawn round, as the file saves them, with that miss on record (decided 2026-11-20). Report: RE-494.

Summary

A cylinder face bounded by two trim loops on part of a turn is now meshed strip by strip (band_mesh). Before, the saved-graphics mesher took one trim loop on a cylinder and refused any face with two as multiple cylinder trim loops unsupported. Two loops making a full turn, and three or more loops, are still refused. The code is as at d46bfeff; the commits after it add the report, the changelog fragment and the docs.

A full Measure of 1ab9c54e against main 4e05cfb0 (44649733126: nordic, r2025, samples, holdout, every scorer, exports kept) moves 27 of 120 exports. On 22 of them, bodies that were record boxes are now drawn from their saved meshes: 1,289 on the exports kept, and 10 on the held-out house. On the other five, the rac basic samples, only refusal texts move (row 4). The bodies newly drawn:

  • IfcFurniture: 30 on each BIM4LCA office file, all Stay_Wall_Mounted_:VAR-1. Row 2 fails on all 30: 1.11 of Revit's volume, rvt-rs's points up to 0.0116 ft off Revit's surface.
  • IfcDoor: 4 on each BIM4LCA housing file (O-5:O-5.9x21sauna) and 10 on the held-out house. All pass row 2: within 0.01 ft both ways and within 1 per cent of Revit's volume.
  • IfcPipeFitting (48 and 87) and one IfcBuildingElementProxy on Autodesk's rme basic and advanced samples in every year they exist, 2023 to 2027.
  • Snowdon Towers 2024: 404 IfcAirTerminal and 36 IfcDuctFitting (HVAC), 108 IfcSanitaryTerminal (plumbing), 5 IfcBuildingElementProxy (Trash Chute), an IfcColumn and an IfcElectricAppliance (architectural), and an IfcLightFixture (electrical). Revit has no export of these in Measure; how they were read is below.

The grab bars fail because Revit's export draws the round bar with a few large flats. Along the legs it uses a square whose corners lie on rvt-rs's round (radius 0.0110 m). On the U-bend it uses straight pieces whose ends lie on that round. Both of Revit's shapes for them, 15 bodies each, read the same. Revit writes those flats itself (IfcPolygonalFaceSet), so they are not IfcOpenShell's tessellation.

d46bfeff removes the full-turn reader, tube_trim, which no face on any file read took. A byte-identity Measure of it against 1ab9c54e (44660808578: nordic, r2025, samples, holdout) leaves 120 of 120 exports and 102 of 102 diagnostics.json identical.

Motivation

#1191 (W6). A census of box_bodies_vs_ifc over the models with Revit's own export (Measure 44589336915, head side, 5e36af9f, before #2099) counts, for each refusal reason, the bodies whose refusal names it alone. That is a lower bound of what each reason blocks: a face's first failing stage hides the ones behind it. multiple cylinder trim loops unsupported is the largest such reason Revit's exports can check: named alone by 136 bodies, 30 on each BIM4LCA office file and 4 on each housing file.

Probe runs said which shape those faces are:

  • 44638585587: none on the office or the housing is a tube. Every such face's envelope covers part of a turn.
  • 44639888934: on the housing's 4, each pair of loops is a hole inside the other loop; on the office's 30, holes and two separate regions.
  • 44659164312 (probe_2102_cylinder_loops at 6327fb09, every 2024 to 2027 sample): every two-loop cylinder face covers part of a turn (1 to 51 faces a file), so none takes the full-turn path. 13 faces on each rme advanced and basic file and 3 on Snowdon architectural have three loops, and 2 on each rac advanced file have ten; all are still refused.

Changes

  • src/research/native_saved_mesh.rs: cylinder_face reads a second trim loop. If the two make a full turn it refuses them as two cylinder trim loops on a full turn unsupported; otherwise it reads both rings closed and meshes them with band_mesh. band_mesh takes the strips across U, whose edges fall on every ring point, so each ring edge crosses a strip whole or not at all. It covers each strip between its crossings taken in pairs by height, which is a hole and separate regions alike. The face's points are both rings', so the plane beside it rebuilds the same steps (refined_plane_edge). Three or more loops are still refused.

Testing

Unit tests are banned in this repository. Rows registered before any run is read. The registration below is as written before the full Measure ran; each row's result follows it. A third probe run on the same two files (44641101362, 42a94918) was read for one question: are the bodies that named the reason alone drawn now? They are, and row 2 fails on the office (read), so no full Measure is run until those bodies are read face by face. The rows below are judged on a full Measure of the head that settles (nordic, r2025, samples, holdout, every scorer, exports kept).

  1. Nothing scored moves away from Revit. In mesh_bodies_vs_ifc, saved_meshes_vs_ifc, roof_bodies_vs_ifc and stair_bodies_vs_ifc, no class's "ref on ours", "0.001 ft" or "0.01 ft" count falls, and no body leaves a volume bin it was in. No psets_vs_ifc or qtos_vs_ifc line moves.
    • Result (full Measure):
      • Holds. No class count falls on any model. The only family lines that leave mesh_bodies_vs_ifc are pushed off the end of its list of the largest families by the new ones (PK-1:PK-1.3800 on the offices, UO-3 and UO-4 on the housing). No psets_vs_ifc or qtos_vs_ifc line moves. door_bodies_vs_ifc moves 4 housing doors from "mirror rule wrong" to "rvt-rs's box is Revit's".
      • schema.txt moves on 21 models. On each, the count of swept solids placed apart from their product falls by exactly the number of bodies newly drawn there. On Snowdon plumbing the export grows from 112 MiB to 130 MiB, past the 120 MiB Measure validates (ci(measure): Autodesk's samples are validated up to 120 MB, as the reference models are #1532), so Measure skipped it. Read locally with IfcOpenShell 0.9.0.post1 as Measure reads it (tools/ci/ifc_validate_summary.py --both): 0 validation findings and 0 EXPRESS-rule findings, as on main.
  2. Every body newly drawn that Revit exports is checked, on mesh_bodies_vs_ifc's class counts, since its list of bodies holds only some and far_vertices_vs_ifc does not read IfcFurniture. For each class that gains bodies, each count of bodies within a bar rises by as many as the class gains:
    • Revit's vertices from rvt-rs's surface within 0.01 ft;
    • rvt-rs's vertices from Revit's within 0.01 ft;
    • the volume within 1 per cent of Revit's.
      A count that rises by less means a newly drawn body fails it, and those bodies are read face by face before anything lands.
    • Result (full Measure):
      • Fails on IfcFurniture on the four office files: 30 gained, each count rises by 0. Read face by face (comment): the faces meet within 0.001 ft, and Revit's export draws the round bar with a square along its legs and straight pieces on its U-bend.
      • Holds on IfcDoor: on each housing file 4 gained, and the 0.01 ft and 1 per cent counts each rise by 4; on the held-out house 10 of 10. Their 0.001 ft and "ref on ours" counts do not rise (the comment reads one door).
  3. The shared reader changes nothing else. ring_impl also reads planar faces and the cylinder's one-loop rings, and a plane beside a two-loop cylinder now refines its edge on that cylinder's steps. On every export that moves, no body drawn from a saved mesh on both sides changes its mesh (ifc_body_diff.py's count, expected 0).
    • Result (full Measure):
      • Holds: 0 on all 94 export pairs read. The held-out house's export is not kept, so it was not read here. At d46bfeff, ring_impl is as on main: the full-turn reader and the open ring it needed are removed.
  4. Nothing newly refused. No refusal reason in any diagnostics.json rises, except where bodies leave multiple cylinder trim loops unsupported for one of the new two-loop reasons or a later one. Each such move is listed by reason.
    • Result (full Measure):
      • Holds. 1,289 bodies named that reason alone and are drawn. 97 more named it with others and now name only the others: 60 a trim loop does not close in the surface's parameters; disconnected UV boundary; unsupported surface HermiteSurf, 21 face regions need subdivision, 10 unqualified collapsed ruled profiles; unqualified collapsed ruled trim, 6 disconnected UV boundary. No body names a two-loop reason.
  5. The same-project gates pass, and no held-out export moves away from Revit.
    • Result (full Measure):
      • Holds on 1ab9c54e: "pass: 15 samples held to their earlier saves, and the Areas on 4 saves and on the 2021 save". d46bfeff's exports are byte-identical to it. The held-out house moves only by its 10 doors (row 2).
  6. As they come:
    • the bodies that named the reason alone (30 on each office file, 4 on each housing file), drawn or with their new reason;
    • bodies newly drawn by file, from diagnostics.json;
    • which exports move, by model.
    • Result (full Measure): the 30 on each office file and the 4 on each housing file that named the reason alone are drawn. The bodies newly drawn and the exports that move are listed by file and class in the Summary above.

What each outcome means, written before the run.

  • If rows 1 to 5 hold and row 2 checks at least one body, the change goes for review with its report and a changelog fragment.
  • If those bodies come back with a new two-loop reason, that reason is their shape. It is read before any change to the reader.
  • If row 2 fails, the failing bodies are read face by face before anything else.

The outcome. Rows 1, 3, 4 and 5 hold, and row 2 checks the doors, which pass. Row 2 fails on the 30 grab bars a file, read face by face as registered: Revit's export draws the round bar as a square along its legs. Landing with row 2 failed on them is outside the outcomes registered above; it is Griffin's decision (2026-11-20), to ship them drawn round, as the file saves them, with the miss on record.

The bodies no Revit export in Measure scores (1,153 on the samples) were read four ways: against the record box each replaced (Revit's own box for the element, along its three axes), against Revit's IFC4 export of Snowdon architectural, against the VIM export of Snowdon, and with the crack probe.

  • The rme pipe fittings fill their boxes to within 0.1 mm on all nine rme files. The same-project gate holds the 2025, 2026 and 2027 saves of rac advanced, rac basic, rme advanced, rme basic and rst basic to their 2024 saves, so it holds these fittings on six of them.
  • No Snowdon body reaches past its box, except the 108 sanitary terminals, by up to 1.4 mm (median 1.0 mm). The five trash chutes fill theirs exactly.
  • Two classes stop short of their boxes, and the VIM does too. All 36 duct fittings are Round Tee:Standard: 21 stop more than 1 cm short, up to 42 mm (36 mm the median of all 36). The four read by axis stop 42 mm short on the low side of two of the box's axes (extents 0.32, 0.30 and 0.32 m). 13 of the 404 air terminals (Supply Grille, Return Grille) stop 10 to 21 mm short on both sides of two axes. On two tees and two grilles read, the VIM's mesh has rvt-rs's height (0.2812 m and 0.1218 m) and its extents within 9 mm, so the space is in the box alone.
  • Snowdon architectural's 7 (a column, five trash chutes and an appliance) were also read against Revit's own IFC4 export of that file, from bldrs-ai/test-models, which is not in Measure. On all 7, Revit's vertices are within 0.001 ft of rvt-rs's surface and the volume is within 0.8 per cent of Revit's. On the column and the five chutes, rvt-rs's vertices stand up to 0.0129 ft off Revit's, so those six would fail the 0.01 ft bar. Revit writes all 7 as explicit facets (IfcPolygonalFaceSet); which of their parts are round is not read.
  • Snowdon HVAC's 440 and plumbing's 108 were read against the VIM export of the model's 2027 edition (vimaec/vim-hackathon: the meshes Revit gave the VIM exporter, for every element of all six documents; kept local), with tools/re/footing_meshes_vs_vim.py --document HVAC|Plumbing:
    • Height and lowest point: all 36 duct fittings and 108 sanitary terminals within 0.001 m of the VIM's, and 391 of the 404 air terminals (the other 13 by 0.00107 m).
    • Volume: the air terminals are 1.1 per cent over the VIM's. The duct fittings are within 8.7 per cent, inside the 30 per cent main's 961 already show.
    • The sanitary terminals' volume figure is not a volume. Three were read shell by shell. Each holds a trap body open in both exports (158 and 110 edges one triangle holds). rvt-rs's reads 0.000930 m³ on all three, and the VIM's reads −0.000145, +0.000220 and +0.001962 m³, so the spread is the VIM's open shell taking its placement into its signed volume. Their closed pipes are 6.2 to 6.7 per cent over the VIM's, whose pipes have about ten sides where rvt-rs's are round.
  • Whether their faces meet: the fix(saved-graphics): a parametric face takes its plane neighbour points along a crossing edge, so the two faces share one boundary (#2094) #2098 crack probe at 06e22382 on every 2024 to 2027 sample (44663576285).
    • Snowdon plumbing: all 121 bodies it reads meet within 0.00093 ft. The rme pipe fittings meet within 0.00092 ft on every save from 2024 to 2027, and the trash chutes and the appliance within 0.00012 ft.
    • Snowdon HVAC: 404 of 440 meet within 0.001 ft. The other 36 are the 36 newly drawn Round Tee:Standard. Each has 32 boundary vertices beyond 0.001 ft, up to 0.00158 ft, all where one cylinder face meets another: 1,152 new gap vertices on bodies this change draws. The probe's commit holds 1ab9c54e with two probe commits on top. With two-loop faces marked (87b23899, 44679890567), each tee's 32 split evenly: 16 on its two-loop face stand off the one-loop cylinder beside it, and 16 on that cylinder stand off the two-loop face. So each face puts points on their shared edge that the other does not hold, the same kind as the 588 between two cylinders that RE-493 left on main. Putting both on the edge's saved points is not done here.
    • Snowdon architectural's column has 4 beyond 0.001 ft, up to 0.0011 ft, where a ruled face meets a plane.
  • Snowdon has one save, so no gate holds its 556 bodies. A box larger than the body says nothing by itself: the sauna doors' boxes are 0.82 m larger than bodies that pass row 2.

Audit-honesty checklist

  • The report (reports/element-framing/RE-494-cylinder-two-trim-loops.md), the changelog fragment and the docs/format-reconnaissance.md addendum follow the decision on the 30 grab bars.

Review

Self-approved by the maintainer session that wrote it, after reading the whole diff again at 968e15f8 (src/research/native_saved_mesh.rs, the report, the changelog fragment and the three docs pages); the second reader is not running. The tees' gaps between two curved faces, and the column's at a plane, are tracked in #2104; Snowdon Plumbing's export passing the 120 MiB Measure validates, in #2103.

Legal and contribution hygiene

  • Apache-2.0; no Autodesk proprietary source, decompiled internals or NDA content (CLEANROOM.md).
  • No new fixtures.

Breaking changes

None: research module internals only.

…e height each, a tube with no seam edge, is meshed as the whole rectangle of its parameters (#1191)
…ame the two-loop reader, and its rings sit exactly on the rectangle the mesher tests for (#1191)
…are refused by which pair they are, a hole, two regions or an open loop (#1191)
…n, a hole or two regions, is meshed band by band across its strips (#1191)
@DrunkOnJava

Copy link
Copy Markdown
Owner Author

The three probe runs, read (each on the BIM4LCA office and housing as built against main at 4e05cfb0, with box_bodies_vs_ifc and mesh_bodies_vs_ifc only).

  1. 44638585587 (91a8e419, the tube reader alone): every two-loop cylinder face on both files is on part of a turn, so none is a tube.
  2. 44639888934 (e9766243, refusing each pair by its shape):
    • on the housing's 4, a hole inside the other loop;
    • on the office's 30 Stay_Wall_Mounted_:VAR-1, both holes and two separate regions;
    • on the office's 15 Sense_Public_allas:PA-3.LE, two separate regions, among other reasons.
  3. 44641101362 (42a94918, band_mesh for those pairs): both groups now draw, and row 2 fails on the office. mesh_bodies_vs_ifc counts each class by: n; volume within 1 per cent and 0.01 per cent; every vertex of each body within 0.01 ft and 0.001 ft of the other's surface; and "ref on ours", every tested vertex of Revit's within 0.001 ft of rvt-rs's surface.
    • The housing's 4 are sauna doors, O-5:O-5.9x21sauna: 4, 4, 0, 4, 0, 0. Their volume and the 0.01 ft bar hold. "Ref on ours" holds on none at its 0.001 ft bar. They are not in the scorer's list of single bodies, so how far Revit's vertices are is not read.
    • The office's 30 Stay_Wall_Mounted_:VAR-1: 30, 0, 0, 0, 0, 0. Each listed one comes out at 1.1098 of Revit's volume, with its farthest vertex 0.01105 ft from the other's surface. By shell, 2 of 5 are equal and 3 are not (0.961 to 1.290 of Revit's), and the scorer reads those as "no round end face in rvt-rs's shell". On one of them the shells hold 0.0276, 0.0239, 0.0099, 0.0005 and 0.0004 ft³, against Revit's 0.0268, 0.0185, 0.0099, 0.0005 and 0.0004.
    • The 15 washbasins stay boxes, for their other reasons.

As registered, the failing bodies are read face by face before anything else, and this stays a draft. The next read is one Stay_Wall_Mounted_:VAR-1 body, starting with its faces made of two separate regions. That label comes only from the two rings' boxes being apart, so it is the reading to doubt. For each two-loop face it reads the envelope's span, each ring's box, and whether the rings run the same way round. A fault elsewhere in these bodies is not ruled out either, since none of their faces was scored before. The sauna doors' Revit vertices are read after that.

@DrunkOnJava DrunkOnJava changed the title feat(saved-graphics): a cylinder face bounded by two full turns at one height each, a tube with no seam edge, is meshed as the whole rectangle of its parameters (#1191) feat(saved-graphics): a cylinder face bounded by two trim loops, a hole, two regions or a seamless tube, is meshed (#1191) Nov 20, 2026
DrunkOnJava added a commit that referenced this pull request Nov 20, 2026
DrunkOnJava added a commit that referenced this pull request Nov 20, 2026
@DrunkOnJava

DrunkOnJava commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner Author

The face-by-face read of Stay_Wall_Mounted_:VAR-1: the faces meet, and Revit's export draws the round bar as a square along its legs.

  1. What the two loops are (probe_2102_cylinder_loops at 6327fb09, kept as refs/archive/2026-11-19/measure-2102-cylinder-loops; runs 44642882250 and 44643861293; 44 two-loop cylinder faces on the office and the housing as built).

    • A ring whose winding matches the face's orientation (the surface's m_orientFlag, flipped by bit 2 of the face's m_faceFlags_v9) is an outer boundary, and the other kind a hole.
    • The two Stay symbols, 1533555 and 1533300, hold the same faces with the orientation the other way round, and every ring's sign flips with it.
    • On that reading, the Stay faces that have two thin bands across them, one at each end of a quarter turn, are two separate regions. That is what band_mesh draws.
    • One face reads otherwise: graph 1059725 face 13, two rings wound alike, an outer of 6 edges with a circle of 2 inside its box. On the housing no body this change draws holds it. The 22 bodies that reach that graph there are showers (11 Suihku 1:SU-1 and 11 Suihku 2:SU-2, IfcSanitaryTerminal), and each still stops at an earlier refusal: a component that needs a qualified owner, or a scaled instance. The four sauna doors' two-loop faces are all in graph 1902301. Read with the crack probe at 1ceb4191, which names each body's two-loop graphs (run 44664659724). On the office the 10 bodies that reach it are showers too (Shower_columns_15486:SU-1), each still refused as a scaled instance (run 44666836079).
  2. Whether the faces meet (the fix(saved-graphics): a parametric face takes its plane neighbour points along a crossing edge, so the two faces share one boundary (#2094) #2098 crack probe, widened to bodies with a two-loop cylinder face, at 06e22382, kept as refs/archive/2026-11-19/measure-2102-cracks; run 44646090830). On each Stay body read, 86 faces, no boundary vertex is more than 0.001 ft from another face (the largest 0.000878 ft). So the faces meet, within 0.001 ft.

  3. Shell by shell (body 1832497, from Revit's export and from this head's, run 44647177201 with the export kept). Each body is split into its connected shells, and each shell is read by what a turn of the site cannot change: its volume, its area, and its extents along its own principal axes, in metres. Those axes are each mesh's own, so the extents of a round bar and a square one differ where their axes do; moved into one frame, the bars' boxes agree (item 6).

    shell Revit: volume, area, extents rvt-rs: volume, area, extents
    1 0.000758, 0.0902, 0.559 × 0.142 × 0.047 0.000780, 0.0912, 0.559 × 0.142 × 0.048
    2 0.000525, 0.1169, 0.805 × 0.167 × 0.033 0.000677, 0.1244, 0.803 × 0.173 × 0.033
    3 0.000281, 0.1522, 0.301 × 0.105 × 0.082 0.000281, 0.1522, 0.301 × 0.105 × 0.081
    4 0.000013, 0.0041, 0.034 × 0.034 × 0.014 0.000013, 0.0041, 0.032 × 0.032 × 0.014
    5 0.000012, 0.0046, 0.040 × 0.032 × 0.016 0.000010, 0.0046, 0.042 × 0.032 × 0.016
    • Every shell of Revit's is closed and wound one way round, welded at 1e-6 m.
    • rvt-rs's shells 2 and 4 are too. Shells 1, 3 and 5 have edges that one triangle holds (138, 8 and 70 at that weld), so their signed volumes are not comparable; on the mirror body 2633695, shell 5 is 0.000005 where it is 0.000010 here.
    • So shell 2, the bar, is the difference: closed, with 29 per cent more volume and 6 per cent more area than Revit's. Over the whole body rvt-rs's volume is 1.11 of Revit's, which is what row 2 judges.
  4. Which way the bar is off (far_vertices_vs_ifc's report at dab3b0f7 on IfcFurniture 1832497, each export in its own site frame, in feet).

    • Revit's vertices are within 0.0051 ft of rvt-rs's surface; 76 of 1,083 are beyond 0.001 ft.
    • rvt-rs's are up to 0.0116 ft off Revit's surface: over the body, 1,835 of 3,611 beyond 0.001 ft and 56 beyond 0.01 ft, and the farthest the scorer lists lie along the bar's two sides.
    • Revit writes this body as explicit facets, five IfcPolygonalFaceSet in a mapped item, so the flats below are Revit's own drawing, not IfcOpenShell's tessellation of a curved solid.
  5. The bar's section. The bar is a U of two straight legs 0.1035 m apart. Each export's bar shell was cut square to its legs: Revit's at nine places, rvt-rs's at three, at fractions of the shell's length.

    • rvt-rs: a round of radius 0.0110 m on both legs, section 0.000377 m². The one exception is one leg at 0.9, where the cut meets the bend at the bar's far end (0.000388 m²).
    • Revit, at 0.3, 0.4, 0.5 and 0.6 on both legs and at 0.7 on one: a square. Its corners are 0.0110 m from the leg's centre, on rvt-rs's round. Its section is 0.000241 to 0.000247 m², twice that radius squared; some cuts carry extra points on its flats. At 0.1, 0.2, 0.8 and 0.9, and on the other leg at 0.7, the section has 25 to 48 points and 0.000265 to 0.000400 m².
    • A square in that round leaves the round's points up to 0.0032 m (0.0106 ft) off its flats. The cuts read flats down to 0.00763 m from the centre (0.0111 ft). rvt-rs's farthest points are 0.0112 to 0.0115 ft along the legs and 0.0116 ft near the bend; the last 0.0001 to 0.0005 ft is not read.
  6. Every one of the 76 Revit vertices beyond 0.001 ft, placed against rvt-rs's surface. Inside or outside is read by a ray's crossings of the nearest closed shell of rvt-rs's.

    • 26 are on the bar, all in the plane of its U. 15 are at the U's bend and 11 at the bar's other end, where one leg turns again.
    • At the U's bend, 9 are inside rvt-rs's bar (up to 0.0051 ft) and 6 outside (up to 0.0045 ft). The 6 outside are all between the legs, on the bend's inner side.
    • The figures below are about a centre midway between the legs, 0.2059 ft in from rvt-rs's tip. That is the centre of the half round that legs 0.1035 m apart with a 0.0110 m radius make: its radii are 0.2059 ft outside and 0.1337 ft inside.
    • Five of the 9 inside lie 0.2006 to 0.2007 ft from that centre, at 0°, ±25.7° and ±51.4° from the tip. Those are the middles of straight pieces of 25.7° whose ends lie on the 0.2059 ft round: such a middle is 0.0052 ft in. The one end read, at 12.9° from the tip, is 0.2059 ft from the centre. The other four are at ±80.0° (0.2009 ft) and ±85.0° (0.2026 ft), where the bend meets the legs, and do not fit pieces of that size.
    • The 6 outside lie 0.1290 to 0.1291 ft from the centre, at ±15°, ±45° and ±75°. Those are the middles of straight pieces of 30° whose ends lie on the 0.1337 ft inner round: such a middle is 0.0046 ft out, into the space between the legs, and 0.0045 ft is measured.
    • At the other end, 7 are inside (up to 0.0036 ft) and 4 outside (0.0032 ft). A circle through the 7 inside has radius 0.1987 ft (each within 0.0005 ft of it), and the 4 outside are 0.1261 to 0.1266 ft from its centre, 0.0722 ft less, the bar's width. So they are the outer and inner side of a turn there. Its pieces are not read.
    • The other 50 are on shell 1 (0.559 m long), up to 0.0022 ft. That shell in rvt-rs's export has edges only one triangle holds at a 1e-6 m weld (the faces meet within 0.001 ft, item 2), so which side they are on is not read.
    • Moved into one frame, the two bars' boxes agree within 0.0001 ft on five sides. On the sixth, rvt-rs's reaches the U-bend's tip, 0.0052 ft past Revit's flat.
  7. Both shapes. Revit's export maps the 30 bodies on two shapes, 15 each, mirror images of each other. One of each was read, 1832497 above and 1832498, which was cut at five places. They give the same figures: the same sections, 76 Revit vertices beyond 0.001 ft placed the same way, and the body's volume 1.108 and 1.109 of Revit's.

So the two differences row 2 measures on these bodies come from Revit's export drawing the round bar with a few large flats. The body has 1.11 of Revit's volume (the bar 1.29), and rvt-rs's points stand up to 0.0116 ft off Revit's. Revit's flats are a square along the legs and, on the U-bend, straight pieces whose ends lie on rvt-rs's round. Row 2 stays failed on these 30 bodies. They ship drawn round, as the file saves them, with that miss on record (decided 2026-11-20; RE-494).

The four sauna doors pass row 2 as registered. The "0.01 ft" count takes the larger of the two directions, and all four are within it and within 1 per cent of Revit's volume. Their "0.001 ft" and "ref on ours" counts fail. Revit writes the doors as explicit facets too (14 IfcPolygonalFaceSet). Of one door's 1,752 Revit vertices, 366 are beyond 0.001 ft of rvt-rs's surface, all within 0.0043 ft. On the two closed shells whose side can be read, 84 are inside rvt-rs's surface, up to 0.0043 ft, and 36 are outside, up to 0.0014 ft: mostly inside, as on the bar's bend. Whether they are flats of the same kind is not read.

…stay refused, since no saved file read has one (#1191)

The loops probe found no such face on the BIM4LCA office and housing or on
any 2024 to 2027 Autodesk sample: every two-loop cylinder face there covers
part of a turn and is meshed by band_mesh. tube_trim and the open ring it
needed are removed, so ring_impl is as on main.
…part of a turn, and the grab bars Revit's export draws square (#2102) (RE-494)
@DrunkOnJava
DrunkOnJava marked this pull request as ready for review November 20, 2026 05:47
@shifatrHtH

Copy link
Copy Markdown
Contributor

@DrunkOnJava I tried 968e15f8 on a separate private Revit 2024 save. The new two-loop path is reached and reports cylinder trim rings cross a strip an odd number of times. I reproduced that predicate failure with the following wholly synthetic UV rings, generated independently of the save:

outer = [(0,0), (2,0), (2,2), (0,2)]
hole  = [(0.5-1.5e-9,0.5), (1.5-1.5e-9,0.5),
         (1.5-1.5e-9,1.5), (0.5-0.3e-9,1.5)]
U grid = multiples of 0.125 from 0 to 2, plus all ring U knots

For the strip from 0.4999999997 to 0.5, the existing band_mesh predicate counts five crossings. The open strip midpoint has four. The endpoint tolerance (1e-9) can admit an edge that ends just before that midpoint because the grid only deduplicates U knots within 1e-12.

In a scratch variant, I kept the endpoint range checks and used lo[0] < mid && hi[0] > mid for the crossing membership. The original function refused the synthetic input. The variant emitted 58 triangles and recovered the expected synthetic UV area of 3.000000000600. On the private save, the odd-strip refusal cleared. The next failure exposed was shared edge surface samples disagree, and the affected bodies still had other incomplete faces, including disconnected UV boundaries.

Would a small midpoint-membership patch with a synthetic contract case be useful on this PR, or would you prefer it as a follow-up after #2102 lands? I can run whichever version you prefer locally and share aggregate decoder outcomes.

@DrunkOnJava
DrunkOnJava merged commit d450e95 into main Nov 20, 2026
37 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/cylinder-tube-loops branch November 20, 2026 06:25
DrunkOnJava added a commit that referenced this pull request Nov 20, 2026
…2106)

## Summary

Count a cylinder trim edge only when it crosses the midpoint of the open
U strip. The endpoint tolerance still checks that the edge spans the
strip.

## Motivation

The two-loop cylinder path added by #2102 can count an edge outside a
very narrow strip. It retains U knots at a tighter tolerance than the
endpoint coverage check. On the synthetic two-ring case the wider check
counts five crossings where the midpoint has four, and refuses the trim.

## Changes

- Use the strip midpoint for crossing membership in `band_mesh`.
- ~~Add a synthetic cylinder contract through the public research
decoder.~~ The case is tested beside `band_mesh` as a pure helper's
failure modes (`327a710f`, by the maintainer; see the review comment),
and `05b94b05` keeps each crossing on its ring edge.
- A changelog fragment.

## Testing

- Merged main at `d450e954` with the new contract fails with `cylinder
trim rings cross a strip an odd number of times`.
- With the patch, `cargo test --offline -p rvt --profile ci --test
integration cylinder_trim_contract::` passes. The recovered synthetic UV
area is `3.000000000600`.
- `cargo fmt --all -- --check`, `tools/ci/verify-real-files.sh
--check-only`, and `python3 tools/release/changelog.py check` passed.
- `tools/check-local.sh` passed with its default checks. The optional
external corpus and new Measure run remain pending.
- The local private validation cleared this refusal and kept the other
incomplete faces visible in diagnostics. A new public real-file Measure
run would establish the wider export impact.

**Maintainer's note:** the first commit's contract is now three tests in
`src/research/native_saved_mesh.rs`'s test module, which CI's `cargo
test --profile ci --lib` runs (all three pass on `05b94b05`); the
Testing lines above describe the first commit.

## Audit-honesty checklist

- The case verifies crossing membership and hole preservation on
synthetic geometry.
- The changelog records this narrow correction.
- Broader export fidelity and performance are outside the synthetic
contract.

## Legal and contribution hygiene

- The changes are suitable for Apache-2.0.
- The contract uses an independently generated synthetic graph.
- The diff contains generic source changes, synthetic test values, and
its registration.

## Breaking changes

None.

## Output samples

```text
before: cylinder trim rings cross a strip an odd number of times
after: cylinder_two_loops_keep_the_hole_across_close_u_knots ... ok
```

## Related issues

Refs #1191 and #2102. Follow-up to the [synthetic
reproduction](#2102 (comment)).

---------

Co-authored-by: Griffin Long <[email protected]>
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