Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gdstk #164

Closed
wants to merge 13 commits into from
Closed

Gdstk #164

wants to merge 13 commits into from

Conversation

joamatab
Copy link
Contributor

ported basic functionality from gdspy to gdstk backend

from phidl import Device
from phidl import quickplot as qp  # Rename "quickplot()" to the easier "qp()"
import phidl.geometry as pg
import numpy as np

# Create a blank device (essentially an empty GDS cell with some special features)
D = Device("mydevice")

poly1 = D.add_polygon([(-8, 6, 7, 9), (-6, 8, 17, 5)], layer=0)

T = D << pg.text('Hello!')

C = pg.arc(radius=25, width=2, theta=45, layer=1)
c = D << C  # Add the arc we created

# R = pg.rectangle(size = [5,10], layer = 2)
# r = D << R


def waveguide(width=10, height=1, layer=0):
    WG = Device("waveguide")
    WG.add_polygon([(0, 0), (width, 0), (width, height), (0, height)], layer=layer)
    WG.add_port(name="wgport1", midpoint=[0, height / 2], width=height, orientation=180)
    WG.add_port(
        name="wgport2", midpoint=[width, height / 2], width=height, orientation=0
    )
    return WG


wg1 = D << waveguide(width=6, height=2.5, layer=1)
wg2 = D << waveguide(width=11, height=2.5, layer=2)
wg3 = D << waveguide(width=15, height=2.5, layer=3)

wg2.movey(10).rotate(10)
wg3.movey(20).rotate(15)
# print(D.references)

# text2 = D << T.flatten()
# text2.movex(-10)
# print(text2)
D.write_gds("temp.gds")
# D.write_oas("temp.oas")

import gdsfactory as gf
gf.show("temp.gds")
print("END OF FILE")

still some tests failing and some with Fatal Python error: Segmentation fault when running pytest

gdsfactory/gdsfactory#521
#163

@heitzmann
@tvtamas
@alexsludds
@jenshnielsen
@Dominik-Vogel
@flaport
@SkandanC

@tvt173 tvt173 mentioned this pull request Sep 20, 2022
@amccaugh amccaugh closed this Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants