PHP Filament Length/Weight/Volume Estimator for 4d G-Code
0
Likes
63
Downloads
449
Views
Published on December 2, 2012
Description
This is a PHP translation of "Filament Length/Weight/Volume Estimator for 4d G-Code" (Original Perl code by jag thingiverse.com/thing:15499 )
Instructions
Run something like "$ php filament_length.php -f cube-20-20-10_export.gcode"
The output is something like:
Filament diameter is 3 mm
Filament density is 1.05 g/cc
Cross sectional area of filament: 0.070685775 cm^2
Total filament: 34.148 cm
Volume: 2.414 cc
Weight: 2.534 g
Use this code however you want. If you find a bug, please tell me.
I cannot use a "more free" license here but please read the code header.
The output is something like:
Filament diameter is 3 mm
Filament density is 1.05 g/cc
Cross sectional area of filament: 0.070685775 cm^2
Total filament: 34.148 cm
Volume: 2.414 cc
Weight: 2.534 g
Use this code however you want. If you find a bug, please tell me.
I cannot use a "more free" license here but please read the code header.
You must be logged in to post a comment.
License
PHP Filament Length/Weight/Volume Estimator for 4d G-Code by algspd is licensed under the BSD License license.

Interesting to see how little you had to change the code.
Just out of curiosity, what motivated you to port it to PHP rather than use the perl code? Seems like most systems with PHP installed would also have perl.
I tried to change the code as less as possible to make understandable the translation (I'm making another version for myself).
The motivation of this translation was to have the most "compact" possible cost estimator, calling the less possible interpreters (why to call php and perl, if i can just call php?).
The problem now is that I can't do the estimation over the stl file, so I have to run something like skeinforge (which I will not translate to anything :P) to get the gcode.
If you know something "simple" that can estimate an stl file volume, please let me know.