Alaanor
Alaanor

Reputation: 255

Is it possible to programming/generate a file for 3D printable object?

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

Answers (2)

fgheorghe
fgheorghe

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

Jonathan Mee
Jonathan Mee

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 vertexs.

The facet's normal property and the vertexs use space separated floats.

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

Related Questions