- Subtraction Tool - fixed issue when from a given polygon it is subtracted multiple ones, the result being that the subtraction is not done
This commit is contained in:
committed by
Marius Stanciu
parent
47f53517a7
commit
89ce3b32f0
@@ -12,6 +12,7 @@ CHANGELOG for FlatCAM beta
|
|||||||
- in Gerber Editor - modified the UI
|
- in Gerber Editor - modified the UI
|
||||||
- in Gerber Editor - added new parameters for selected polygons: is_valid and area
|
- in Gerber Editor - added new parameters for selected polygons: is_valid and area
|
||||||
- in Gerber Editor - for Disc and SemiDisc tools now it is allowed to start without a defined aperture; it will be assumed that we work with an aperture with size zero
|
- in Gerber Editor - for Disc and SemiDisc tools now it is allowed to start without a defined aperture; it will be assumed that we work with an aperture with size zero
|
||||||
|
- Subtraction Tool - fixed issue when from a given polygon it is subtracted multiple ones, the result being that the subtraction is not done
|
||||||
|
|
||||||
2.12.2020
|
2.12.2020
|
||||||
|
|
||||||
|
|||||||
@@ -289,11 +289,10 @@ class ToolSub(AppTool):
|
|||||||
target_solid = target_geo_obj["solid"]
|
target_solid = target_geo_obj["solid"]
|
||||||
for sub_solid_geo in sub_geometry["solid"]:
|
for sub_solid_geo in sub_geometry["solid"]:
|
||||||
if target_solid.intersects(sub_solid_geo) or target_solid.contains(sub_solid_geo):
|
if target_solid.intersects(sub_solid_geo) or target_solid.contains(sub_solid_geo):
|
||||||
new_geo = target_solid.difference(sub_solid_geo)
|
target_solid = target_solid.difference(sub_solid_geo)
|
||||||
if not new_geo.is_empty:
|
if not target_solid.is_empty:
|
||||||
diff.append(new_geo)
|
diff.append(target_solid)
|
||||||
solid_is_modified = True
|
solid_is_modified = True
|
||||||
if solid_is_modified:
|
|
||||||
target_solid = unary_union(diff)
|
target_solid = unary_union(diff)
|
||||||
destination_geo_obj["solid"] = deepcopy(target_solid)
|
destination_geo_obj["solid"] = deepcopy(target_solid)
|
||||||
|
|
||||||
@@ -303,11 +302,10 @@ class ToolSub(AppTool):
|
|||||||
target_clear = target_geo_obj["clear"]
|
target_clear = target_geo_obj["clear"]
|
||||||
for sub_clear_geo in sub_geometry["clear"]:
|
for sub_clear_geo in sub_geometry["clear"]:
|
||||||
if target_clear.intersects(sub_clear_geo) or target_clear.contains(sub_clear_geo):
|
if target_clear.intersects(sub_clear_geo) or target_clear.contains(sub_clear_geo):
|
||||||
new_geo = target_clear.difference(sub_clear_geo)
|
target_clear = target_clear.difference(sub_clear_geo)
|
||||||
if not new_geo.is_empty:
|
if not target_clear.is_empty:
|
||||||
clear_diff.append(new_geo)
|
clear_diff.append(target_clear)
|
||||||
clear_is_modified = True
|
clear_is_modified = True
|
||||||
if clear_is_modified:
|
|
||||||
target_clear = unary_union(clear_diff)
|
target_clear = unary_union(clear_diff)
|
||||||
destination_geo_obj["clear"] = deepcopy(target_clear)
|
destination_geo_obj["clear"] = deepcopy(target_clear)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user