xeokit-sdk
xeokit-sdk copied to clipboard
[FEATURE SUGGESTION] Reactivate solid caps for single cross-sections
Requirement
When slicing an object with a SectionPlane, make the holes appear to be filled, as if the object was solid.
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
-
Works well for one SectionPlane at a time. Does not look good when the object is sliced with multiple SectionPlanes, since then we're able to see in one hole and out the other, ruining the illusion.
-
The caps are not actually shaded, so look a little fake. But that's OK, and we can make them red.
@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?