# Path: picwriter/toolkit.py
# TOL = 1e-6
# CURRENT_CELLS = {}
# CURRENT_CELL_NAMES = {}
#     CURRENT_CELLS = {}
#     CURRENT_CELL_NAMES = {}
# def add(top_cell, component_cell, center=(0, 0), x_reflection=False):
# def reset_database():
# def getCellName(name):
# def build_mask(cell, wgt, final_layer=None, final_datatype=None):
# def get_trace_length(trace, wgt):
# def get_keys(cell):
# def get_angle(pt1, pt2):
# def get_exact_angle(pt1, pt2):
# def dist(pt1, pt2):
# def get_direction(pt1, pt2):
# def get_turn(dir1, dir2):
# def flip_direction(direction):
# def translate_point(pt, length, direction, height=0.0):
# def normalize_angle(angle):
# def get_curve_length(func, start, end, grid=0.001):
#     def get_cur_length(pt_list):
# def build_waveguide_polygon(
#     func, wg_width, start_direction, end_direction, start_val=0, end_val=1, grid=0.001
# ):
#     def get_path_points(
#         func, wg_width, num_pts, start_direction, end_direction, start_val=0, end_val=1
#     ):
#     def check_path(path, grid):
#     def __init__(self, name, *args):
#     def _auto_transform_(self):
#     def _hash_cell_(self, *args):
#     def __get_cell(self):
#     def __direction_to_rotation(self, direction):
#     def add(self, element, origin=(0, 0), rotation=0.0, x_reflection=False):
#     def addto(self, top_cell, x_reflection=False):
# class Component:


import gdspy
from picwriter import toolkit as tk
from picwriter.components import *
# -*- coding: utf-8 -*-
"""
@author: DerekK88
"""

top = gdspy.Cell("top")
wgt = WaveguideTemplate(
    wg_width=0.45,
    clad_width=10.0,
    bend_radius=100,
    resist="+",
    fab="ETCH",
    wg_layer=1,
    wg_datatype=0,
    clad_layer=2,
    clad_datatype=0,
)

gc1 = GratingCouplerFocusing(
    wgt,
    focus_distance=20.0,
    width=20,
    length=40,
    period=1.0,
    dutycycle=0.7,
    port=(100, 0),
    direction="WEST",
)

# Path: picwriter/toolkit.py
# TOL = 1e-6
# CURRENT_CELLS = {}
# CURRENT_CELL_NAMES = {}
#     CURRENT_CELLS = {}
#     CURRENT_CELL_NAMES = {}
# def add(top_cell, component_cell, center=(0, 0), x_reflection=False):
# def reset_database():
# def getCellName(name):
# def build_mask(cell, wgt, final_layer=None, final_datatype=None):
# def get_trace_length(trace, wgt):
# def get_keys(cell):
# def get_angle(pt1, pt2):
# def get_exact_angle(pt1, pt2):
# def dist(pt1, pt2):
# def get_direction(pt1, pt2):
# def get_turn(dir1, dir2):
# def flip_direction(direction):
# def translate_point(pt, length, direction, height=0.0):
# def normalize_angle(angle):
# def get_curve_length(func, start, end, grid=0.001):
#     def get_cur_length(pt_list):
# def build_waveguide_polygon(
#     func, wg_width, start_direction, end_direction, start_val=0, end_val=1, grid=0.001
# ):
#     def get_path_points(
#         func, wg_width, num_pts, start_direction, end_direction, start_val=0, end_val=1
#     ):
#     def check_path(path, grid):
#     def __init__(self, name, *args):
#     def _auto_transform_(self):
#     def _hash_cell_(self, *args):
#     def __get_cell(self):
#     def __direction_to_rotation(self, direction):
#     def add(self, element, origin=(0, 0), rotation=0.0, x_reflection=False):
#     def addto(self, top_cell, x_reflection=False):
# class Component:


# Path: picwriter/examples/tutorial2.py
import gdspy
from picwriter import toolkit as tk
from picwriter.components import *

# -*- coding: utf-8 -*-
"""
@author: DerekK88
"""

top = gdspy.Cell("top")
wgt = WaveguideTemplate(
    wg_width=0.45,
    clad_width=10.0,
    bend_radius=100,
    resist="+",
    fab="ETCH",
    wg_layer=1,
    wg_datatype=0,
    clad_layer=2,
    clad_datatype=0,
)

gc1 = GratingCouplerFocusing(
    wgt,
    focus_distance=20.0,
    width=20,
    length=40,
    period=1.0,
    dutycycle=0.7,
    port=(100, 0),
    direction="WEST",
)

tk.add(top, gc1)