- in Tool Follow made sure that the resulting geometry elements are all valid and not empty and also do not contain Points as those are irrelevant in the Follow Tool

- in Geometry Editor fixed the selection on the Geometry Table
- in Geometry Editor - made sure that the edited Geometry do not contain Shapely Points and that when adding shapes, that the geometry of that shapes is valid and non empty and it is not a Shapely Point
- in Geometry Editor - added new information's (length, coordinates and vertex points number) for the geometric element selected in the Geometry Table
This commit is contained in:
Marius Stanciu
2020-11-27 01:09:43 +02:00
committed by Marius
parent 9ecc2dc9ac
commit d34b1f1c71
3 changed files with 131 additions and 25 deletions

View File

@@ -238,9 +238,19 @@ class ToolFollow(AppTool, Gerber):
oname = opt_key[len('tools_mill') + 1:]
new_data[oname] = app_obj.options[opt_key]
try:
__ = iter(followed_obj.follow_geometry)
except TypeError:
followed_obj.follow_geometry = [followed_obj.follow_geometry]
follow_geo = [
g for g in followed_obj.follow_geometry if g and not g.is_empty and g.is_valid and
g.geom_type != 'Point'
]
# Propagate options
new_obj.options["cnctooldia"] = app_obj.defaults["geometry_cnctooldia"]
new_obj.solid_geometry = deepcopy(followed_obj.follow_geometry)
new_obj.solid_geometry = follow_geo
new_obj.tools = {
1: {
'tooldia': app_obj.dec_format(float(tools_list[0]), self.decimals),
@@ -304,7 +314,14 @@ class ToolFollow(AppTool, Gerber):
self.sel_rect[:] = []
self.points = []
new_obj.solid_geometry = deepcopy(area_follow)
try:
__ = iter(area_follow)
except TypeError:
area_follow = [area_follow]
cleaned_area_follow = [g for g in area_follow if not g.is_empty and g.is_valid and g.geom_type != 'Point']
new_obj.solid_geometry = deepcopy(cleaned_area_follow)
new_obj.tools = {
1: {
'tooldia': app_obj.dec_format(float(tools_list[0]), self.decimals),