Skip to content

feat(saved-graphics): mesh cone faces, spline-profile surfaces and cylinder faces with non-rectangular trims #1144

Closed

Description

@n3ur0m4n

rvt-gltf --saved-meshes keeps an element's box where part of its saved graphics does not decode (RE-224,
#995). On the reference models, three gaps in the saved-graphics mesher leave 23 elements as boxes although
their saved graphics hold the whole body:

  • cylinder faces whose trim is not a rectangle in (u, v): nonrectangular cylinder trim, 11 elements (welded
    tees and other fittings in RE1-Plumbing, a toilet in RE1-Architecture);
  • faces on ConeSurf: unsupported surface ConeSurf, 9 elements (8 pipe transitions and fittings in
    RE1-Plumbing, a shower head in RE1-Architecture);
  • surfaces whose profile curve is a GNurbSpline or GHermiteSpline: unsupported parametric profile curve,
    2 elements in RE1-Electrical (a BAS panel and a fire alarm panel).

Elements drawn from their saved mesh / drawn as a box, rvt-gltf --saved-meshes on main (113f67c) and
with the change:

model now with the change
RE1-Architecture 51 / 25 53 / 23
RE1-Electrical 45 / 4 47 / 2
RE1-Plumbing 41 / 20 60 / 1
RE1-Mechanical 68 / 0 68 / 0
2024_Core_Interior 138 / 392 138 / 392

No element drawn from its saved mesh today changes source.

Distance to the meshes of the reference IFC exports in _project_corpus/IFC Exports (the larger of
reference-to-mesh and mesh-to-reference, over the vertices), in feet:

model elements now (box) with the change
RE1-Plumbing 19 0.028 to 0.099 0.0038 to 0.0083
RE1-Architecture 2 0.76, 1.33 0.010, 0.013
RE1-Electrical 2 0.049, 0.049 0.0079, 0.0057

For scale, the 41 RE1-Plumbing elements main already draws from their saved mesh are at 0.0093 ft (median),
0.019 ft (90th percentile) and 0.035 ft (largest) from the same exports. The boxes of 21 of the 23 already
match the reference within 0.0001 ft: what the change adds is the shape.

One cost to settle first: the grids are dense. A welded tee comes out at 9,960 triangles where the reference
export has 96, and the BAS panel at 221,630 against 29,610; the 23 elements add about 411,000 triangles, and
RE1-Electrical's .glb grows from 0.18 MB to 4.5 MB. I would make the chord tolerance coarser in the pull
request, unless you prefer a different limit.

Proposal, in the mesher behind research::native_saved_scene (research modules, no public API change):

  • ConeSurf read as a surface of revolution of a straight generator through the apex, parameterised as Revit's
    saved edges show (checked on the edge each cone face shares with a planar face);
  • GNurbSpline and GHermiteSpline profile curves (and HermiteSurf), with the grid refined per span by
    curvature;
  • parametric faces whose trims are not (u, v) rectangles (arc edges, boundary edges), their free edges closed
    and welded to the neighbouring faces within 1e-4 ft.

Each comes with a real test on the RE1 models that checks the elements' source and their distance to the
reference export (skipped when RVT_PROJECT_CORPUS_DIR is unset), and no unit tests. A pull request per
point follows if the direction is right.

Activity

  1. DrunkOnJava commented on Oct 30, 2026

    @DrunkOnJava
    Owner

    Thank you, this is well measured, and the direction is right: cone faces, spline profiles and non-rectangular cylinder trims, each as its own pull request with a real-class test on the RE1 models, is exactly how we would want it. A few things to settle before the first PR.

    Density. Pick the chord tolerance by what the scorers can tell, not by fineness. Your distances to the reference (0.0038 to 0.0083 ft) are mostly the reference's own tessellation error: Revit's export draws the tee with 96 triangles. So take the coarsest tolerance whose distance to the reference export stays within what the saved meshes main already draws reach on RE1-Plumbing (median 0.0093 ft, 90th percentile 0.019 ft). In each PR, report per element:

    • the triangle count against the reference's;
    • the distance;
    • each model's .glb size before and after.

    RE1-Electrical growing from 0.18 MB to 4.5 MB would hurt the browser viewer, which draws the same meshes. Something within a small multiple of today's size is what to aim for.

    Scope. Doors and windows are drawn from their saved meshes by default since 0.11.0. Every other class, including these fittings, toilets, shower heads and panels, needs --saved-meshes. So these PRs change only the opt-in output, plus any door or window whose graphics hit the same faces. Please say in each PR whether a door or window moves.

    Measurement. For each PR I will run Measure on your head (-f base=main with the RE1 models and the BIM4LCA office), so we see every export that changes, not only the 23. The office has many more fittings and curved families than RE1. A face type that meshes right on RE1 but wrong there shows up as a distance jump in mesh_bodies_vs_ifc. The bar is no element further from Revit's body than its box was, and nothing drawn today changing.

    Clean room. Parameterising ConeSurf from the saved edges, as you describe, is byte observation and fine. Keep any comparison with Revit's exporter to reading revit-ifc's source and citing it, as CLEANROOM.md says.

    Go ahead with whichever of the three you prefer first. The cylinder trims cover the most elements.

  2. added
    area:geometry
    area:ifc
    priority:P2
    type:feature
    community
    on Oct 30, 2026
  3. DrunkOnJava commented on Nov 3, 2026

    @DrunkOnJava
    Owner

    Hi @n3ur0m4n, a quick heads-up so your time isn't duplicated: while working on #1247 we started on cylinder faces with non-rectangular trims ourselves, since they turned out to be the largest remaining reason saved meshes fall back to boxes. If you already have work on that part, please let us know and we'll compare before anything lands. Cone faces and spline-profile surfaces are still yours if you'd like them. Thank you again for the careful measurements in your proposal!

  4. DrunkOnJava commented on Nov 3, 2026

    @DrunkOnJava
    Owner

    Hi @n3ur0m4n, a follow-up to my comment this morning: we're going to start on cone faces (ConeSurf) and spline-profile surfaces (GNurbSpline, GHermiteSpline, HermiteSurf) ourselves now, measured against the RE1 exports the way your proposal lays out. If you already have work on either, please say so and we'll compare before anything lands. Thank you again for the proposal and its careful measurements!

  5. 13 remaining items

  6. DrunkOnJava commented on Nov 5, 2026

    @DrunkOnJava
    Owner

    Hi @n3ur0m4n, here is where your proposal ended up. All three gaps have an answer now, and your measurements set the bar each one was held to.

    Those trims are tracked in #1191, so I'm closing this. Thank you for the proposal and its careful measurements.

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:geometryarea:ifccommunitypriority:P2type:feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions