Effacer les filtres
Effacer les filtres

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

8 vues (au cours des 30 derniers jours)
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 commentaires
Rik
Rik le 25 Mar 2022
How is this different from your other question?
Have a read here and here. It will greatly improve your chances of getting an answer.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Voronoi Diagram dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by