from gdshelpers.geometry.chip import Cell
from gdshelpers.parts.port import Port
from gdshelpers.parts.spiral import Spiral
from gdshelpers.parts.waveguide import Waveguide

spiral_1 = Spiral.make_at_port(Port(origin=(0, 0), angle=0, width=1), num=5, gap=5, inner_gap=50)
spiral_2 = Spiral.make_at_port(Port(origin=(150, 0), angle=0, width=1), num=3, gap=5, inner_gap=50)
spiral_3 = Spiral.make_at_port(Port(origin=(320, 0), angle=0, width=1), num=5, gap=10, inner_gap=30)
length = spiral_3.length
wg = Waveguide.make_at_port(spiral_3.out_port)
wg.add_straight_segment(20)

cell = Cell('Spiral')
cell.add_to_layer(1, spiral_1)  # red
cell.add_to_layer(2, spiral_2)  # green
cell.add_to_layer(3, spiral_3, wg)  # blue
cell.show()