crop the polygon from the 3D surface
Show older comments
Hi all,
I have such an attached 3D surface and a polygon on it. (Code is provided below)
I aim to crop the portion which is only inside the polygon and delete everything outside the polygon.
I found out the function of "inpolygon", but it did not work well enough since it is for 2D.
Then I encountered with "inpolyhedron" which is written for 3D, but was not that successfull on using it.
Is there any other way that you would suggest?
Thank you
Regards
2 Comments
Kelly Kearney
on 18 Jun 2020
It's difficult to tell from the picture... does all the data (both the surface and polygon) fall along a single plane?
Mammadbaghir Baghirzade
on 18 Jun 2020
Edited: Mammadbaghir Baghirzade
on 18 Jun 2020
Accepted Answer
More Answers (1)
darova
on 20 Jun 2020
0 votes
Here is another idea using triangulation (initmesh)
- create polygon

- use initmesh to triangulate it

- calculate Z coordinate

- rotate the object

5 Comments
Mammadbaghir Baghirzade
on 21 Jun 2020
Mammadbaghir Baghirzade
on 21 Jun 2020
darova
on 21 Jun 2020
try following modifications

Mammadbaghir Baghirzade
on 21 Jun 2020
darova
on 22 Jun 2020

Categories
Find more on Geometry and Mesh in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!