Welcome! Log In Create A New Profile

Advanced

Getting total layers number in STL

Posted by sv650s 
Getting total layers number in STL
November 14, 2014 09:19AM
Hi,
i'm searching how to get the total layers number in a STL file, and after i will can display it on LCD screen
and i would like to have too the current layer print
Somebody know how to make this ?
thanks for your help
Re: Getting total layers number in STL
November 15, 2014 01:19AM
Umm...

There are no layers in STL files, stl files contains lots and lots of triangles in 3d space that form a approximation of 3d object.

Slicers then convert STL into gcode that is normally in layers (but doesn’t have to be)

You would have to read in the entire gcode file and count all the Z moves, but even then it not that simple with features like lift on move etc.

If you use something like slicer you can cheat, the comments list the layer height, you can then work from the end of the file and find the highest Z print and then divide by your layer height

This is why most software just shows you a line number of the gcode and the percentage threw the file...
Re: Getting total layers number in STL
November 15, 2014 02:33AM
My fork of the Duet firmware reads the object height and layer height from the gcode file, and uses them as one way to compute the %complete and estimated print completion time. However, it also computes similar figures based on filament used and total filament needed for the print, and these are generally more accurate.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Getting total layers number in STL
November 15, 2014 04:11AM
I'm ok, the simplest way is to get in the g-code the command Mxx who say to move up the Z axis
But whitch command make move up Z axis in G-code ?
And how to get this value from repetier in Marlin ?
Sorry, only registered users may post in this forum.

Click here to login