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?
조회 수: 15 (최근 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!