def test_fracture(): poly = gdstk.racetrack((0, 0), 10, 20, 1, vertical=False) frac = poly.fracture(12, 1e-3) assert_same_shape(poly, frac, 2e-3) poly = gdstk.racetrack((0, 50), 10, 20, 1, vertical=True) frac = poly.fracture(12, 1e-3) assert_same_shape(poly, frac, 2e-3)
def fracture_image(): polygon = gdstk.racetrack((0, 0), 30, 60, 40, tolerance=1e-3) poly_list = polygon.fracture() assert len(poly_list) == 10 assert all(p.size == s for p, s in zip( poly_list, [102, 103, 103, 101, 101, 102, 102, 103, 103, 102])) return gdstk.Cell("fracture").add(*poly_list)
def racetrack_image(): racetrack1 = gdstk.racetrack((0, 0), 8, 5) racetrack2 = gdstk.racetrack((18, 0), 8, 5, 3, True) return gdstk.Cell("racetrack").add(racetrack1, racetrack2)
def fracture_image(): polygon = gdstk.racetrack((0, 0), 30, 60, 40, tolerance=1e-3) poly_list = polygon.fracture() # print(len(poly_list)) # print([p.size for p in poly_list]) return gdstk.Cell("fracture").add(*poly_list)