Quote Originally Posted by Mjolinor View Post
Stratasys use a bespoke binary format called CMB that does properly what you are talking about and it is complex. I did a lot of work reversing it.

Here is a starting point. Enjoy.
https://azttm.wordpress.com/2012/09/...b-file-format/
Very interesting, though very inefecient. Each parameter is a float in most of those instructions. A float is 4 bytes, and has a larger range than any 3D printer I am aware of.

Most 3D printers can represent fine moves through the entire range of print with in 12 bits, some are a bit larger, though the largest I am aware of with the most possible points would not use more than 20 bits (24 bits is 3 bytes), so why waste space by using floats? And why waste conversion time by using floats?

Set up the steps per unit, then use integers per unit (which is where mine is likely to end up), assuming a resolution of 0.1mm (seems fairly standard for most 3D printers), that would be 6.5536 meters each direction, for a print using two byte (16 bit) integers. Now as the resolution improves I could see a resolution as low as 0.05 in the future, though that is still over 3.3 meters each direction. And a 24 bit parameter version of a code similar to what I am doing would exceed the limits of any likely 3D printer, even if your prints are the size of a very large house (greater than 167.7 meters at a resolution of 0.1mm or 83.8 at resolution of 0.05mm).

So why the waste of space in data and in code by using floats??