- 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:
@@ -224,8 +224,20 @@ M0""".format(z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolcha
|
||||
return 'G01 Z0'
|
||||
|
||||
def position_code(self, p):
|
||||
# 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 = p.x + p._bed_offset_x
|
||||
else:
|
||||
x_pos = (p.x + p._bed_offset_x) + ((p.y / p._bed_limit_y) * p._bed_skew_x)
|
||||
|
||||
if p._bed_skew_y == 0:
|
||||
y_pos = p.y + p._bed_offset_y
|
||||
else:
|
||||
y_pos = (p.y + p._bed_offset_y) + ((p.x / p._bed_limit_x) * p._bed_skew_y)
|
||||
|
||||
return ('X' + self.coordinate_format + ' Y' + self.coordinate_format) % \
|
||||
(p.coords_decimals, p.x, p.coords_decimals, p.y)
|
||||
(p.coords_decimals, x_pos, p.coords_decimals, y_pos)
|
||||
|
||||
def rapid_code(self, p):
|
||||
return ('G00 ' + self.position_code(p)).format(**p)
|
||||
|
||||
@@ -219,8 +219,20 @@ M0
|
||||
return ''
|
||||
|
||||
def position_code(self, p):
|
||||
# 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 = p.x + p._bed_offset_x
|
||||
else:
|
||||
x_pos = (p.x + p._bed_offset_x) + ((p.y / p._bed_limit_y) * p._bed_skew_x)
|
||||
|
||||
if p._bed_skew_y == 0:
|
||||
y_pos = p.y + p._bed_offset_y
|
||||
else:
|
||||
y_pos = (p.y + p._bed_offset_y) + ((p.x / p._bed_limit_x) * p._bed_skew_y)
|
||||
|
||||
return ('X' + self.coordinate_format + ' Y' + self.coordinate_format) % \
|
||||
(p.coords_decimals, p.x, p.coords_decimals, p.y)
|
||||
(p.coords_decimals, x_pos, p.coords_decimals, y_pos)
|
||||
|
||||
def rapid_code(self, p):
|
||||
return ('G00 ' + self.position_code(p)).format(**p)
|
||||
|
||||
@@ -205,8 +205,20 @@ G00 Z{z_toolchange}
|
||||
return 'G01 Z0'
|
||||
|
||||
def position_code(self, p):
|
||||
# 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 = p.x + p._bed_offset_x
|
||||
else:
|
||||
x_pos = (p.x + p._bed_offset_x) + ((p.y / p._bed_limit_y) * p._bed_skew_x)
|
||||
|
||||
if p._bed_skew_y == 0:
|
||||
y_pos = p.y + p._bed_offset_y
|
||||
else:
|
||||
y_pos = (p.y + p._bed_offset_y) + ((p.x / p._bed_limit_x) * p._bed_skew_y)
|
||||
|
||||
return ('X' + self.coordinate_format + ' Y' + self.coordinate_format) % \
|
||||
(p.coords_decimals, p.x, p.coords_decimals, p.y)
|
||||
(p.coords_decimals, x_pos, p.coords_decimals, y_pos)
|
||||
|
||||
def rapid_code(self, p):
|
||||
return ('G00 ' + self.position_code(p)).format(**p)
|
||||
|
||||
@@ -214,8 +214,20 @@ G00 Z{z_toolchange}
|
||||
return 'G01 Z0'
|
||||
|
||||
def position_code(self, p):
|
||||
# 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 = p.x + p._bed_offset_x
|
||||
else:
|
||||
x_pos = (p.x + p._bed_offset_x) + ((p.y / p._bed_limit_y) * p._bed_skew_x)
|
||||
|
||||
if p._bed_skew_y == 0:
|
||||
y_pos = p.y + p._bed_offset_y
|
||||
else:
|
||||
y_pos = (p.y + p._bed_offset_y) + ((p.x / p._bed_limit_x) * p._bed_skew_y)
|
||||
|
||||
return ('X' + self.coordinate_format + ' Y' + self.coordinate_format) % \
|
||||
(p.coords_decimals, p.x, p.coords_decimals, p.y)
|
||||
(p.coords_decimals, x_pos, p.coords_decimals, y_pos)
|
||||
|
||||
def rapid_code(self, p):
|
||||
return ('G00 ' + self.position_code(p)).format(**p)
|
||||
|
||||
@@ -210,8 +210,20 @@ G00 Z{z_toolchange}
|
||||
return 'G01 Z0'
|
||||
|
||||
def position_code(self, p):
|
||||
# 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 = p.x + p._bed_offset_x
|
||||
else:
|
||||
x_pos = (p.x + p._bed_offset_x) + ((p.y / p._bed_limit_y) * p._bed_skew_x)
|
||||
|
||||
if p._bed_skew_y == 0:
|
||||
y_pos = p.y + p._bed_offset_y
|
||||
else:
|
||||
y_pos = (p.y + p._bed_offset_y) + ((p.x / p._bed_limit_x) * p._bed_skew_y)
|
||||
|
||||
return ('X' + self.coordinate_format + ' Y' + self.coordinate_format) % \
|
||||
(p.coords_decimals, p.x, p.coords_decimals, p.y)
|
||||
(p.coords_decimals, x_pos, p.coords_decimals, y_pos)
|
||||
|
||||
def rapid_code(self, p):
|
||||
return ('G00 ' + self.position_code(p)).format(**p)
|
||||
|
||||
@@ -72,8 +72,20 @@ class GRBL_laser(PreProc):
|
||||
return 'M5'
|
||||
|
||||
def position_code(self, p):
|
||||
# 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 = p.x + p._bed_offset_x
|
||||
else:
|
||||
x_pos = (p.x + p._bed_offset_x) + ((p.y / p._bed_limit_y) * p._bed_skew_x)
|
||||
|
||||
if p._bed_skew_y == 0:
|
||||
y_pos = p.y + p._bed_offset_y
|
||||
else:
|
||||
y_pos = (p.y + p._bed_offset_y) + ((p.x / p._bed_limit_x) * p._bed_skew_y)
|
||||
|
||||
return ('X' + self.coordinate_format + ' Y' + self.coordinate_format) % \
|
||||
(p.coords_decimals, p.x, p.coords_decimals, p.y)
|
||||
(p.coords_decimals, x_pos, p.coords_decimals, y_pos)
|
||||
|
||||
def rapid_code(self, p):
|
||||
return ('G00 ' + self.position_code(p)).format(**p)
|
||||
|
||||
@@ -154,8 +154,20 @@ M01""".format(tool=int(p.tool), toolC=toolC_formatted)
|
||||
return 'G01 Z0'
|
||||
|
||||
def position_code(self, p):
|
||||
# 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 = p.x + p._bed_offset_x
|
||||
else:
|
||||
x_pos = (p.x + p._bed_offset_x) + ((p.y / p._bed_limit_y) * p._bed_skew_x)
|
||||
|
||||
if p._bed_skew_y == 0:
|
||||
y_pos = p.y + p._bed_offset_y
|
||||
else:
|
||||
y_pos = (p.y + p._bed_offset_y) + ((p.x / p._bed_limit_x) * p._bed_skew_y)
|
||||
|
||||
return ('X' + self.coordinate_format + ' Y' + self.coordinate_format) % \
|
||||
(p.coords_decimals, p.x, p.coords_decimals, p.y)
|
||||
(p.coords_decimals, x_pos, p.coords_decimals, y_pos)
|
||||
|
||||
def rapid_code(self, p):
|
||||
return ('G00 ' + self.position_code(p)).format(**p)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -200,8 +200,20 @@ M0""".format(x_toolchange=self.coordinate_format % (p.coords_decimals, x_toolcha
|
||||
return g
|
||||
|
||||
def position_code(self, p):
|
||||
# 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 = p.x + p._bed_offset_x
|
||||
else:
|
||||
x_pos = (p.x + p._bed_offset_x) + ((p.y / p._bed_limit_y) * p._bed_skew_x)
|
||||
|
||||
if p._bed_skew_y == 0:
|
||||
y_pos = p.y + p._bed_offset_y
|
||||
else:
|
||||
y_pos = (p.y + p._bed_offset_y) + ((p.x / p._bed_limit_x) * p._bed_skew_y)
|
||||
|
||||
return ('X' + self.coordinate_format + ' Y' + self.coordinate_format) % \
|
||||
(p.coords_decimals, p.x, p.coords_decimals, p.y)
|
||||
(p.coords_decimals, x_pos, p.coords_decimals, y_pos)
|
||||
|
||||
def rapid_code(self, p):
|
||||
g = ('G00 ' + self.position_code(p)).format(**p)
|
||||
|
||||
@@ -212,8 +212,20 @@ G0 Z{z_toolchange}
|
||||
return 'G1 Z0' + " " + self.feedrate_code(p)
|
||||
|
||||
def position_code(self, p):
|
||||
# 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 = p.x + p._bed_offset_x
|
||||
else:
|
||||
x_pos = (p.x + p._bed_offset_x) + ((p.y / p._bed_limit_y) * p._bed_skew_x)
|
||||
|
||||
if p._bed_skew_y == 0:
|
||||
y_pos = p.y + p._bed_offset_y
|
||||
else:
|
||||
y_pos = (p.y + p._bed_offset_y) + ((p.x / p._bed_limit_x) * p._bed_skew_y)
|
||||
|
||||
return ('X' + self.coordinate_format + ' Y' + self.coordinate_format) % \
|
||||
(p.coords_decimals, p.x, p.coords_decimals, p.y)
|
||||
(p.coords_decimals, x_pos, p.coords_decimals, y_pos)
|
||||
|
||||
def rapid_code(self, p):
|
||||
return ('G0 ' + self.position_code(p)).format(**p) + " " + self.feedrate_rapid_code(p)
|
||||
|
||||
@@ -82,8 +82,20 @@ class Marlin_laser_FAN_pin(PreProc):
|
||||
return gcode
|
||||
|
||||
def position_code(self, p):
|
||||
# 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 = p.x + p._bed_offset_x
|
||||
else:
|
||||
x_pos = (p.x + p._bed_offset_x) + ((p.y / p._bed_limit_y) * p._bed_skew_x)
|
||||
|
||||
if p._bed_skew_y == 0:
|
||||
y_pos = p.y + p._bed_offset_y
|
||||
else:
|
||||
y_pos = (p.y + p._bed_offset_y) + ((p.x / p._bed_limit_x) * p._bed_skew_y)
|
||||
|
||||
return ('X' + self.coordinate_format + ' Y' + self.coordinate_format) % \
|
||||
(p.coords_decimals, p.x, p.coords_decimals, p.y)
|
||||
(p.coords_decimals, x_pos, p.coords_decimals, y_pos)
|
||||
|
||||
def rapid_code(self, p):
|
||||
return ('G0 ' + self.position_code(p)).format(**p) + " " + self.feedrate_rapid_code(p)
|
||||
|
||||
@@ -82,8 +82,20 @@ class Marlin_laser_Spindle_pin(PreProc):
|
||||
return gcode
|
||||
|
||||
def position_code(self, p):
|
||||
# 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 = p.x + p._bed_offset_x
|
||||
else:
|
||||
x_pos = (p.x + p._bed_offset_x) + ((p.y / p._bed_limit_y) * p._bed_skew_x)
|
||||
|
||||
if p._bed_skew_y == 0:
|
||||
y_pos = p.y + p._bed_offset_y
|
||||
else:
|
||||
y_pos = (p.y + p._bed_offset_y) + ((p.x / p._bed_limit_x) * p._bed_skew_y)
|
||||
|
||||
return ('X' + self.coordinate_format + ' Y' + self.coordinate_format) % \
|
||||
(p.coords_decimals, p.x, p.coords_decimals, p.y)
|
||||
(p.coords_decimals, x_pos, p.coords_decimals, y_pos)
|
||||
|
||||
def rapid_code(self, p):
|
||||
return ('G0 ' + self.position_code(p)).format(**p) + " " + self.feedrate_rapid_code(p)
|
||||
|
||||
@@ -211,8 +211,20 @@ G76 ; Move to reference point to ensure correct coordinates after tool change
|
||||
return 'G01 Z0' + " " + self.feedrate_code(p)
|
||||
|
||||
def position_code(self, p):
|
||||
# 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 = p.x + p._bed_offset_x
|
||||
else:
|
||||
x_pos = (p.x + p._bed_offset_x) + ((p.y / p._bed_limit_y) * p._bed_skew_x)
|
||||
|
||||
if p._bed_skew_y == 0:
|
||||
y_pos = p.y + p._bed_offset_y
|
||||
else:
|
||||
y_pos = (p.y + p._bed_offset_y) + ((p.x / p._bed_limit_x) * p._bed_skew_y)
|
||||
|
||||
return ('X' + self.coordinate_format + ' Y' + self.coordinate_format) % \
|
||||
(p.coords_decimals, p.x, p.coords_decimals, p.y)
|
||||
(p.coords_decimals, x_pos, p.coords_decimals, y_pos)
|
||||
|
||||
def rapid_code(self, p):
|
||||
return ('G00 ' + self.position_code(p)).format(**p) + " " + self.feedrate_rapid_code(p)
|
||||
|
||||
@@ -119,8 +119,20 @@ G00 Z{z_toolchange}
|
||||
return gcode
|
||||
|
||||
def position_code(self, p):
|
||||
# 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 = p.x + p._bed_offset_x
|
||||
else:
|
||||
x_pos = (p.x + p._bed_offset_x) + ((p.y / p._bed_limit_y) * p._bed_skew_x)
|
||||
|
||||
if p._bed_skew_y == 0:
|
||||
y_pos = p.y + p._bed_offset_y
|
||||
else:
|
||||
y_pos = (p.y + p._bed_offset_y) + ((p.x / p._bed_limit_x) * p._bed_skew_y)
|
||||
|
||||
return ('X' + self.coordinate_format + ' Y' + self.coordinate_format) % \
|
||||
(p.coords_decimals, p.x, p.coords_decimals, p.y)
|
||||
(p.coords_decimals, x_pos, p.coords_decimals, y_pos)
|
||||
|
||||
def rapid_code(self, p):
|
||||
return ('G00 ' + self.position_code(p)).format(**p) + '\nG00 Z' + \
|
||||
|
||||
@@ -202,8 +202,20 @@ G0 Z{z_toolchange}
|
||||
return 'G1 Z0' + " " + self.feedrate_code(p)
|
||||
|
||||
def position_code(self, p):
|
||||
# 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 = p.x + p._bed_offset_x
|
||||
else:
|
||||
x_pos = (p.x + p._bed_offset_x) + ((p.y / p._bed_limit_y) * p._bed_skew_x)
|
||||
|
||||
if p._bed_skew_y == 0:
|
||||
y_pos = p.y + p._bed_offset_y
|
||||
else:
|
||||
y_pos = (p.y + p._bed_offset_y) + ((p.x / p._bed_limit_x) * p._bed_skew_y)
|
||||
|
||||
return ('X' + self.coordinate_format + ' Y' + self.coordinate_format) % \
|
||||
(p.coords_decimals, p.x, p.coords_decimals, p.y)
|
||||
(p.coords_decimals, x_pos, p.coords_decimals, y_pos)
|
||||
|
||||
def rapid_code(self, p):
|
||||
return ('G0 ' + self.position_code(p)).format(**p) + " " + self.feedrate_rapid_code(p)
|
||||
|
||||
@@ -60,8 +60,21 @@ class Roland_MDX_20(PreProc):
|
||||
x = p.x
|
||||
y = p.y
|
||||
|
||||
# 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 = x + p._bed_offset_x
|
||||
else:
|
||||
x_pos = (x + p._bed_offset_x) + ((y / p._bed_limit_y) * p._bed_skew_x)
|
||||
|
||||
if p._bed_skew_y == 0:
|
||||
y_pos = y + p._bed_offset_y
|
||||
else:
|
||||
y_pos = (y + p._bed_offset_y) + ((x / p._bed_limit_x) * p._bed_skew_y)
|
||||
|
||||
# RML-1 unit is 0.01mm for X-Y moves (maybe on Z also?) so we multiply by 100
|
||||
return ('Z' + self.coordinate_format + ',' + self.coordinate_format) % (float(x * 100.0), float(y * 100.0))
|
||||
return ('Z' + self.coordinate_format + ',' + self.coordinate_format) % (
|
||||
float(x_pos * 100.0), float(y_pos * 100.0))
|
||||
|
||||
def rapid_code(self, p):
|
||||
if p.units.upper() == 'IN':
|
||||
|
||||
@@ -59,7 +59,21 @@ class Roland_MDX_540(PreProc):
|
||||
else:
|
||||
x = p.x
|
||||
y = p.y
|
||||
return ('Z' + self.coordinate_format + ',' + self.coordinate_format) % (float(x * 100.0), float(y * 100.0))
|
||||
|
||||
# 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 = x + p._bed_offset_x
|
||||
else:
|
||||
x_pos = (x + p._bed_offset_x) + ((y / p._bed_limit_y) * p._bed_skew_x)
|
||||
|
||||
if p._bed_skew_y == 0:
|
||||
y_pos = y + p._bed_offset_y
|
||||
else:
|
||||
y_pos = (y + p._bed_offset_y) + ((x / p._bed_limit_x) * p._bed_skew_y)
|
||||
|
||||
return ('Z' + self.coordinate_format + ',' + self.coordinate_format) % (
|
||||
float(x_pos * 100.0), float(y_pos * 100.0))
|
||||
|
||||
def rapid_code(self, p):
|
||||
if p.units.upper() == 'IN':
|
||||
|
||||
@@ -232,8 +232,20 @@ M0
|
||||
return 'G01 Z0'
|
||||
|
||||
def position_code(self, p):
|
||||
# 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 = p.x + p._bed_offset_x
|
||||
else:
|
||||
x_pos = (p.x + p._bed_offset_x) + ((p.y / p._bed_limit_y) * p._bed_skew_x)
|
||||
|
||||
if p._bed_skew_y == 0:
|
||||
y_pos = p.y + p._bed_offset_y
|
||||
else:
|
||||
y_pos = (p.y + p._bed_offset_y) + ((p.x / p._bed_limit_x) * p._bed_skew_y)
|
||||
|
||||
return ('X' + self.coordinate_format + ' Y' + self.coordinate_format) % \
|
||||
(p.coords_decimals, p.x, p.coords_decimals, p.y)
|
||||
(p.coords_decimals, x_pos, p.coords_decimals, y_pos)
|
||||
|
||||
def rapid_code(self, p):
|
||||
return ('G00 ' + self.position_code(p)).format(**p)
|
||||
|
||||
@@ -268,8 +268,20 @@ M0
|
||||
return 'G01 Z0'
|
||||
|
||||
def position_code(self, p):
|
||||
# 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 = p.x + p._bed_offset_x
|
||||
else:
|
||||
x_pos = (p.x + p._bed_offset_x) + ((p.y / p._bed_limit_y) * p._bed_skew_x)
|
||||
|
||||
if p._bed_skew_y == 0:
|
||||
y_pos = p.y + p._bed_offset_y
|
||||
else:
|
||||
y_pos = (p.y + p._bed_offset_y) + ((p.x / p._bed_limit_x) * p._bed_skew_y)
|
||||
|
||||
return ('X' + self.coordinate_format + ' Y' + self.coordinate_format) % \
|
||||
(p.coords_decimals, p.x, p.coords_decimals, p.y)
|
||||
(p.coords_decimals, x_pos, p.coords_decimals, y_pos)
|
||||
|
||||
def rapid_code(self, p):
|
||||
return ('G00 ' + self.position_code(p)).format(**p)
|
||||
|
||||
@@ -73,8 +73,20 @@ class Z_laser(PreProc):
|
||||
return 'M5'
|
||||
|
||||
def position_code(self, p):
|
||||
# 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 = p.x + p._bed_offset_x
|
||||
else:
|
||||
x_pos = (p.x + p._bed_offset_x) + ((p.y / p._bed_limit_y) * p._bed_skew_x)
|
||||
|
||||
if p._bed_skew_y == 0:
|
||||
y_pos = p.y + p._bed_offset_y
|
||||
else:
|
||||
y_pos = (p.y + p._bed_offset_y) + ((p.x / p._bed_limit_x) * p._bed_skew_y)
|
||||
|
||||
return ('X' + self.coordinate_format + ' Y' + self.coordinate_format) % \
|
||||
(p.coords_decimals, p.x, p.coords_decimals, p.y)
|
||||
(p.coords_decimals, x_pos, p.coords_decimals, y_pos)
|
||||
|
||||
def rapid_code(self, p):
|
||||
return ('G00 ' + self.position_code(p)).format(**p)
|
||||
|
||||
@@ -213,8 +213,20 @@ G00 Z{z_toolchange}
|
||||
return 'G01 Z0'
|
||||
|
||||
def position_code(self, p):
|
||||
# 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 = p.x + p._bed_offset_x
|
||||
else:
|
||||
x_pos = (p.x + p._bed_offset_x) + ((p.y / p._bed_limit_y) * p._bed_skew_x)
|
||||
|
||||
if p._bed_skew_y == 0:
|
||||
y_pos = p.y + p._bed_offset_y
|
||||
else:
|
||||
y_pos = (p.y + p._bed_offset_y) + ((p.x / p._bed_limit_x) * p._bed_skew_y)
|
||||
|
||||
return ('X' + self.coordinate_format + ' Y' + self.coordinate_format) % \
|
||||
(p.coords_decimals, p.x, p.coords_decimals, p.y)
|
||||
(p.coords_decimals, x_pos, p.coords_decimals, y_pos)
|
||||
|
||||
def rapid_code(self, p):
|
||||
return ('G00 ' + self.position_code(p)).format(**p)
|
||||
|
||||
@@ -105,8 +105,20 @@ class grbl_laser_eleks_drd(PreProc):
|
||||
return ';up_to_zero'
|
||||
|
||||
def position_code(self, p):
|
||||
# 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 = p.x + p._bed_offset_x
|
||||
else:
|
||||
x_pos = (p.x + p._bed_offset_x) + ((p.y / p._bed_limit_y) * p._bed_skew_x)
|
||||
|
||||
if p._bed_skew_y == 0:
|
||||
y_pos = p.y + p._bed_offset_y
|
||||
else:
|
||||
y_pos = (p.y + p._bed_offset_y) + ((p.x / p._bed_limit_x) * p._bed_skew_y)
|
||||
|
||||
return ('X' + self.coordinate_format + ' Y' + self.coordinate_format) % \
|
||||
(p.coords_decimals, p.x, p.coords_decimals, p.y)
|
||||
(p.coords_decimals, x_pos, p.coords_decimals, y_pos)
|
||||
|
||||
def position_ldos_code(self, p):
|
||||
return ('X' + self.coordinate_format + ' Y' + self.coordinate_format) % \
|
||||
|
||||
@@ -64,8 +64,20 @@ class hpgl(PreProc):
|
||||
if y >= 32768:
|
||||
y = 32768
|
||||
|
||||
# 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 = x + p._bed_offset_x
|
||||
else:
|
||||
x_pos = (x + p._bed_offset_x) + ((y / p._bed_limit_y) * p._bed_skew_x)
|
||||
|
||||
if p._bed_skew_y == 0:
|
||||
y_pos = y + p._bed_offset_y
|
||||
else:
|
||||
y_pos = (y + p._bed_offset_y) + ((x / p._bed_limit_x) * p._bed_skew_y)
|
||||
|
||||
return ('PA' + self.coordinate_format + ',' + self.coordinate_format + ';') % \
|
||||
(p.coords_decimals, x, p.coords_decimals, y)
|
||||
(p.coords_decimals, x_pos, p.coords_decimals, y_pos)
|
||||
|
||||
def rapid_code(self, p):
|
||||
return self.position_code(p).format(**p)
|
||||
|
||||
Reference in New Issue
Block a user