- fixed an error due of missing attribute of PlotCanvasLegacy when using Legacy2D graphic engine

- solving deprecation warnings issued by Shapely
- made sure that the Gerber Object geometry is always flattened
This commit is contained in:
Marius Stanciu
2021-09-21 15:55:35 +03:00
committed by Marius
parent 5f417f7156
commit dd029d6ded
17 changed files with 143 additions and 202 deletions

View File

@@ -16,7 +16,7 @@ from PyQt6.QtCore import Qt
# import inspect
from camlib import distance, arc, three_point_circle, Geometry, FlatCAMRTreeStorage
from camlib import distance, arc, three_point_circle, Geometry, FlatCAMRTreeStorage, flatten_shapely_geometry
from appTool import AppTool
from appGUI.GUIElements import OptionalInputSection, FCCheckBox, FCLabel, FCComboBox, FCTextAreaRich, \
FCDoubleSpinner, FCButton, FCInputDoubleSpinner, FCTree, NumericalEvalTupleEntry, FCEntry, FCTextEdit, \
@@ -5349,10 +5349,7 @@ class AppGeoEditor(QtCore.QObject):
# ####################################################################################################
# remove the invalid geometry and also the Points as those are not relevant for the Editor
# ####################################################################################################
try:
__ = iter(geo_to_edit)
except TypeError:
geo_to_edit = [geo_to_edit]
geo_to_edit = flatten_shapely_geometry(geo_to_edit)
cleaned_geo = [g for g in geo_to_edit if g and not g.is_empty and g.is_valid and g.geom_type != 'Point']
for shape in cleaned_geo:

View File

@@ -17,7 +17,7 @@ from vispy.geometry import Rect
from copy import copy, deepcopy
import logging
from camlib import distance, arc, three_point_circle
from camlib import distance, arc, three_point_circle, flatten_shapely_geometry
from appGUI.GUIElements import FCEntry, FCComboBox, FCTable, FCDoubleSpinner, FCSpinner, RadioSet, EvalEntry2, \
FCInputDoubleSpinner, FCButton, OptionalInputSection, FCCheckBox, NumericalEvalTupleEntry, FCLabel, FCTextEdit, \
VerticalScrollArea, FCGridLayout
@@ -4886,13 +4886,9 @@ class AppGerberEditor(QtCore.QObject):
new_poly = MultiPolygon(poly_buffer)
new_poly = new_poly.buffer(0.00000001)
new_poly = new_poly.buffer(-0.00000001)
try:
__ = iter(new_poly)
except TypeError:
new_poly = [new_poly]
new_poly = flatten_shapely_geometry(new_poly)
grb_obj.solid_geometry = deepcopy(new_poly)
grb_obj.follow_geometry = deepcopy(follow_buffer)
for k, v in self.gerber_obj_options.items():