@@ -282,20 +282,34 @@ def parseGCode(lines):
282
282
line = line + ";" if len (line ) == 0 or ";" not in line else line
283
283
args , comment = line .split (";" )[:2 ]
284
284
args = args .split (" " )
285
- if line .endswith ("rotation" ): # we have either rotation or incline
285
+ if line .endswith ("rotation-hack " ): # we pass U in the comment section
286
286
args , comment = line .split (";" )[1 :3 ] # we remove first colon
287
287
args = args .split (" " )
288
288
printer .finishLayer ()
289
- # if any(a.lower().startswith('u') for a in args): # rotation
290
289
printer .rotations .append (
291
290
Rotation (printer .rotations [- 1 ].x_rot , parseRotation (args [1 :]))
292
291
)
293
292
printer .currPos .U = printer .rotations [- 1 ].z_rot
294
- elif line .endswith ("incline" ):
293
+ elif line .endswith ("rotation" ): # we have either rotation or incline
294
+ printer .finishLayer ()
295
+ printer .rotations .append (
296
+ Rotation (printer .rotations [- 1 ].x_rot , parseRotation (args [1 :]))
297
+ )
298
+ printer .currPos .U = printer .rotations [- 1 ].z_rot
299
+ elif line .endswith ("incline-hack" ):
295
300
args , comment = line .split (";" )[1 :3 ] # we remove first colon
296
301
args = args .split (" " )
297
302
printer .finishLayer ()
298
- # if any(a.lower().startswith('v') for a in args): # incline
303
+ printer .rotations .append (
304
+ Rotation (parseRotation (args [1 :]), printer .rotations [- 1 ].z_rot )
305
+ )
306
+
307
+ printer .cone_axis = rotation_matrix (
308
+ [1 , 0 , 0 ], np .radians (printer .rotations [- 1 ].x_rot )
309
+ ).dot ([0 , 0 , 1 ])
310
+ printer .currPos .V = printer .rotations [- 1 ].x_rot
311
+ elif line .endswith ("incline" ):
312
+ printer .finishLayer ()
299
313
printer .rotations .append (
300
314
Rotation (parseRotation (args [1 :]), printer .rotations [- 1 ].z_rot )
301
315
)
0 commit comments