- optimized the Paint and NCC Tools. When the Lines type of painting/clearing is used, the lines will try to arrange themselves on the direction that the lines length clearing the polygon are bigger
This commit is contained in:
parent
d33505096c
commit
c004c9082f
|
@ -9,6 +9,10 @@ CAD program, and create G-Code for Isolation routing.
|
||||||
|
|
||||||
=================================================
|
=================================================
|
||||||
|
|
||||||
|
10.02.2020
|
||||||
|
|
||||||
|
- optimized the Paint and NCC Tools. When the Lines type of painting/clearing is used, the lines will try to arrange themselves on the direction that the lines length clearing the polygon are bigger
|
||||||
|
|
||||||
8.02.2020
|
8.02.2020
|
||||||
|
|
||||||
- added a new preprocessor for using laser on a Marlin 3D printer named 'Marlin_laser_use_Spindle_pin'
|
- added a new preprocessor for using laser on a Marlin 3D printer named 'Marlin_laser_use_Spindle_pin'
|
||||||
|
|
84
camlib.py
84
camlib.py
|
@ -1445,37 +1445,71 @@ class Geometry(object):
|
||||||
log.debug("camlib.Geometry.clear_polygon3() --> Could not buffer the Polygon")
|
log.debug("camlib.Geometry.clear_polygon3() --> Could not buffer the Polygon")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# First line
|
# decide the direction of the lines
|
||||||
try:
|
if abs(left - right) >= abs(top -bot):
|
||||||
y = top - tooldia / 1.99999999
|
# First line
|
||||||
while y > bot + tooldia / 1.999999999:
|
try:
|
||||||
if self.app.abort_flag:
|
y = top - tooldia / 1.99999999
|
||||||
# graceful abort requested by the user
|
while y > bot + tooldia / 1.999999999:
|
||||||
raise FlatCAMApp.GracefulException
|
if self.app.abort_flag:
|
||||||
|
# graceful abort requested by the user
|
||||||
|
raise FlatCAMApp.GracefulException
|
||||||
|
|
||||||
# provide the app with a way to process the GUI events when in a blocking loop
|
# provide the app with a way to process the GUI events when in a blocking loop
|
||||||
QtWidgets.QApplication.processEvents()
|
QtWidgets.QApplication.processEvents()
|
||||||
|
|
||||||
|
line = LineString([(left, y), (right, y)])
|
||||||
|
line = line.intersection(margin_poly)
|
||||||
|
lines_trimmed.append(line)
|
||||||
|
y -= tooldia * (1 - overlap)
|
||||||
|
if prog_plot:
|
||||||
|
self.plot_temp_shapes(line)
|
||||||
|
self.temp_shapes.redraw()
|
||||||
|
|
||||||
|
# Last line
|
||||||
|
y = bot + tooldia / 2
|
||||||
line = LineString([(left, y), (right, y)])
|
line = LineString([(left, y), (right, y)])
|
||||||
line = line.intersection(margin_poly)
|
line = line.intersection(margin_poly)
|
||||||
lines_trimmed.append(line)
|
|
||||||
y -= tooldia * (1 - overlap)
|
|
||||||
if prog_plot:
|
|
||||||
self.plot_temp_shapes(line)
|
|
||||||
self.temp_shapes.redraw()
|
|
||||||
|
|
||||||
# Last line
|
for ll in line:
|
||||||
y = bot + tooldia / 2
|
lines_trimmed.append(ll)
|
||||||
line = LineString([(left, y), (right, y)])
|
if prog_plot:
|
||||||
line = line.intersection(margin_poly)
|
self.plot_temp_shapes(line)
|
||||||
|
except Exception as e:
|
||||||
|
log.debug('camlib.Geometry.clear_polygon3() Processing poly --> %s' % str(e))
|
||||||
|
return None
|
||||||
|
else:
|
||||||
|
# First line
|
||||||
|
try:
|
||||||
|
x = left + tooldia / 1.99999999
|
||||||
|
while x < right - tooldia / 1.999999999:
|
||||||
|
if self.app.abort_flag:
|
||||||
|
# graceful abort requested by the user
|
||||||
|
raise FlatCAMApp.GracefulException
|
||||||
|
|
||||||
for ll in line:
|
# provide the app with a way to process the GUI events when in a blocking loop
|
||||||
lines_trimmed.append(ll)
|
QtWidgets.QApplication.processEvents()
|
||||||
if prog_plot:
|
|
||||||
self.plot_temp_shapes(line)
|
line = LineString([(x, top), (x, bot)])
|
||||||
except Exception as e:
|
line = line.intersection(margin_poly)
|
||||||
log.debug('camlib.Geometry.clear_polygon3() Processing poly --> %s' % str(e))
|
lines_trimmed.append(line)
|
||||||
return None
|
x += tooldia * (1 - overlap)
|
||||||
|
if prog_plot:
|
||||||
|
self.plot_temp_shapes(line)
|
||||||
|
self.temp_shapes.redraw()
|
||||||
|
|
||||||
|
# Last line
|
||||||
|
x = right + tooldia / 2
|
||||||
|
line = LineString([(x, top), (x, bot)])
|
||||||
|
line = line.intersection(margin_poly)
|
||||||
|
|
||||||
|
for ll in line:
|
||||||
|
lines_trimmed.append(ll)
|
||||||
|
if prog_plot:
|
||||||
|
self.plot_temp_shapes(line)
|
||||||
|
except Exception as e:
|
||||||
|
log.debug('camlib.Geometry.clear_polygon3() Processing poly --> %s' % str(e))
|
||||||
|
return None
|
||||||
|
|
||||||
if prog_plot:
|
if prog_plot:
|
||||||
self.temp_shapes.redraw()
|
self.temp_shapes.redraw()
|
||||||
|
|
Loading…
Reference in New Issue