- added in CNCJob preferences new preferences that allow compensation for the CNC bed skew/tilt (axes not being square one to another)

- all pre-processors are altered such they can adjust the gcode to use the compensation values set in Preferences -> CNC-Job section
This commit is contained in:
Marius Stanciu
2022-01-09 19:44:56 +02:00
committed by Marius
parent 9d9bfa8b03
commit e219562bbb
30 changed files with 474 additions and 45 deletions

View File

@@ -143,7 +143,19 @@ class ISEL_ICP_CNC(PreProc):
return 'MOVEABS Z0'
def position_code(self, p):
return 'X' + str(int(p.x * 1000)) + ' Y' + str(int(p.y * 1000))
# formula for skewing on x for example is:
# x_fin = x_init + y_init/slope where slope = p._bed_limit_y / p._bed_skew_x (a.k.a tangent)
if p._bed_skew_x == 0:
x_pos = int((p.x * 1000) + p._bed_offset_x)
else:
x_pos = int((p.x * 1000) + p._bed_offset_x + (((p.y * 1000) / p._bed_limit_y) * p._bed_skew_x))
if p._bed_skew_y == 0:
y_pos = int((p.y * 1000) + p._bed_offset_y)
else:
y_pos = int((p.x * 1000) + p._bed_offset_x + (((p.x * 1000) / p._bed_limit_x) * p._bed_skew_y))
return 'X' + str(x_pos) + ' Y' + str(y_pos)
def rapid_code(self, p):
return ('FASTABS ' + self.position_code(p)).format(**p)