# How can i transform a surface from mathlab into a 3D-printable file or to get the view in a 3D programm?

13 ビュー (過去 30 日間)
Jan Nabo 2019 年 8 月 22 日

i have just some points from a file, just x and y.
I try to make a surface with those points but the problem is, how can i make that in a 3D File to print a object in 3D-Printer.
The hight from the surface is not clear but the main problem is converting or the information to open that in Blender or 3D-Slicer.

#### 4 件のコメント

Jan Nabo 2019 年 8 月 22 日
where does my stl file saved ? i can't wrote that like that way.
didn't work :(
darova 2019 年 8 月 22 日
Did you create a surface?
Jan Nabo 2019 年 8 月 22 日
yeah like that in the picture, its just x and y points and i have the hight of 1 cm -> so i want to create first of all a 3D-figure -> after that i want to put it in a 3D-printable file but i have to research more

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

### 採用された回答

Jan Nabo 2019 年 9 月 2 日
clear
name='010010_XBlock';
blockdistance=67.2;
blockhoehe=5;
info=dicominfo(name);
sz=size(info.BeamSequence.Item_1.BlockSequence.Item_1.BlockData,1);
b(:,1)=info.BeamSequence.Item_1.BlockSequence.Item_1.BlockData(1:2:sz)/10;
b(:,2)=info.BeamSequence.Item_1.BlockSequence.Item_1.BlockData(2:2:sz)/10;
kx = -10:.1:10;
ky = -10:.1:10;
kz = blockdistance:-0.1:blockdistance-blockhoehe;
sz_x=size(kx,2);
sz_y=size(ky,2);
sz_z=size(kz,2);
bin=nan(sz_y,sz_x,sz_z);
[X,Y] = meshgrid(kx,ky);
for i=1:sz_z
x=kz(i)*b(:,1)/100;
y=kz(i)*b(:,2)/100;
bin(:,:,i)=inpolygon (X,Y,x,y);
end
it works
make_STL_of_Array('test.stl',bin,0.1,0.1,0.1);
only problem is i want to smooth and refine my 3D Object

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

### その他の回答 (1 件)

Chidvi Modala 2019 年 8 月 27 日
surf2solid takes a surface (a function z of (x,y) or (theta,r)) and convert this into a solid, much as meshz does, but a little more useful for outputting as an STL for fabrication in a 3D printer.

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

### Community Treasure Hunt

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

Start Hunting!

Translated by