Material clipping plane color and shape outline vertices

Hi everyone,
Here is my screen from aplication where green color is intersection with clipping plane.
image

Question is how calculate outline vertices of green shape that appears?
I have buffer geomerty without indexes.

Hi!
There is no out-of-box solution.
Maybe this SO answer will give you some ideas: javascript - Three JS - Find all points where a mesh intersects a plane - Stack Overflow

Yep, I readed it. Is possible and how to optimise calculation? I have only vertices without indexes and problem is that this model is large but other models will be huge.

Try to combine it with this: Three-mesh-bvh: A plugin for fast geometry raycasting and spatial queries!

1 Like

Thanks, I will do that and come back if I succeed.

Ooh that might be a good example to add :thinking:

3 Likes

Here’s a sneak peek of the new mesh bvh demo with a reasonably complicated piece of geometry:

https://gkjohnson.github.io/three-mesh-bvh/example/bundle/clippedEdges.html

It seems to be about 20-100 times faster to use three-mesh-bvh on this model depending on the hardware / clip direction. Of course in this case the geometry has been specifically merged to replicate a more complicated piece of geometry. If a scene is already split into small chunks you may not need something like this. Of course the BVH itself takes memory and time to compute. It’s fun to see it animate, though.

Thanks for the idea @prisoner849!

3 Likes

This is great! :+1:

1 Like