Reputation: 255
I want to know if is it possible to generate with a PHP library or C/C++ or an another language a 3D object printable. Like the .stl files.
Upvotes: 3
Views: 2182
Reputation: 1
Try this library: https://packagist.org/packages/php3d/stl. It lets you manipulate STL files - I wrote it a few weeks back, and is still experimental, but you might find it useful.
This one here lets you convert STL files to G-Code or SVG: https://packagist.org/packages/php3d/stlslice
Again, experimental, but you can easily change the code to suit your needs.
Upvotes: 0
Reputation: 38939
You can easily write your own .stl
ASCII files: http://en.wikipedia.org/wiki/STL_(file_format)#ASCII_STL
.stl
files will always begin and end with a solid
tag containing any number of facets
.
Each facet
will have a normal
property and contain an outer loop
tag which will hold your vertex
s.
The facet
's normal
property and the vertex
s use space separated float
s.
All this is easily accomplished in C++, C, or PHP.
You can see an example of a simple cube here: http://people.sc.fsu.edu/~jburkardt/data/stla/stla.html
Upvotes: 1