- added an ugly form of extra pad passes functionality in Isolation Plugin - does not take into consideration the milling direction

This commit is contained in:
Marius Stanciu
2021-10-15 01:35:16 +03:00
committed by Marius
parent 9057966aa9
commit 02741cf37f
4 changed files with 65 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
latCAM BETA (c) 2019 - by Marius Stanciu
FlatCAM BETA (c) 2019 - by Marius Stanciu
Based on FlatCAM:
2D Computer-Aided PCB Manufacturing by (c) 2014-2016 Juan Pablo Caram
=================================================
@@ -7,6 +7,10 @@ CHANGELOG for FlatCAM beta
=================================================
15.10.2021
- added an ugly form of extra pad passes functionality in Isolation Plugin - does not take into consideration the milling direction
14.10.2021
- updated the translation strings

View File

@@ -103,7 +103,7 @@ class Gerber(Geometry):
# ## Gerber elements # ##
'''
tools = {
'id':{
aperture_id:{
'type':string,
'size':float,
'width':float,
@@ -111,7 +111,7 @@ class Gerber(Geometry):
'geometry': [],
}
}
tools['geometry'] list elements are dicts
tools[aperture_id]['geometry'] list elements are dicts
dict = {
'solid': [],
'follow': [],

View File

@@ -1732,6 +1732,39 @@ class ToolIsolation(AppTool, Gerber):
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Isolation geometry could not be generated."))
continue
# Extra Pads isolations
pad_geo = []
extra_passes = self.ui.pad_passes_entry.get_value()
if extra_passes > 0:
solid_geo_union = unary_union(iso_geo)
extra_geo = []
for apid in self.grb_obj.tools:
for t_geo_dict in self.grb_obj.tools[apid]['geometry']:
if isinstance(t_geo_dict['follow'], Point):
extra_geo.append(t_geo_dict['solid'])
for nr_pass in range(i, extra_passes + i):
pad_pass_geo = []
for geo in extra_geo:
iso_offset = tool_dia * ((2 * nr_pass + 1) / 2.0000001) - (
nr_pass * overlap * tool_dia)
if negative_dia:
iso_offset = -iso_offset
pad_pass_geo.append(
geo.buffer(iso_offset, int(self.app.defaults["gerber_circle_steps"])))
pad_geo.append(unary_union(pad_pass_geo).difference(solid_geo_union))
total_geo = []
try:
for p in iso_geo.geoms:
total_geo.append(p)
except (AttributeError, TypeError):
total_geo.append(iso_geo)
for p in pad_geo:
total_geo.append(p)
iso_geo = total_geo
# ############################################################
# ########## AREA SUBTRACTION ################################
# ############################################################
@@ -2096,6 +2129,28 @@ class ToolIsolation(AppTool, Gerber):
else:
solid_geo.append(iso_geo)
# Extra Pads isolations
pad_geo = []
extra_passes = self.ui.pad_passes_entry.get_value()
if extra_passes > 0:
solid_geo_union = unary_union(solid_geo)
extra_geo = []
for apid in self.grb_obj.tools:
for t_geo_dict in self.grb_obj.tools[apid]['geometry']:
if isinstance(t_geo_dict['follow'], Point):
extra_geo.append(t_geo_dict['solid'])
for nr_pass in range(passes, extra_passes + passes):
pad_pass_geo = []
for geo in extra_geo:
iso_offset = tool_dia * ((2 * nr_pass + 1) / 2.0000001) - (nr_pass * overlap * tool_dia)
if negative_dia:
iso_offset = -iso_offset
pad_pass_geo.append(geo.buffer(iso_offset, int(self.app.defaults["gerber_circle_steps"])))
pad_geo.append(unary_union(pad_pass_geo).difference(solid_geo_union))
solid_geo += pad_geo
# ############################################################
# ########## AREA SUBTRACTION ################################
# ############################################################
@@ -2884,7 +2939,7 @@ class ToolIsolation(AppTool, Gerber):
:type offset: float
:param invert: If to invert the direction of geometry (CW to CCW or reverse)
:type invert: int
:param geometry: Shapely Geometry for which t ogenerate envelope
:param geometry: Shapely Geometry for which to generate envelope
:type geometry:
:param env_iso_type: type of isolation, can be 0 = exteriors or 1 = interiors or 2 = both (complete)
:type env_iso_type: int

View File

@@ -4,7 +4,7 @@
# Usage: pip3 install -r requirements.txt
numpy>=1.16
matplotlib>=3.1
matplotlib>=3.4.5
cycler>=0.10
python-dateutil>=2.1
kiwisolver>=1.1
@@ -16,7 +16,7 @@ pyopengl
ortools>=7.0
svg.path>=4.0
simplejson
shapely>=1.7.0
shapely>=1.7.1
freetype-py
fontTools
lxml