Question

I have a 3D-point cloud and I want to triangulate them and save as .stl file. I use Delaunay for triangulation:

points = np.array([[x[i], y[i], z[i]] for i in range(len(x))])
tri = Delaunay(points)

but I couldn't find a library which can save this object into a .stl file. Does anyone know a good solution?

Description of my 3D-point cloud: it just describes a surface, so for each (x,y) there is only a single z-value.

Maybe I could try to write my own STL-saver, but therefore I have to know what tri.simplices exactly is returning: As I read in the documentation, I get the indices of my points which forming a triangle - but tri.simplices returns me a set of 4 indices; i expected 3 instead (because a triangle has 3 vertices)?!

Edit: Oh damn, I just figured out why I get 4 indices: It's a tetrahedron. But I don't want to get tetrahedrons out of my point cloud - as I said my point cloud is a surface, I also only want to receive a "surface"-mesh, but no "solid"-mesh. How is this possible?

Btw: I just finished writing my own STL-writer and it works as expected - but it's just ascii-format... does anybody knows how I can save as binary-format?

Was it helpful?

Solution

I found this and if you correct some mistakes then it works: http://www.csar.at/?p=22

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top