how to check the length of stl model edge in matlab

13 ビュー (過去 30 日間)
LIN Hongbin
LIN Hongbin 2016 年 1 月 17 日
コメント済み: LIN Hongbin 2017 年 4 月 19 日
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.

回答 (1 件)

Sleh Eddine Brika
Sleh Eddine Brika 2017 年 4 月 13 日
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
  1 件のコメント
LIN Hongbin
LIN Hongbin 2017 年 4 月 19 日
thanks a lot it works well

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

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by