Import file .stl - parameters
古いコメントを表示
I would like to import an .stl file. I proceeded like this:
fv = stlread('EXAMPLE.stl');
patch(fv,'FaceColor', [0.8 0.8 1.0], ...
'EdgeColor', 'none', ...
'FaceLighting', 'gouraud', ...
'AmbientStrength', 0.15);
grid off
hold on
axis equal
But I wanted to get a figure with the outline. What should I change?
回答 (1 件)
Pratheek Punchathody
2020 年 11 月 17 日
Look into the following code which imports the sample .stl file into MATLAB and adds the geometry to the PDE model.
In the “pdegplot()” function change the parameter “FaceAlpha” to "0" so that only edges are shown from the geometry present in the .stl file
model = createpde;
importGeometry(model,'cube.stl');
pdegplot(model,'FaceLabel','on', 'FaceAlpha',0)
Results of the about code with the sample cube geometry is as shown below.
With “FaceAlpha = 1”

Results of the about code with the sample cube geometry is as shown below.
With “FaceAlpha = 0”

2 件のコメント
Alberto Acri
2020 年 11 月 17 日
DGM
2025 年 7 月 14 日
Why is the answer always to use the PDE toolbox tools for general STL import?
It doesn't answer this question. For what appears to be the meaning of "the outline", the answer would simply be to use an EdgeColor other than 'none'. Instead, you sent OP on a wild goose chase to try and get the facet edges of the original model to show in pdegplot(). You're leading the user away from the thing they asked for.
カテゴリ
ヘルプ センター および File Exchange で Geometry and Mesh についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!