- stlwrite - write ASCII or Binary STL files(STLファイルへの出力)
- surf2solid - make a solid volume from a surface for 3D printing(構造体を構築する関数)
曲線をstlデータにする方法
22 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
求めた曲線に厚みと幅を加えて,stlデータを取得したいです.
具体的に言いますと,
x=(0:pi/100:2*pi);
y=sin(x);
plot(x,y)
これでsin波を求めることができますが,このsin波の線の幅が2cm,奥行きが4cm,xの長さが6cmの,波打ってる壁のようなstlデータを取得することは可能なのでしょうか.
もし可能ならば,stlデータを作る方法を教えて頂けると幸いです.
0 Commenti
Risposta accettata
michio
il 8 Ago 2019
File Exchange で公開されている関数でよさそうなものがあったのでやってみました。
使うのは以下の2つです。それぞれダウンロードしてください。
以下サンプルコードです。
n = 100; % 曲線の分割数
width = 1; % 奥行
height = 1; % 幅
% ベースとなる曲面を構築
x = linspace(0,2*pi,n); % x座標
y = linspace(0,width,n); % y座標
[X,Y] = meshgrid(x,y);
Z = sin(X); % z座標
% 厚みを加えて構造体とする
% surf2solid(X,Y,Z,'thickness',height); % 可視化用
% F(面情報) V(頂点座標)に書き出し
[F,V] = surf2solid(X,Y,Z,'thickness',-0.1);
% STL ファイルに出力
stlwrite('test.stl',F,V);
% 試しに可視化(以下はPDE Toolboxが必要です)
model = createpde(1);
importGeometry(model,'test.stl');
pdegplot(model,'FaceLabels','on')
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su STL (STereoLithography) in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!