Skip to content

[Docs] Core.Webgl viewer.load() does not build geometry — clarify the two-step flow #93

Description

@SamuelAB-VIM

Environment

  • vim-web 1.0.0-alpha.0, IIFE build (dist/vim-web.iife.js) loaded via <script>
  • API: VIM.Core.Webgl.createViewer() (headless, custom UI)
  • Chromium / desktop, devicePixelRatio 1.75
  • Model: 2,547 elements (2,264 with geometry), 12 Revit categories, structural

Summary. Docs describe load() as “parses the VIM file, builds 3D geometry, and renders
the scene.” For the headless Core.Webgl viewer, viewer.load(...).getVim() resolves with an
empty canvas — geometry only appears after a separate await vim.load().

Repro.

const vim = await viewer.load({ url: 'model.vim' }).getVim(); // canvas stays blank
await vim.load();                                              // now geometry renders
await viewer.camera.snap().frame('all');                       // frame() lives on snap()/lerp()

Asks.

  • Document the parse-vs-build split for Core.Webgl (and whether React.Webgl differs).
  • Note that camera framing is viewer.camera.snap().frame('all') / lerp(d).frame(target),
    not viewer.camera.frame(...) — the latter throws frame is not a function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions