- fixed the HPGL preprocessor

This commit is contained in:
Marius Stanciu
2019-12-16 19:56:24 +02:00
committed by Marius
parent 6744d9ae07
commit 435648171e
4 changed files with 20 additions and 7 deletions

View File

@@ -49,8 +49,19 @@ class hpgl(FlatCAMPostProc):
y = p.y
# we need to have the coordinates as multiples of 0.025mm
x = round(x / 0.025) * 25 / 1000
y = round(y / 0.025) * 25 / 1000
x = round(x * 40)
y = round(y * 40)
# constrain the x and y values within the domain of valid values: [-32767 ... 32768]
if x <= -32767:
x = -32767
if x >= 32768:
x = 32768
if y <= -32767:
y = -32767
if y >= 32768:
y = 32768
return ('PA' + self.coordinate_format + ',' + self.coordinate_format + ';') % \
(p.coords_decimals, x, p.coords_decimals, y)