|
70 | 70 | "id": "c360bd0ea9a5f262"
|
71 | 71 | },
|
72 | 72 | {
|
| 73 | + "metadata": {}, |
73 | 74 | "cell_type": "code",
|
74 | 75 | "source": [
|
75 | 76 | "import numpy as np\n",
|
76 | 77 | "from mat3ra.made.tools.utils.coordinate import CoordinateCondition\n",
|
77 | 78 | "\n",
|
78 | 79 | "# Custom Coordinate Condition for a torus shape\n",
|
79 | 80 | "class CustomCoordinateCondition(CoordinateCondition):\n",
|
80 |
| - " center: List[float] = [0.5, 0.5, 0.5]\n", |
| 81 | + " center: List[float] = [0.5, 0.5, 0.0]\n", |
81 | 82 | " major_radius: float = 0.5\n",
|
82 | 83 | " minor_radius: float = 0.1 \n",
|
83 | 84 | "\n",
|
|
89 | 90 | " distance_to_torus = np.sqrt((xy_distance - self.major_radius) ** 2 + (coord[2] - self.center[2]) ** 2)\n",
|
90 | 91 | " return distance_to_torus <= self.minor_radius\n"
|
91 | 92 | ],
|
92 |
| - "metadata": { |
93 |
| - "collapsed": false |
94 |
| - }, |
95 |
| - "id": "9d8b1890b34d850a", |
| 93 | + "id": "55f4289a6545c504", |
96 | 94 | "outputs": [],
|
97 | 95 | "execution_count": null
|
98 | 96 | },
|
|
107 | 105 | "id": "535bbac2c3f2832b"
|
108 | 106 | },
|
109 | 107 | {
|
| 108 | + "metadata": {}, |
110 | 109 | "cell_type": "code",
|
111 | 110 | "source": [
|
112 | 111 | "CENTER_POSITION = [0.5, 0.5, 0.5] # Center of the torus in crystal coordinates\n",
|
113 | 112 | "MAJOR_RADIUS = 0.3 # Major radius of the torus\n",
|
114 | 113 | "MINOR_RADIUS = 0.1 # Minor radius of the torus\n",
|
| 114 | + "USE_CARTESIAN_COORDINATES = False # Use Cartesian coordinates for the condition\n", |
115 | 115 | "\n",
|
116 | 116 | "NUMBER_OF_ADDED_LAYERS = 3 # Number of layers to add to the defect\n",
|
117 |
| - "USE_CARTESIAN_COORDINATES = False\n", |
118 | 117 | "\n",
|
119 |
| - "AUTO_ADD_VACUUM = True # Automatically add vacuum to the slab\n", |
120 |
| - "VACUUM_THICKNESS = 5.0 # Thickness of the vacuum to add\n", |
121 | 118 | "\n",
|
122 | 119 | "# Create slab with default parameters if imported material is not a slab\n",
|
123 | 120 | "DEFAULT_SLAB_PARAMETERS = {\n",
|
|
128 | 125 | " \"xy_supercell_matrix\": [[10, 0], [0, 10]]\n",
|
129 | 126 | "}"
|
130 | 127 | ],
|
131 |
| - "metadata": { |
132 |
| - "collapsed": false |
133 |
| - }, |
134 |
| - "id": "79924b8b23c8850b", |
| 128 | + "id": "4f6c437b81325730", |
135 | 129 | "outputs": [],
|
136 | 130 | "execution_count": null
|
137 | 131 | },
|
|
0 commit comments