- if extracut_length is zero then the extracut will cut up until the first point in path no matter what the distance is
This commit is contained in:
@@ -13,6 +13,7 @@ CAD program, and create G-Code for Isolation routing.
|
|||||||
|
|
||||||
- small changes in the Geometry UI
|
- small changes in the Geometry UI
|
||||||
- now extracut option in the Geometry Object will recut as many points as many they are within the specified re-cut length
|
- now extracut option in the Geometry Object will recut as many points as many they are within the specified re-cut length
|
||||||
|
- if extracut_length is zero then the extracut will cut up until the first point in path no matter what the distance is
|
||||||
|
|
||||||
9.12.2019
|
9.12.2019
|
||||||
|
|
||||||
|
|||||||
29
camlib.py
29
camlib.py
@@ -4633,22 +4633,27 @@ class CNCjob(Geometry):
|
|||||||
# between point 0 and point 1 is more than the distance we set for the extra cut then make an interpolation
|
# between point 0 and point 1 is more than the distance we set for the extra cut then make an interpolation
|
||||||
# along the path and find the point at the distance extracut_length
|
# along the path and find the point at the distance extracut_length
|
||||||
|
|
||||||
if abs(distance(path[1], path[0])) > extracut_length:
|
if extracut_length == 0.0:
|
||||||
i_point = LineString([path[0], path[1]]).interpolate(extracut_length)
|
gcode += self.doformat(p.linear_code, x=path[1][0], y=path[1][1])
|
||||||
gcode += self.doformat(p.linear_code, x=i_point.x, y=i_point.y)
|
last_pt = path[1]
|
||||||
else:
|
else:
|
||||||
last_pt = path[0]
|
if abs(distance(path[1], path[0])) > extracut_length:
|
||||||
for pt in path[1:]:
|
i_point = LineString([path[0], path[1]]).interpolate(extracut_length)
|
||||||
extracut_distance = abs(distance(pt, last_pt))
|
gcode += self.doformat(p.linear_code, x=i_point.x, y=i_point.y)
|
||||||
if extracut_distance <= extracut_length:
|
last_pt = (i_point.x, i_point.y)
|
||||||
gcode += self.doformat(p.linear_code, x=pt[0], y=pt[1])
|
else:
|
||||||
last_pt = pt
|
last_pt = path[0]
|
||||||
else:
|
for pt in path[1:]:
|
||||||
break
|
extracut_distance = abs(distance(pt, last_pt))
|
||||||
|
if extracut_distance <= extracut_length:
|
||||||
|
gcode += self.doformat(p.linear_code, x=pt[0], y=pt[1])
|
||||||
|
last_pt = pt
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
|
||||||
# Up to travelling height.
|
# Up to travelling height.
|
||||||
if up:
|
if up:
|
||||||
gcode += self.doformat(p.lift_code, x=pt[0], y=pt[1], z_move=z_move) # Stop cutting
|
gcode += self.doformat(p.lift_code, x=last_pt[0], y=last_pt[1], z_move=z_move) # Stop cutting
|
||||||
|
|
||||||
return gcode
|
return gcode
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user