I use a plane to cut the mesh through meshcut and get a cut surface. The contour of this section is represented by discrete points, how can I get the perimeter of this contour?
The profile of this section is similar to an ellipse but not a regular shape.Could you give me some advises to compute the perimeter or have you found some code about perimeter computation in meshcut?
More details: Here are the points I got from meshcut. They can be viewed as two-dimensional points. How can I get the convex hull of these discrete points and calculate the perimeter of the convex hull? enter image description here
You have added the
trimesh
tag, so I'm going to suggest a very simple solution using this library applied to the Stanford bunny.Here is our bunny:
Load it (I'm also adding type hints):
We can take a three-dimensional cross-section using a plane by specifying its normal and a point:
We can convert this three-dimensional cross-section to a two-dimensional one.
Let's plot it. As you can see, it's clearly a non-convex shape:
You can get the perimeter of the section as follows: