Effacer les filtres
Effacer les filtres

how to check the length of stl model edge in matlab

9 vues (au cours des 30 derniers jours)
LIN Hongbin
LIN Hongbin le 17 Jan 2016
Commenté : LIN Hongbin le 19 Avr 2017
I drew a cubic whose lengeh is 1mm formating stl.After importing the stl model into matlab,I got p(the coordinate of all the vertexes or points),tnorm(all the face normals) and t(all the triangles contains the indexes of the composed points of each triangle),but I want to find all the edges that are longer than 0.5mm,and interpolate a midpoint.How can I make it? Thank you.

Réponses (1)

Sleh Eddine Brika
Sleh Eddine Brika le 13 Avr 2017
I hope you already find a solution for this but anyway I am going to answer that if anyone needs it.
%Import the STL file
model = createpde(1);
b=importGeometry(model,'C:\...\filename.stl'); % Put your file name here
g=model.Geometry;
%Calculate the edges length
[Ex, Ey, Ez] = g.allDisplayEdges(); %list of edges
c=(sqrt((Ex(1,:)-Ex(2,:)).^2+(Ey(1,:)-Ey(2,:)).^2+(Ez(1,:)-Ez(2,:)).^2));%the matrix with the length of each edge

Catégories

En savoir plus sur 2-D and 3-D Plots 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