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!
Can I solidify a curve?
5 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
Rene Suchantke
2015-3-23
移动:DGM
2025-4-5
1 个评论
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 Exchange 中查找有关 Octave 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!