3-D patch with polygons having different number of vertices not coloring faces with polygons padded with NaNs

1 回表示 (過去 30 日間)
Here's a simple example where the two polygons with three vertices were padded with NaNs and then with the last vertex repeated. I'd like to keep the NaNs form as I use the vertex data later, and the NaNs would make those computations more efficient.
x=[1 0 0 1;0 0 0 0;1 0 0 1;1 0 0 NaN;1 0 0 NaN]'; y=[0 1 1 0;0 1 1 0;0 0 0 0;0 1 0 NaN;0 1 0 NaN]'; z=[0 0 1 1;0 0 1 1;0 0 1 1;0 0 0 NaN;1 1 1 NaN]'; C(1,1:3,:)=ones(3,1)*[1 0 0]; %red C(1,4,:)=[0 1 0]; %green C(1,5,:)=[0 0 1]; %blue figure,patch(x,y,z,C) view(-37.5+180,30)
x=[1 0 0 1;0 0 0 0;1 0 0 1;1 0 0 0;1 0 0 0]'; y=[0 1 1 0;0 1 1 0;0 0 0 0;0 1 0 0;0 1 0 0]'; z=[0 0 1 1;0 0 1 1;0 0 1 1;0 0 0 0;1 1 1 1]'; C(1,1:3,:)=ones(3,1)*[1 0 0]; %red C(1,4,:)=[0 1 0]; %green C(1,5,:)=[0 0 1]; %blue figure,patch(x,y,z,C) view(-37.5+180,30)

回答 (0 件)

カテゴリ

Help Center および File ExchangePolygons についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by