Skip to content

Commit

Permalink
Readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
amccaugh committed Jul 23, 2018
1 parent 3572d6b commit 9bad153
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 14 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ You can also do things like create a backing fill to make sure the resist develo

## 0.8.9 (July 20, 2018)
### New features
- The addition of the argument `max_cellname_length` added to `D.write_gds()`. It is `28` by default, to guarantee maximum compatibility with other GDS software.
- The addition of the argument `max_cellname_length` added to `D.write_gds()`. It is `28` by default, to guarantee maximum compatibility with GDS specifications.
- New documentation backend (contribution thanks to Alex Tait @atait)

- Added `D.remap_layers()` which allows you to to move all polygons contained on a layer within your Device to another layer. See tutorial for details
- Added `D.remove_layers()` which lets you remove all polygon geometry (optionally including labels) from a Device on the specified layers

### Bugfixes
- Further fixes to `D.write_gds()` for rare edge cases

Expand Down
43 changes: 31 additions & 12 deletions phidl/phidl_tutorial_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,21 +458,40 @@ def waveguide(width = 10, height = 1):
E = pg.import_gds(filename = 'MyLayerSetPreview.gds')
qp(E)

# Now say we only wanted to get layers 2 and 3 from the file. We can specify
# a list of layers using the `layers` argument
E2 = pg.import_gds(filename = 'MyLayerSetPreview.gds',
layers = [4, 5], flatten = True)
qp(E2)

# We can also use the `layers` argument to map layers arbitrarily. Say we
# wanted to move shapes on layer 4 to layer 5, but leave layer 6
# on layer 6. We can map layers 4->5, 6->6, and ignore layer 5 by passing a
# dict to the `layers` argument
E3 = pg.import_gds(filename = 'MyLayerSetPreview.gds',
layers = {4: 5, 6:6})
qp(E3)
# Similarly, we can import the same file but flatten the entire cell
# heirarchy
E2 = pg.import_gds(filename = 'MyLayerSetPreview.gds', flatten = True)

#==============================================================================
# Removing layers
#==============================================================================
# Now say we only wanted to get layers 4 and 5 from an imported. We can remove
# the unwanted layers using the remove_layers() function
D = pg.import_gds(filename = 'MyLayerSetPreview.gds')

# We set "invert_selection" to True so that all layers EXCEPT 4 and 5
# are removed
D.remove_layers(layers = [4,5], invert_selection = True)
qp(D)

# If we later decide that we actually don't want layer 4, as well, we
# can leave the `invert_selection` argument blank
D.remove_layers(layers = [4])
qp(D)

#==============================================================================
# Remapping layers
#==============================================================================
# Let's import our layerset preview again
D = pg.import_gds(filename = 'MyLayerSetPreview.gds')

# We can use the remap_layers() function to map layers arbitrarily. Say we
# wanted to move shapes on layer 5 to layer 99, and layer 6 to layer 77
# but leave the other layers alone. We can map layers 5->99, 6->77, and leave
# any other layers alone by passing a dict to the `layermap` argument
D.remap_layers(layermap = {5: 99, 6:77})
qp(D)



Expand Down

0 comments on commit 9bad153

Please sign in to comment.