Skip to content

Commit 25c2144

Browse files
committed
Added islands to zones
1 parent cf3ac25 commit 25c2144

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Stretch/kiplug/zone.py

+13
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def __init__(self):
9393
self.filled_polygon = []
9494
self.filled_segments = []
9595
self.name = ''
96+
self.island = False
9697

9798
# Most of these don't need to be handled
9899
self.metadata = []
@@ -139,6 +140,9 @@ def From_PCB(self, input):
139140
elif item[0] == 'keepout':
140141
self.keepout = item[1]
141142

143+
elif item[0] == 'island':
144+
self.island = True
145+
142146
elif item[0] == 'name':
143147
self.name = item[1]
144148

@@ -170,6 +174,8 @@ def To_PCB(self):
170174
pcb.append(['layer', self.layer])
171175
if len(self.layers) > 0:
172176
pcb.append(['layers', self.layers])
177+
if self.island:
178+
pcb.append(['island'])
173179
if self.tstamp:
174180
pcb.append(['tstamp', self.tstamp])
175181
if self.hatch:
@@ -270,6 +276,10 @@ def To_SVG(self):
270276
if self.keepout != '':
271277
keepout = 'keepout="' + self.keepout + '" '
272278

279+
island = ''
280+
if self.island == True:
281+
island = 'island="True" '
282+
273283
name = ''
274284
if self.name != '':
275285
name = 'name="' + self.name + '" '
@@ -290,6 +300,7 @@ def To_SVG(self):
290300
parameters += filled_areas_thickness
291301
parameters += fill
292302
parameters += keepout
303+
parameters += island
293304
parameters += name
294305
parameters += 'type="zone">'
295306
parameters += '</path>'
@@ -347,6 +358,8 @@ def From_SVG(self, tag, path):
347358
self.filled_areas_thickness = tag['filled_areas_thickness']
348359
if tag.has_attr('fill'):
349360
self.fill = tag['fill']
361+
if tag.has_attr('island'):
362+
self.fill = True
350363
if tag.has_attr('keepout'):
351364
self.keepout = tag['keepout']
352365
if tag.has_attr('name'):

0 commit comments

Comments
 (0)