Skip to content

Commit 3d73d77

Browse files
fix gap meshing
1 parent 63c8cc1 commit 3d73d77

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tidy3d/components/grid/grid_spec.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,6 +1630,14 @@ def _find_vertical_intersections(
16301630
if ind_end == ind_beg:
16311631
continue
16321632

1633+
# intersects one grid line but almost parallel to it
1634+
if np.abs(ind_end - ind_beg) == 1 and np.abs(
1635+
v_beg[0] - v_end[0]
1636+
) < 2 * GAP_MESHING_TOL * np.abs(
1637+
grid_x_coords[ind_beg - 1] - grid_x_coords[ind_end - 1]
1638+
):
1639+
continue
1640+
16331641
# sort vertices in ascending order to make treatmeant unifrom
16341642
reverse = False
16351643
if ind_beg > ind_end:

0 commit comments

Comments
 (0)