- fixed bug in camblib.clear_polygon3() which caused that some copper clearing / paintings were not complete (some polygons were not processed) when the Straight Lines method was used
- some changes in NCC Tools regarding of the clearing itself
This commit is contained in:
parent
241cac8556
commit
d909b98130
|
@ -22,6 +22,8 @@ CAD program, and create G-Code for Isolation routing.
|
||||||
- in Paint Tool and NCC Tool fixed the RMB click detection when Area selection is used
|
- in Paint Tool and NCC Tool fixed the RMB click detection when Area selection is used
|
||||||
- finished the work on file extensions registration with FlatCAM. If the file extensions are deleted in the Preferences -> File Associations then those extensions are unregistered with FlatCAM
|
- finished the work on file extensions registration with FlatCAM. If the file extensions are deleted in the Preferences -> File Associations then those extensions are unregistered with FlatCAM
|
||||||
- fixed bug in NCC Tools and in SolderPaste Tool if in Edit -> Preferences only one tool is entered
|
- fixed bug in NCC Tools and in SolderPaste Tool if in Edit -> Preferences only one tool is entered
|
||||||
|
- fixed bug in camblib.clear_polygon3() which caused that some copper clearing / paintings were not complete (some polygons were not processed) when the Straight Lines method was used
|
||||||
|
- some changes in NCC Tools regarding of the clearing itself
|
||||||
|
|
||||||
2.09.2019
|
2.09.2019
|
||||||
|
|
||||||
|
|
|
@ -1027,9 +1027,15 @@ class Geometry(object):
|
||||||
|
|
||||||
# Add margin (contour) to storage
|
# Add margin (contour) to storage
|
||||||
if contour:
|
if contour:
|
||||||
|
if isinstance(margin_poly, Polygon):
|
||||||
geoms.insert(margin_poly.exterior)
|
geoms.insert(margin_poly.exterior)
|
||||||
for ints in margin_poly.interiors:
|
for ints in margin_poly.interiors:
|
||||||
geoms.insert(ints)
|
geoms.insert(ints)
|
||||||
|
elif isinstance(margin_poly, MultiPolygon):
|
||||||
|
for poly in margin_poly:
|
||||||
|
geoms.insert(poly.exterior)
|
||||||
|
for ints in poly.interiors:
|
||||||
|
geoms.insert(ints)
|
||||||
|
|
||||||
# Optimization: Reduce lifts
|
# Optimization: Reduce lifts
|
||||||
if connect:
|
if connect:
|
||||||
|
|
|
@ -1601,6 +1601,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
||||||
if type(empty) is Polygon:
|
if type(empty) is Polygon:
|
||||||
empty = MultiPolygon([empty])
|
empty = MultiPolygon([empty])
|
||||||
|
|
||||||
|
cp = None
|
||||||
for tool in sorted_tools:
|
for tool in sorted_tools:
|
||||||
app_obj.inform.emit(_('[success] Non-Copper Clearing with ToolDia = %s started.') % str(tool))
|
app_obj.inform.emit(_('[success] Non-Copper Clearing with ToolDia = %s started.') % str(tool))
|
||||||
cleared_geo[:] = []
|
cleared_geo[:] = []
|
||||||
|
@ -1622,7 +1623,9 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
||||||
if area.geoms:
|
if area.geoms:
|
||||||
if len(area.geoms) > 0:
|
if len(area.geoms) > 0:
|
||||||
for p in area.geoms:
|
for p in area.geoms:
|
||||||
|
if p is not None:
|
||||||
try:
|
try:
|
||||||
|
if isinstance(p, Polygon):
|
||||||
if ncc_method == 'standard':
|
if ncc_method == 'standard':
|
||||||
cp = self.clear_polygon(p, tool, self.app.defaults["gerber_circle_steps"],
|
cp = self.clear_polygon(p, tool, self.app.defaults["gerber_circle_steps"],
|
||||||
overlap=overlap, contour=contour, connect=connect)
|
overlap=overlap, contour=contour, connect=connect)
|
||||||
|
@ -1634,6 +1637,26 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
||||||
overlap=overlap, contour=contour, connect=connect)
|
overlap=overlap, contour=contour, connect=connect)
|
||||||
if cp:
|
if cp:
|
||||||
cleared_geo += list(cp.get_objects())
|
cleared_geo += list(cp.get_objects())
|
||||||
|
elif isinstance(p, MultiPolygon):
|
||||||
|
for pol in p:
|
||||||
|
if pol is not None:
|
||||||
|
if ncc_method == 'standard':
|
||||||
|
cp = self.clear_polygon(pol, tool,
|
||||||
|
self.app.defaults["gerber_circle_steps"],
|
||||||
|
overlap=overlap, contour=contour,
|
||||||
|
connect=connect)
|
||||||
|
elif ncc_method == 'seed':
|
||||||
|
cp = self.clear_polygon2(pol, tool,
|
||||||
|
self.app.defaults["gerber_circle_steps"],
|
||||||
|
overlap=overlap, contour=contour,
|
||||||
|
connect=connect)
|
||||||
|
else:
|
||||||
|
cp = self.clear_polygon3(pol, tool,
|
||||||
|
self.app.defaults["gerber_circle_steps"],
|
||||||
|
overlap=overlap, contour=contour,
|
||||||
|
connect=connect)
|
||||||
|
if cp:
|
||||||
|
cleared_geo += list(cp.get_objects())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.warning("Polygon can not be cleared. %s" % str(e))
|
log.warning("Polygon can not be cleared. %s" % str(e))
|
||||||
app_obj.poly_not_cleared = True
|
app_obj.poly_not_cleared = True
|
||||||
|
@ -1866,9 +1889,12 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
||||||
if area.geoms:
|
if area.geoms:
|
||||||
if len(area.geoms) > 0:
|
if len(area.geoms) > 0:
|
||||||
for p in area.geoms:
|
for p in area.geoms:
|
||||||
|
if p is not None:
|
||||||
|
if isinstance(p, Polygon):
|
||||||
try:
|
try:
|
||||||
if ncc_method == 'standard':
|
if ncc_method == 'standard':
|
||||||
cp = self.clear_polygon(p, tool_used, self.app.defaults["gerber_circle_steps"],
|
cp = self.clear_polygon(p, tool_used,
|
||||||
|
self.app.defaults["gerber_circle_steps"],
|
||||||
overlap=overlap, contour=contour, connect=connect)
|
overlap=overlap, contour=contour, connect=connect)
|
||||||
elif ncc_method == 'seed':
|
elif ncc_method == 'seed':
|
||||||
cp = self.clear_polygon2(p, tool_used,
|
cp = self.clear_polygon2(p, tool_used,
|
||||||
|
@ -1879,10 +1905,36 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
||||||
self.app.defaults["gerber_circle_steps"],
|
self.app.defaults["gerber_circle_steps"],
|
||||||
overlap=overlap, contour=contour, connect=connect)
|
overlap=overlap, contour=contour, connect=connect)
|
||||||
cleared_geo.append(list(cp.get_objects()))
|
cleared_geo.append(list(cp.get_objects()))
|
||||||
except:
|
except Exception as e:
|
||||||
log.warning("Polygon can't be cleared.")
|
log.warning("Polygon can't be cleared. %s" % str(e))
|
||||||
# this polygon should be added to a list and then try clear it with a smaller tool
|
# this polygon should be added to a list and then try clear it with
|
||||||
|
# a smaller tool
|
||||||
rest_geo.append(p)
|
rest_geo.append(p)
|
||||||
|
elif isinstance(p, MultiPolygon):
|
||||||
|
for poly in p:
|
||||||
|
if poly is not None:
|
||||||
|
try:
|
||||||
|
if ncc_method == 'standard':
|
||||||
|
cp = self.clear_polygon(poly, tool_used,
|
||||||
|
self.app.defaults["gerber_circle_steps"],
|
||||||
|
overlap=overlap, contour=contour,
|
||||||
|
connect=connect)
|
||||||
|
elif ncc_method == 'seed':
|
||||||
|
cp = self.clear_polygon2(poly, tool_used,
|
||||||
|
self.app.defaults["gerber_circle_steps"],
|
||||||
|
overlap=overlap, contour=contour,
|
||||||
|
connect=connect)
|
||||||
|
else:
|
||||||
|
cp = self.clear_polygon3(poly, tool_used,
|
||||||
|
self.app.defaults["gerber_circle_steps"],
|
||||||
|
overlap=overlap, contour=contour,
|
||||||
|
connect=connect)
|
||||||
|
cleared_geo.append(list(cp.get_objects()))
|
||||||
|
except Exception as e:
|
||||||
|
log.warning("Polygon can't be cleared. %s" % str(e))
|
||||||
|
# this polygon should be added to a list and then try clear it with
|
||||||
|
# a smaller tool
|
||||||
|
rest_geo.append(poly)
|
||||||
|
|
||||||
# check if there is a geometry at all in the cleared geometry
|
# check if there is a geometry at all in the cleared geometry
|
||||||
if cleared_geo:
|
if cleared_geo:
|
||||||
|
|
Loading…
Reference in New Issue