I would like to know how to store faces and vertices in order to generate an stlwrite file for the entire structure

1 回表示 (過去 30 日間)
code: This code will generarte one stl file with one vornoi polygon since I am not storing all the faces and vertices of the whole polygon
for k = 1:length(Cel)
if ~isempty(Cel{k})
col=rand(1,3);
Vk = Ver(Cel{k},:); Fk = convhull(Vk);
if exist('mergeCoplanarFaces.m','file')==2
[Vk, Fk] = mergeCoplanarFaces(Vk, Fk);
for i=1:length(Fk)
patch('Vertices',Vk,'Faces',Fk{i},'FaceColor',col,'FaceAlpha',0.3)
end
else
trisurf(Fk,Vk(:,1),Vk(:,2),Vk(:,3),'FaceColor',col, ...
'FaceAlpha', 1,'EdgeAlpha',1,'EdgeColor','k');
end
end
end
grid on
xlabel('X');ylabel('Y');zlabel('Z');
stlwrite('mytriangulation.stl',struct('faces',Fk,'vertices',Vk));
  2 件のコメント
Rik
Rik 2022 年 3 月 25 日
How is this different from your other question?
Have a read here and here. It will greatly improve your chances of getting an answer.

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

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by