Repository navigation
Description
Describe the bug 📝
EdgeProjector.get pre-filters the meshes with the visibility culler (EdgeProjectorVisibilityCuller, packages/core/src/fragments/EdgeProjector/index.ts, 3.6.0, lines 218–237), an ID render of the scene seen along the projection at cullerPixelsPerMeter (0.05 m per pixel by default). A mesh that covers less than one pixel of that render is reported as not visible even when nothing hides it, so ProjectionGenerator never projects it: none of its edges come out, neither visible nor hidden.
In sections and elevations this hits thin layers seen edge-on: a 2 cm render coat at the end of a wall, a 1.5 cm plasterboard ceiling cut across a room, thin panels. The TODO at projection/VisibilityCuller.js:63 describes the same misses. Lowering cullerPixelsPerMeter fixes it only down to the thinnest element, and the render grows with the square of the resolution.
Measured on a real model (a hospital section, 6 m deep): 447 culled meshes are thinner than two culler pixels in the drawing plane; an exact test finds 89 of them visible, and adding them back adds 71 m (+3.5 %) of visible lines, all of them missing elements (ceiling boards, wall panels), for 65 ms. In a reflected ceiling plan of another storey, 166 of 207 come back. For wider meshes the culler is right: if it removes them, they are hidden.
Suggested fix (a conservative pass). After culling, take the meshes it removed whose extent in the view plane (their box across the projection direction) is under about two culler pixels, and either keep them or test them exactly: cast a few rays from interior points of their faces towards the viewer against the BVHs the generator already builds, and keep the mesh if any ray gets out. That is what we do today by wrapping generator.generateAsync; it only looks at the thin culled meshes, so it stays cheap. We can share it as a PR.
Reproduction ▶️
No response
Steps to reproduce 🔢
- Build a scene with a thin box seen edge-on by the projection, with nothing in front of it: for example a box 3 m long, 2.5 m high and 0.02 m thick, projected along its thickness (an elevation of its end) or, for a plan, a 0.015 m thick horizontal board seen from its side in a section.
EdgeProjector.get(...)with the defaultcullerPixelsPerMeter(0.05): the box's edges are missing.- Set
cullerPixelsPerMeter = 0.005and project again: they appear.
System Info 💻
OS: Windows 11 Pro 10.0.26200
Node: 22.17.0 · npm 10.9.2
Browser: Chrome 155
@thatopen/components 3.6.0 · @thatopen/fragments 3.6.0 · web-ifc 0.0.77 · three 0.185.0Used Package Manager 📦
npm
Error Trace/Logs 📃
No response
Validations ✅
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a repository issue and not a framework-specific issue. For example, if it's a THREE.js related bug, it should likely be reported to mrdoob/threejs instead.
- Check that this is a concrete bug. For Q&A join our Community.
- The provided reproduction is a minimal reproducible example of the bug.
Activity