Filter löschen
Filter löschen

how to check the length of stl model edge in matlab

9 Ansichten (letzte 30 Tage)
LIN Hongbin
LIN Hongbin am 17 Jan. 2016
Kommentiert: LIN Hongbin am 19 Apr. 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.

Antworten (1)

Sleh Eddine Brika
Sleh Eddine Brika am 13 Apr. 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

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by