From bf1cabe0b0d13d988176cc4bd46d5d263f5e6896 Mon Sep 17 00:00:00 2001 From: jan Date: Sat, 12 Aug 2017 19:31:49 -0700 Subject: [PATCH] Let gdsii output handle list-specified errors --- masque/file/gdsii.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/masque/file/gdsii.py b/masque/file/gdsii.py index b43e1ac..cb170d4 100644 --- a/masque/file/gdsii.py +++ b/masque/file/gdsii.py @@ -27,6 +27,9 @@ def write_dose2dtype(pattern: Pattern, structures, polygons as boundary elements, and subpatterns as structure references (sref). + For each shape, + layer is chosen to be equal to shape.layer if it is an int, + or shape.layer[0] if it is a tuple Note that this function modifies the Pattern. It is often a good idea to run pattern.subpatternize() prior to calling this function, @@ -78,7 +81,11 @@ def write_dose2dtype(pattern: Pattern, data_type = dose_vals_list.index(polygon.dose * pat_dose) xy_open = numpy.round(polygon.vertices + polygon.offset).astype(int) xy_closed = numpy.vstack((xy_open, xy_open[0, :])) - structure.append(gdsii.elements.Boundary(layer=polygon.layer, + if hasattr('__len__', polygon.layer): + layer = polygon.layer[0] + else: + layer = polygon.layer + structure.append(gdsii.elements.Boundary(layer=layer, data_type=data_type, xy=xy_closed)) # Add an SREF for each subpattern entry