Tag Archives: reverse engineering

Extract STL from Preform project files

The Form1 printer is supposed to be a click and print easy consumer solution. You get a sleek hardware (that still needs some tuning) and a polished software (Preform) that does not let you tweak a lot’s of options. So if for some reason the auto-generated supports are not working or you want to use a non-official polymer, then you are locked by the closed nature of the product.

When I’ve discussed with Formlabs during the SF Maker Fair, they confirmed they had no intention to release the USB protocol and the .FORM file format specification. The result is that if you want to use a Linux OS or another slicer, you are restricted (ex: generate internal supports function does not exist in Preform yet). These limitations do not exist with the B9 printer, as they decided to release everything as open source.

So what can be done? Well we are limited to reverse-engineer the FORM file or the USB protocol. It’s tedious and random: the end result is not guarantied but by doing so You can learn things about the Form1 and maybe fix some short-coming. A few stuff that open protocol/file could do:

  • enable other OS (no need to use visualization in Linux for ex)
  • custom slicer to fine control the supports, generated path, calibratio
  • Compatibility with different resin/polymer by adjusting the curing parameters
  • new cool features like the vat-fogging map

Anyway, with this post let’s start simple by extracting the STL meshes embedded in the .FORM files.

Extracting STL Mesh data from the .FORM

Using  something like Frhed free HEX editor let you peak at the file content, and a little bit a search gives this 80 characters string with “stl” inside… Yes this is, if you remember the STL file format the first field of a binary format file.

formSTLHeader

And when you duplicate the same object, or add another STL, you can see that each STL instance is stored in the .FORM file. More interesting is the fact that preform keeps the STL in its original dimension and orientation. So you can see that even if I scaled and rotated one of the pieces (from here), the extracted STL shows the supports scaled and with an angle.

multiSTLinMesh_rotateNScale

This is telling us, that somewhere in the meta data of the .FORM file you have the position, rotation and scale information. This is stored in binary (not text) format and thus is more complex to extract. I might try to find where it is stored in a later version of my STL extraction program.

The Utility to extract STL mesh data from .FORM files is coded in plain C, so you should be able to recompile it on anything without much issues. The current EXE was compiled using Visual Studio Express 2010 x86, so you might need to install the VS 2010 redistribuable package before using it.

Utility usage is: extractSTL xxx.form
This will extract the STL meshes and save them in “xxx.form_meshN.stl”

The EXE, source code and VS project files are available here.

Happy forming!

[<<Prev. – Form1 might need calibration]    [3D Printer articles]   [Form1 Calibration Procedure – Next>>]