Hello,
I want to export a geometry to stl. Here I used a very simple example but it's comparable with my application since I have a geometry defined by a pointcloud.
d = [0 1];[x,y,z] = meshgrid(d,d,d); % a cube
x = [x(:);0];y = [y(:);0];z = [z(:);0];DT = delaunayTriangulation(x,y,z);tetramesh(DT);camorbit(20,0)
I found in a forum that you could use this expression:
stlwrite('Quader.stl',DT.ConnectivityList,DT.Points);
but it didn't work and according to the Matlab website, stlwrite has to have the following structure:
stlwrite(TR,filename)
where TR is a triangulation object. Following this logic, I tried to implement
stlwrite(DT,'Quader.stl');
but I get the error: "Tetrahedron triangulation is not supported."
The following version "works" in a sense that I get an export but it's just 2D instead of 3D
T = delaunay(x,y);tri = triangulation(T,x,y,z);stlwrite(tri,'Quader.stl');
Could you please tell me, where I went wrong and what I have to do to solve this?
Best Answer