Surface to Patch Problem?
显示 更早的评论
Hi All
I've plotted these elipses (left) in matlab with matrices X, Y and Z.
I'm now trying to connect these to form a cylinder with the patch and surf2patch functions.
As you can see(right), not woeking as youd expect. Has anyone had this problem before or know how to get around it.
This is the code to plot (right)
X = [flipud(x_All)];
Y = [flipud(y_All)];
Z = [flipud(z_All)];
figure
patch(surf2patch(X,Y,Z,Z));
shading faceted;
view(3)

1 个评论
Tarunbir Gambhir
2020-12-2
Based on the images, it seems that the corresponding indices for each ellipse are not in proper order. To get the desired result, the points on the ellipse should be ordered such that they are alligned vertically. Lines in the right figure show that indices of points on each ellipse are not alligned properly which creates twisted cylinder surfaces.
If the above does not help in the explanation and resolution of your problem, could you please provide the complete code with data so that we can replicate the issue.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!