There are many objects in my scene, and I am currently working on cutting and inspecting a curved pipeline in my project. I found that material.clipPlane can achieve it, but when I dynamically control the cutting in the horizontal direction, I found that if the cutting position has a certain angle with the horizontal direction, a diagonal plane will appear, and what I want may be an equal plane.
This is my small case: https://playground.babylonjs.com/#EHLHNX#148
Having a look at your screenshots, I think what you mean is that you want a circular cut of your tube, instead of an elliptic one, right ?
1 Like
yes !!!
Then it comes from your clip plane definition. You are not adapting the normal, while the angle of the tube is not constant. Result is an (intended) elliptic cut.
What you need is to define your clip plane using a point + a normal.
Here is an example with :
- A function to get a parametric point along the path (0 = first point, 1 = last point, in between is interpolated)
- A normal got from vector delta t, with t as param (from t to t+0.01)
- pros : This will always get a circular cut
- cons : Clip plane is global to the mesh, and depending on the mesh geometry, it might cut several parts of the mesh at once
2 Likes
nice!
So, how to make the incision appear closed? At present, the middle of the cut is empty