Folder structure simplfied

This commit is contained in:
=
2026-06-06 16:43:26 +08:00
parent 8da92ced57
commit 8a17f1dde0
138 changed files with 10429 additions and 1432 deletions
+270 -2
View File
@@ -7,14 +7,66 @@ import math
from .taper import taper_xs2xs
from ...routing import Route
from ...structures import *
from ...geometry import *
from ....technologies import *
from ...structures import _my_polygon,Conchoid,_my_poly_spiral
from ...geometry import _my_polygon,Conchoid,_my_poly_spiral
from scipy import optimize
class spiral:
"""
spiral primitive component.
This component builds the spiral layout cell.
Parameters
----------
name : str, optional
Unique identifier for the device cell. Default is None.
shape : str, optional
Value for the shape parameter. Default is 'circle'.
Dmin : float, optional
Value for the Dmin parameter. Default is 50.
R_bend : float, optional
Radius parameter in microns. Default is 10.
Rmin_euler : float, optional
Radius parameter in microns. Default is 10.
Lmin : float, optional
Length parameter in microns. Default is 50.
width : float, optional
Width parameter in microns. Default is 2.
w_port : float, optional
Width parameter in microns. Default is 0.45.
w_bend_center : float, optional
Width parameter in microns. Default is 1.
Rmin_bend_center : float, optional
Radius parameter in microns. Default is 10.
gap : float, optional
Spacing or gap parameter in microns. Default is 1.
cycles : float, optional
Count or repetition parameter. Default is 20.
xs : str, optional
Layer or cross-section name used by the device. Default is 'strip'.
layer : str, optional
Layer or cross-section name used by the device. Default is None.
w_bend_port : Optional[float], optional
Width parameter in microns. Default is None.
Ltp_port : int, optional
Length parameter in microns. Default is 10.
res : float, optional
Value for the res parameter. Default is 0.5.
rib2strip : bool, optional
Value for the rib2strip parameter. Default is True.
port_angle : float, optional
Value for the port_angle parameter. Default is 180.
Euler_bend : bool, optional
Value for the Euler_bend parameter. Default is False.
show_pins : bool, optional
Whether to draw pin markers in the generated layout. Default is False.
sharp_patch : bool, optional
Whether to add geometry patches for sharp corners or cladding continuity. Default is True.
"""
def __init__(self,
name: str = None,
shape: str = 'circle',
@@ -350,6 +402,58 @@ class spiral:
return C
class spiral_rectangle:
"""
spiral rectangle primitive component.
This component builds the spiral rectangle layout cell.
Parameters
----------
name : str, optional
Unique identifier for the device cell. Default is None.
Dmin : float, optional
Value for the Dmin parameter. Default is 50.
Rmax_bend : float, optional
Radius parameter in microns. Default is 10.
Rmin_bend : float, optional
Radius parameter in microns. Default is 10.
wmin_bend : float, optional
Value for the wmin_bend parameter. Default is 10.
Lmin : float, optional
Length parameter in microns. Default is 50.
width : float, optional
Width parameter in microns. Default is 2.
w_port : float, optional
Width parameter in microns. Default is None.
gap : float, optional
Spacing or gap parameter in microns. Default is 1.
cycles : float, optional
Count or repetition parameter. Default is 20.
xs : str, optional
Layer or cross-section name used by the device. Default is 'strip'.
layer : str, optional
Layer or cross-section name used by the device. Default is None.
w_bend_port : Optional[float], optional
Width parameter in microns. Default is None.
Lport : int, optional
Length parameter in microns. Default is 10.
Ltp : int, optional
Length parameter in microns. Default is 10.
res : float, optional
Value for the res parameter. Default is 0.5.
cell_xs_transition : Any, optional
Cell or component dependency used by this device. Default is None.
port_angle : float, optional
Value for the port_angle parameter. Default is 180.
show_pins : bool, optional
Whether to draw pin markers in the generated layout. Default is False.
sharp_patch : bool, optional
Whether to add geometry patches for sharp corners or cladding continuity. Default is True.
in_out_align : bool, optional
Value for the in_out_align parameter. Default is True.
Lpatch : float, optional
Length parameter in microns. Default is 0.05.
"""
def __init__(self,
name: str = None,
Dmin: float = 50,
@@ -653,6 +757,48 @@ class spiral_rectangle:
return C
class Spiral_Rect_STD(spiral_rectangle):
"""
Spiral Rect STD primitive component.
This component builds the Spiral Rect STD layout cell.
Parameters
----------
name : str, optional
Unique identifier for the device cell. Default is None.
Dmin : float, optional
Value for the Dmin parameter. Default is 50.
R_bend : float, optional
Radius parameter in microns. Default is 10.
Lmin : float, optional
Length parameter in microns. Default is 50.
width : float, optional
Width parameter in microns. Default is 2.
w_port : float, optional
Width parameter in microns. Default is 0.45.
gap : float, optional
Spacing or gap parameter in microns. Default is 1.
cycles : float, optional
Count or repetition parameter. Default is 20.
xs : str, optional
Layer or cross-section name used by the device. Default is 'strip'.
layer : str, optional
Layer or cross-section name used by the device. Default is None.
Lport : int, optional
Length parameter in microns. Default is 10.
in_out_align : bool, optional
Value for the in_out_align parameter. Default is True.
res : float, optional
Value for the res parameter. Default is 0.5.
cell_xs_transition : Any, optional
Cell or component dependency used by this device. Default is None.
port_angle : float, optional
Value for the port_angle parameter. Default is 180.
show_pins : bool, optional
Whether to draw pin markers in the generated layout. Default is False.
sharp_patch : bool, optional
Whether to add geometry patches for sharp corners or cladding continuity. Default is True.
"""
def __init__(self,
name: str = None,
Dmin: float = 50,
@@ -693,6 +839,50 @@ class Spiral_Rect_STD(spiral_rectangle):
in_out_align=in_out_align)
class spiral_circle:
"""
spiral circle primitive component.
This component builds the spiral circle layout cell.
Parameters
----------
name : str, optional
Unique identifier for the device cell. Default is None.
Dmin : float, optional
Value for the Dmin parameter. Default is 50.
width : float, optional
Width parameter in microns. Default is 2.
w_port : float, optional
Width parameter in microns. Default is 0.45.
w_bend_center : float, optional
Width parameter in microns. Default is 1.
gap : float, optional
Spacing or gap parameter in microns. Default is 1.
cycles : float, optional
Count or repetition parameter. Default is 20.
xs : str, optional
Layer or cross-section name used by the device. Default is 'strip'.
layer : str, optional
Layer or cross-section name used by the device. Default is None.
Lport : int, optional
Length parameter in microns. Default is 10.
res : float, optional
Value for the res parameter. Default is 0.5.
rib2strip : bool, optional
Value for the rib2strip parameter. Default is True.
port_angle : float, optional
Value for the port_angle parameter. Default is 180.
Euler_Sbend : bool, optional
Value for the Euler_Sbend parameter. Default is False.
show_pins : bool, optional
Whether to draw pin markers in the generated layout. Default is False.
sharp_patch : bool, optional
Whether to add geometry patches for sharp corners or cladding continuity. Default is True.
strict_condition : bool, optional
Value for the strict_condition parameter. Default is False.
R_ratio_mamnual : Any, optional
Radius parameter in microns. Default is None.
"""
def __init__(self,
name: str = None,
Dmin: float = 50,
@@ -942,6 +1132,46 @@ class spiral_circle:
return C
class Spiral_Cicle_MM(spiral_circle):
"""
Spiral Cicle MM primitive component.
This component builds the Spiral Cicle MM layout cell.
Parameters
----------
name : str, optional
Unique identifier for the device cell. Default is None.
Dmin : float, optional
Value for the Dmin parameter. Default is 50.
width : float, optional
Width parameter in microns. Default is 2.
w_port : float, optional
Width parameter in microns. Default is 0.45.
w_bend_center : float, optional
Width parameter in microns. Default is 1.
gap : float, optional
Spacing or gap parameter in microns. Default is 1.
cycles : float, optional
Count or repetition parameter. Default is 20.
xs : str, optional
Layer or cross-section name used by the device. Default is 'strip'.
layer : str, optional
Layer or cross-section name used by the device. Default is None.
Lport : int, optional
Length parameter in microns. Default is 10.
res : float, optional
Value for the res parameter. Default is 0.5.
rib2strip : bool, optional
Value for the rib2strip parameter. Default is True.
port_angle : float, optional
Value for the port_angle parameter. Default is 180.
show_pins : bool, optional
Whether to draw pin markers in the generated layout. Default is False.
sharp_patch : bool, optional
Whether to add geometry patches for sharp corners or cladding continuity. Default is True.
strict_condition : bool, optional
Value for the strict_condition parameter. Default is False.
"""
def __init__(self,
name: str = None,
Dmin: float = 50,
@@ -974,6 +1204,44 @@ class Spiral_Cicle_MM(spiral_circle):
strict_condition=strict_condition)
class Spiral_Cicle_STD(spiral_circle):
"""
Spiral Cicle STD primitive component.
This component builds the Spiral Cicle STD layout cell.
Parameters
----------
name : str, optional
Unique identifier for the device cell. Default is None.
Dmin : float, optional
Value for the Dmin parameter. Default is 50.
width : float, optional
Width parameter in microns. Default is 2.
w_port : float, optional
Width parameter in microns. Default is 0.45.
gap : float, optional
Spacing or gap parameter in microns. Default is 1.
cycles : float, optional
Count or repetition parameter. Default is 20.
xs : str, optional
Layer or cross-section name used by the device. Default is 'strip'.
layer : str, optional
Layer or cross-section name used by the device. Default is None.
Lport : int, optional
Length parameter in microns. Default is 10.
res : float, optional
Value for the res parameter. Default is 0.5.
rib2strip : bool, optional
Value for the rib2strip parameter. Default is True.
port_angle : float, optional
Value for the port_angle parameter. Default is 180.
show_pins : bool, optional
Whether to draw pin markers in the generated layout. Default is False.
sharp_patch : bool, optional
Whether to add geometry patches for sharp corners or cladding continuity. Default is True.
strict_condition : bool, optional
Value for the strict_condition parameter. Default is False.
"""
def __init__(self,
name: str = None,
Dmin: float = 50,