jonathanwin / yagv

A fast 3D Gcode Viewer for Reprap-style 3D printers, in Python and OpenGL
73 stars 48 forks source link

Fix to better handle comments in some gcode. #5

Closed kronenpj closed 6 years ago

kronenpj commented 9 years ago

Eg: I have slic3r-created GCode that includes these lines: ...

(**** begin homing ****)
G162 X Y F2500 (home XY axes maximum)
G161 Z F1100 (home Z axis minimum)
G92 Z-5 (set Z to -5)
G1 Z0.0 (move Z to "0")
G161 Z F100 (home Z axis minimum)
M132 X Y Z A B (Recall stored home offsets for XYZAB axis)
(**** end homing ****)

When parsing G92 Z-5 (set Z to -5) I see: ValueError: could not convert string to float: set

It's trying to parse the comment. Why this is different from previous lines, I'm not sure but this fix helps parse this file.

jonathanwin commented 6 years ago

Thanks for bringing this bug to my attention. Proper comment support is added in 0d354e4cac5880126cbed398f3e911b568e90ae6