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. After loading a model and building geometry, every element reports
hasMesh === false and hasGeometry === false, even though the geometry renders correctly
and el.instances.length > 0. This makes it impossible to use the documented flags to tell
geometric elements apart from non-geometric ones.
Repro.
const viewer = VIM.Core.Webgl.createViewer();
viewer.viewport.reparent(container);
const vim = await viewer.load({ url: 'model.vim' }).getVim();
await vim.load(); // geometry is built; the model is visible
const els = vim.getAllElements();
els.filter(e => e.hasMesh).length; // 0 ❌ (expected: thousands)
els.filter(e => e.hasGeometry).length; // 0 ❌
els.filter(e => e.instances?.length).length; // 2264 ✅ (the real signal)
Expected. After vim.load(), hasMesh is true for elements whose meshes were built,
and hasGeometry is true for elements that have instance definitions.
Actual. Both are false for all elements; only instances.length is reliable.
Impact. The docs point consumers at hasMesh/hasGeometry for filtering; downstream code
that trusts them silently treats every element as non-geometric. instances?.length > 0 is a
leaky fallback — e.g. the 9 OST_Cameras (saved-3D-view cameras, family "3D View") each
report instances: 2 yet getBoundingBox() returns null (no resolvable mesh). A working
hasMesh/hasGeometry would correctly return false for those and serve as the real
"has renderable/measurable geometry" filter (see also #8). Today the only reliable per-element
geometry test is await el.getBoundingBox() != null, which is async and doesn't scale (see #5).
Environment
1.0.0-alpha.0, IIFE build (dist/vim-web.iife.js) loaded via<script>VIM.Core.Webgl.createViewer()(headless, custom UI)Summary. After loading a model and building geometry, every element reports
hasMesh === falseandhasGeometry === false, even though the geometry renders correctlyand
el.instances.length > 0. This makes it impossible to use the documented flags to tellgeometric elements apart from non-geometric ones.
Repro.
Expected. After
vim.load(),hasMeshistruefor elements whose meshes were built,and
hasGeometryistruefor elements that have instance definitions.Actual. Both are
falsefor all elements; onlyinstances.lengthis reliable.Impact. The docs point consumers at
hasMesh/hasGeometryfor filtering; downstream codethat trusts them silently treats every element as non-geometric.
instances?.length > 0is aleaky fallback — e.g. the 9
OST_Cameras(saved-3D-view cameras, family "3D View") eachreport
instances: 2yetgetBoundingBox()returnsnull(no resolvable mesh). A workinghasMesh/hasGeometrywould correctly returnfalsefor those and serve as the real"has renderable/measurable geometry" filter (see also #8). Today the only reliable per-element
geometry test is
await el.getBoundingBox() != null, which is async and doesn't scale (see #5).