How to cut a 3D object using a plane and deleting the part above the plane, but creating new faces/vertices based on the points to ensure that the geometry below the cut is maintained?

69 ビュー (過去 30 日間)
I am working with an stl file (faces, vertices, normals, etc) and have been able to establish a plane, find the coordinates of the points where the plane intersects the edges of the 3D objects, but am not able to modify the the stl file in such a way that I keep all the geometry intact below the plane cut but remove the geometry above the plane cut.
More clarification using an analogy: Imagine you had a donut in real life that you sliced using a knife to create 2 crescent shaped halves. Now I am trying to solve the same problem using matlab and an stl file. I have the donut, I have the knife (the plane), I know all the new vertices that should be formed when the knife cuts, I am just not able to cut it in such a way that the solid part of the donut is still present and the hole (well a semicircular hole after cutting) is also present.
Is there someone who has expertise in this area and could help me out please :) Thank you!
  5 件のコメント
Anshuman Agrawal
Anshuman Agrawal 2019 年 5 月 31 日
Thank you for helping me! Greatly appreciate the help!
Ismaeel Zaman
Ismaeel Zaman 2021 年 5 月 16 日
Hi, would you be able to share how you obtained the intersection points from an STL file and a plane?

サインインしてコメントする。

採用された回答

John D'Errico
John D'Errico 2019 年 5 月 30 日
編集済み: John D'Errico 2019 年 5 月 30 日
Pretty simple really. Just the execution that takes some effort.
  1. Identify any simplex that has all vertices above or below the cutting plane. Keep those uncut that are in the region of interest. Discard those that are all outside. The test to see if a vertex is above or below the cutting plane is as simple as a dot product, so just a matrix*vector multiply for all vertices at once.
  2. All simplexes that remain have at least one vertex above, and one below the cutting plane. Operate on these simplexes one at a time.
  3. Retain any vertices that are entirely in the region of interest, or on the plane itself. For any edges of the simplex, locate all edges that cross the cutting plane. Using simple linear interpolation, find the point of crossing.
  4. Combine the set of vertices that are below the cutting plane with those that lie in the cutting plane from this simplex.
  5. Tessellate that set, append the set of simplexes created to those that lie entirely below the cutting plane.
This operation is not that difficult. As I said, it just takes some code.
  6 件のコメント
Anu_M
Anu_M 2020 年 9 月 28 日
Hello,
Is your toolbox still available?
Ismaeel Zaman
Ismaeel Zaman 2021 年 5 月 16 日
Hi I would also like to use this tool box. Is there a download anywhere?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSmoothing and Denoising についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by