- finished adding in Paint Tool the usage of an external object to set the extent of th area painted. For simple shapes (single Polygon) the shape can be anything, for the rest will be a convex hull of the reference object

- modified NCC tool so for simple objects (single Polygon) the external object used as reference can have any shape, for the other types of objects the copper cleared area will be the convex hull of the reference object
- modified the strings of the app wherever they contained the char seq <b> </b> so it is not included in the translated string
This commit is contained in:
Marius Stanciu
2019-08-18 14:17:46 +03:00
parent 762d949461
commit 36586aecce
10 changed files with 132 additions and 79 deletions

View File

@@ -10,10 +10,10 @@ from FlatCAMTool import FlatCAMTool
from copy import copy, deepcopy
from ObjectCollection import *
import time
from shapely.geometry import base
import gettext
import FlatCAMTranslation as fcTranslate
from shapely.geometry import base
import builtins
fcTranslate.apply_language('strings')
@@ -860,12 +860,16 @@ class NonCopperClear(FlatCAMTool, Gerber):
return "Could not retrieve object: %s" % self.obj_name
# Prepare non-copper polygons
geo_n = self.bound_obj.solid_geometry
try:
if not isinstance(self.bound_obj.solid_geometry, MultiPolygon):
if isinstance(geo_n, MultiPolygon):
env_obj = geo_n.convex_hull
elif (isinstance(geo_n, MultiPolygon) and len(geo_n) == 1) or \
(isinstance(geo_n, list) and len(geo_n) == 1) and isinstance(geo_n[0], Polygon):
env_obj = cascaded_union(self.bound_obj.solid_geometry)
else:
env_obj = cascaded_union(self.bound_obj.solid_geometry)
env_obj = env_obj.convex_hull
else:
env_obj = self.bound_obj.solid_geometry.convex_hull
bounding_box = env_obj.buffer(distance=margin, join_style=base.JOIN_STYLE.mitre)
except Exception as e:
log.debug("NonCopperClear.on_ncc() --> %s" % str(e))