Exemple #1
0
def makeResonator(radius = 10, width = 0.5, space = 1.0):
	#------------------------
	# Make a ring resonator
	# radius: of the ring
	# width: of the ring and the line
	# space: space between the edge of the ring and the line
	#------------------------
	C= Device("Resonator")
	R = pg.ring(radius = radius, width = width)
	C.add_ref(R)
	L1 = makeLine(radius+space,-radius,width,2*radius)
	C.add_ref(L1)
	L2 = makeLine(-radius-space-width,-radius,width,2*radius)
	C.add_ref(L2)
	

	return C
Exemple #2
0
D = pg.ellipse(radii = (10,5), angle_resolution = 2.5, layer = 0)
create_image(D, 'ellipse')

# example-circle
import phidl.geometry as pg
from phidl import quickplot as qp

D = pg.circle(radius = 10, angle_resolution = 2.5, layer = 0)
qp(D) # quickplot the geometry
create_image(D, 'circle')

# example-ring
import phidl.geometry as pg
from phidl import quickplot as qp

D = pg.ring(radius = 5, width = 0.5, angle_resolution = 2.5, layer = 0)
qp(D) # quickplot the geometry
create_image(D, 'ring')

# example-arc
import phidl.geometry as pg
from phidl import quickplot as qp

D = pg.arc(radius = 2.0, width = 0.5, theta = 45, start_angle = 0,
           angle_resolution = 2.5, layer = 0)
qp(D) # quickplot the geometry
create_image(D, 'arc')

# example-straight
import phidl.geometry as pg
from phidl import quickplot as qp
Exemple #3
0
def test_ring():
    D = pg.ring(radius=10, width=0.5, angle_resolution=2.5, layer=0)
    h = D.hash_geometry(precision=1e-4)
    assert (h == '66b57b1544c9c48d9babc107dc93e7b0bf378499')