- Cutout Tool - made sure that all the paths generated by this tool are contiguous which means that two lines that meet at one end will become onle line therefore reducing unnecessary Z moves

This commit is contained in:
Marius Stanciu
2020-06-18 14:44:29 +03:00
committed by Marius
parent 79fec61934
commit 7be4d98172
2 changed files with 11 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ CHANGELOG for FlatCAM beta
- updated Cutout Tool UI - updated Cutout Tool UI
- Cutout Tool - in manual gap adding there is now an option to automatically turn on the big cursor which could help - Cutout Tool - in manual gap adding there is now an option to automatically turn on the big cursor which could help
- Cutout Tool - fixed errors when trying to add a manual gap without having a geometry object selected in the combobox - Cutout Tool - fixed errors when trying to add a manual gap without having a geometry object selected in the combobox
- Cutout Tool - made sure that all the paths generated by this tool are contiguous which means that two lines that meet at one end will become onle line therefore reducing unnecessary Z moves
17.06.2020 17.06.2020

View File

@@ -10,7 +10,7 @@ from appTool import AppTool
from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, RadioSet, FCComboBox, OptionalInputSection, FCButton from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, RadioSet, FCComboBox, OptionalInputSection, FCButton
from shapely.geometry import box, MultiPolygon, Polygon, LineString, LinearRing, MultiLineString from shapely.geometry import box, MultiPolygon, Polygon, LineString, LinearRing, MultiLineString
from shapely.ops import cascaded_union, unary_union from shapely.ops import cascaded_union, unary_union, linemerge
import shapely.affinity as affinity import shapely.affinity as affinity
from matplotlib.backend_bases import KeyEvent as mpl_key_event from matplotlib.backend_bases import KeyEvent as mpl_key_event
@@ -403,6 +403,8 @@ class CutOut(AppTool):
if not solid_geo: if not solid_geo:
app_obj.inform.emit('[ERROR_NOTCL] %s' % _("Failed.")) app_obj.inform.emit('[ERROR_NOTCL] %s' % _("Failed."))
return "fail" return "fail"
solid_geo = linemerge(solid_geo)
geo_obj.solid_geometry = deepcopy(solid_geo) geo_obj.solid_geometry = deepcopy(solid_geo)
xmin, ymin, xmax, ymax = CutOut.recursive_bounds(geo_obj.solid_geometry) xmin, ymin, xmax, ymax = CutOut.recursive_bounds(geo_obj.solid_geometry)
@@ -613,6 +615,12 @@ class CutOut(AppTool):
geo_obj.options['cutz'] = self.ui.cutz_entry.get_value() geo_obj.options['cutz'] = self.ui.cutz_entry.get_value()
geo_obj.options['multidepth'] = self.ui.mpass_cb.get_value() geo_obj.options['multidepth'] = self.ui.mpass_cb.get_value()
geo_obj.options['depthperpass'] = self.ui.maxdepth_entry.get_value() geo_obj.options['depthperpass'] = self.ui.maxdepth_entry.get_value()
if not solid_geo:
app_obj.inform.emit('[ERROR_NOTCL] %s' % _("Failed."))
return "fail"
solid_geo = linemerge(solid_geo)
geo_obj.solid_geometry = deepcopy(solid_geo) geo_obj.solid_geometry = deepcopy(solid_geo)
geo_obj.tools.update({ geo_obj.tools.update({
@@ -717,6 +725,7 @@ class CutOut(AppTool):
# first subtract geometry for the total solid_geometry # first subtract geometry for the total solid_geometry
new_solid_geometry = CutOut.subtract_polygon(self.man_cutout_obj.solid_geometry, cut_poly) new_solid_geometry = CutOut.subtract_polygon(self.man_cutout_obj.solid_geometry, cut_poly)
new_solid_geometry = linemerge(new_solid_geometry)
self.man_cutout_obj.solid_geometry = new_solid_geometry self.man_cutout_obj.solid_geometry = new_solid_geometry
# then do it or each tool in the manual cutout Geometry object # then do it or each tool in the manual cutout Geometry object