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
706 stars 284 forks source link

[FEATURE SUGGESTION] Reactivate solid caps for single cross-sections #874

Open xeolabs opened 2 years ago

xeolabs commented 2 years ago

Requirement

When slicing an object with a SectionPlane, make the holes appear to be filled, as if the object was solid.

CHuLRQdWwAAD_pe

Solution

Simply renders the interior faces of sliced objects in a uniform non-shaded color. With no shading, the color appears as if it belongs to a polygon that fills the gap.

In the screenshot above, the object is actually a hollow mesh. The blue you're seeing through the hole is actually the internal faces within the mesh. Since those are colored flatly, we have no visual cues that they are interior surfaces, and they appear more or less to belong to a solid cap that covers the hole.

Status

We have this partially implemented, but not activated yet.

Limitations

pbbr commented 1 year ago

@xeolabs Very nice experiment. I've found a interesing approach to solve the problem for multiple planes (https://stackoverflow.com/questions/36557486/three-js-object-clipping). Do you have the possibility to make an experimental implementation with a stencil buffer?