{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Self-intersecting PolySlab\n", "\n", "This tutorial shows how to use the `ComplexPolySlab` plugin in tidy3d to deal with self-intersecting polygon that occurs during extrusion in a slanted polyslab." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2022-07-21T20:35:00.874214Z", "iopub.status.busy": "2022-07-21T20:35:00.873757Z", "iopub.status.idle": "2022-07-21T20:35:01.863810Z", "shell.execute_reply": "2022-07-21T20:35:01.863282Z" }, "scrolled": false, "tags": [] }, "outputs": [ { "data": { "text/html": [ "
[11:56:05] WARNING This version of Tidy3D was pip installed from the __init__.py:103\n", " 'tidy3d-beta' repository on PyPI. Future releases will be \n", " uploaded to the 'tidy3d' repository. From now on, please \n", " use 'pip install tidy3d' instead. \n", "\n" ], "text/plain": [ "\u001b[2;36m[11:56:05]\u001b[0m\u001b[2;36m \u001b[0m\u001b[31mWARNING \u001b[0m This version of Tidy3D was pip installed from the \u001b]8;id=848395;file:///home/weiliang/Documents/tidy3d-core/tidy3d_frontend/tidy3d/__init__.py\u001b\\\u001b[2m__init__.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=245123;file:///home/weiliang/Documents/tidy3d-core/tidy3d_frontend/tidy3d/__init__.py#103\u001b\\\u001b[2m103\u001b[0m\u001b]8;;\u001b\\\n", "\u001b[2;36m \u001b[0m \u001b[32m'tidy3d-beta'\u001b[0m repository on PyPI. Future releases will be \u001b[2m \u001b[0m\n", "\u001b[2;36m \u001b[0m uploaded to the \u001b[32m'tidy3d'\u001b[0m repository. From now on, please \u001b[2m \u001b[0m\n", "\u001b[2;36m \u001b[0m use \u001b[32m'pip install tidy3d'\u001b[0m instead. \u001b[2m \u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
INFO Using client version: 1.9.0rc2 __init__.py:121\n", "\n" ], "text/plain": [ "\u001b[2;36m \u001b[0m\u001b[2;36m \u001b[0m\u001b[34mINFO \u001b[0m Using client version: \u001b[1;36m1.9\u001b[0m.0rc2 \u001b]8;id=28351;file:///home/weiliang/Documents/tidy3d-core/tidy3d_frontend/tidy3d/__init__.py\u001b\\\u001b[2m__init__.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=906229;file:///home/weiliang/Documents/tidy3d-core/tidy3d_frontend/tidy3d/__init__.py#121\u001b\\\u001b[2m121\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import gdstk\n", "\n", "import tidy3d as td\n", "\n", "from tidy3d.plugins import ComplexPolySlab" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1: concave polygon on the top with positive sidewall angle\n", "\n", "Let's consider a concave polygon as shown in the following figure. As we dilate the polygon, the length of the edge in the middle will approach 0, and the two vertices at the end of the edge can be degenerate. Further dilation will result in a self-intersecting polygon. The collapsing of the two neighboring vertices is known as one type of edge events. There are other types of edge events as well, while our plugin at the moment will focus on this type of edge event." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "