Can I solidify a curve?

11 ビュー (過去 30 日間)
Rene Suchantke
Rene Suchantke 2015 年 3 月 23 日
編集済み: DGM 2025 年 7 月 29 日
Hi guys,
I am looking for a way to solidify a curve and later export this as an .stl file.
I found a function (<http://www.mathworks.com/matlabcentral/fileexchange/42876-surf2solid-make-a-solid-volume-from-a-surface-for-3d-printing>) which solidifies a surface.
I got a pretty complex curve (plotted using ezplot3) in 3D space and now want it to be a solid tube-like strutcture instead of a thin line.
Thank you very much.
Rene

採用された回答

Rene Suchantke
Rene Suchantke 2015 年 3 月 23 日
移動済み: DGM 2025 年 4 月 5 日
I have just found what I wanted in the fileExchange: http://www.mathworks.com/matlabcentral/fileexchange/5562-tubeplot and similar....I will try it out and maybe come back with additional questions... nevertheless thank you!
  1 件のコメント
DGM
DGM 2025 年 4 月 5 日
編集済み: DGM 2025 年 7 月 29 日
Since tubeplot() produces a closed surface, surf2solid() isn't needed. The output will still be gridded data and will need to be trianglated and written to a file.
Tools like surf2stl() or Sven's old stlwrite() can triangulate the gridded data and write it. Alternatively, surf2patch() can be used to do the triangulation, leaving the user other options for writing the file.
In modern versions, we don't need those third party tools anymore. We can just use surf2patch() and stlwrite().
% get the gridded data
t = linspace(0,2*pi,50);
[x,y,z] = tubeplot([cos(t);sin(t);0.2*(t-pi).^2],0.1); %FEX #5562
% visualize it if desired
surf(x,y,z)
daspect([1,1,1]); camlight;
% circa 2015 (triangulate then encode)
[F V] = surf2patch(x,y,z,'triangles'); % quad to tri
stlWrite('tube1.stl',F,V) % FEX #20922 or #51200
% circa 2015 (let the encoder do both)
%surf2stl('tube2.stl',x,y,z) % FEX #4512
stlWrite('tube2.stl',x,y,z,'triangulation','f') % FEX #20922 or #51200
% modern versions (R2018b+)
[F V] = surf2patch(x,y,z,'triangles'); % quad to tri
T = triangulation(F,V); % put it in a triangulation object
stlwrite(T,'tube3.stl') % this is built-in

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOctave についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by