![img.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/219702/img.png)
How can I convert a surf plot into a binary volume mask?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Alexander Dumont
am 15 Mai 2019
Kommentiert: darova
am 15 Mai 2019
I am trying to recreat a shape in MATLAB, specificaly, a capsule. I use MATLAB's piecewise function to produce a line that I want, and then I pass that line to the cylinder method of MATLAB. The resultant looks ike this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/219674/image.jpeg)
And this is exactly the shape I want. However, I need to convert this surf plot with 2-dimensonal data for X,Y and Z into a volume plot, which I can then convert into a mask. I've tried surf2solid, which works but gets me no nearer to my answer, and I've tried polygon2voxel, which fails because when I use the patch function it returns different size vertices and faces. Any help would be greatly appreciated!
1 Kommentar
darova
am 15 Mai 2019
What kind of data do you have and what do you expect to reach?
Can't you just scale your data?
![img.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/219702/img.png)
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!