xeokit / xeokit-sdk

Open source JavaScript SDK for viewing high-detail, full-precision 3D BIM and AEC models in the Web browser.
https://xeokit.io
Other
738 stars 291 forks source link

Section capabilities? #1392

Closed paireks closed 9 months ago

paireks commented 9 months ago

Hey, I just wanted to make sure if there is already some way to get the sections' intersection lines to display them. If so: I will add such example, because I can't find one.

xeolabs commented 9 months ago

Unfortunately there are no lines that can be queried in javaScript, because the slicing happens entirely in the shader, where the shader discards each fragment that falls on the cutting side of the intersection, as part of the way it shades each rendered triangle,

The best we can do i think is make the shader colorize the pixels that are close to that intersection. That happens here, in several shaders: https://github.com/xeokit/xeokit-sdk/blob/master/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesColorRenderer.js#L212