rename del_polygon to subtract_polygon

correctly  modify current  geometry and  dont leave it as path
fix shellcommands  to follow  new names
tweak  geocutout to be able cut 8  gaps
This commit is contained in:
Kamil Sopko
2016-02-23 00:23:27 +01:00
parent 23d5d7bd64
commit a827e184b7
2 changed files with 50 additions and 40 deletions

View File

@@ -136,17 +136,17 @@ class Geometry(object):
log.error("Failed to run union on polygons.")
raise
def del_polygon(self, points):
def subtract_polygon(self, points):
"""
Delete a polygon from the object
Subtract polygon from the given object. This only operates on the paths in the original geometry, i.e. it converts polygons into paths.
:param points: The vertices of the polygon.
:return: None
:return: none
"""
if self.solid_geometry is None:
self.solid_geometry = []
#pathonly should be allways True, otherwise polygons are not subtracted
flat_geometry = self.flatten(pathonly=True)
log.debug("%d paths" % len(flat_geometry))
polygon=Polygon(points)
@@ -157,7 +157,7 @@ class Geometry(object):
diffs.append(target.difference(toolgeo))
else:
log.warning("Not implemented.")
return cascaded_union(diffs)
self.solid_geometry=cascaded_union(diffs)
def bounds(self):
"""