Dim3
This module implements a 3D tessellation and trimming algorithm in the Tessellation3D class.
This module is part of the tessellation package and can be used for 3D orbit tessellation tasks.
It inherits from TessellationBase and includes methods for calculating tetrahedron side lengths
and tetrahedron volumes. The Normalization nested class includes normalization methods.
Additionally, the class offers a plotting function to visualize the tessellation.
Tessellation3D
¶
Bases: TessellationBase
A class for the tessellation and trimming algorithm applied in 3 dimensions.
Source code in commensurability/tessellation/dim3.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | |
volume: float
property
¶
Alias for measure.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Volume of the tessellation (same as measure). |
Normalization
¶
A class providing various methods for normalization in 3D.
Methods:
| Name | Description |
|---|---|
sphere |
Compute the volume of a sphere containing the points. |
cylinder |
Compute the volume of a cylinder containing the points. |
Rz_convexhull |
Compute the volume of the convex hull in the R vs z plane rotated around the z-axis. |
convexhull |
Compute the volume of the convex hull of the points. |
convexhull_rot4 |
Compute the volume of the convex hull of the points including copied rotations by 90 degrees four times. |
default |
Default normalization method (convexhull_rot4). |
Source code in commensurability/tessellation/dim3.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | |
Rz_convexhull()
¶
Compute the volume of the convex hull in the R vs z plane rotated around the z-axis.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Volume of the convex hull after rotation. |
Source code in commensurability/tessellation/dim3.py
convexhull()
¶
Compute the volume of the convex hull of the points.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Volume of the convex hull. |
Note
This method may not work correctly for co-rotation cases.
Source code in commensurability/tessellation/dim3.py
convexhull_rot4()
¶
Compute the volume of the convex hull of the points including copied rotations by 90 degrees four times.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Volume of the convex hull. |
Source code in commensurability/tessellation/dim3.py
cylinder()
¶
Compute the volume of a cylinder containing the points.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Volume of the cylinder. |
sphere()
¶
Compute the volume of a sphere containing the points.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Volume of the sphere. |
plot(ax, plot_included=True, plot_removed=False, plot_points=True)
¶
Plot the 3D tessellation. Included tetrahedra are green, excluded tetrahedra are red. Shared edges are blue.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ax
|
Axes3D
|
Matplotlib 3D axes. |
required |
plot_included
|
bool
|
Whether to plot included triangles (default True). |
True
|
plot_removed
|
bool
|
Whether to plot removed triangles (default False). |
False
|
plot_points
|
bool
|
Whether to plot points (default True). |
True
|
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If tessellation failed. |
Source code in commensurability/tessellation/dim3.py
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | |
simplex_measure(*vertices)
staticmethod
¶
Compute the measure (volume) of a 3D simplex defined by its vertices.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*vertices
|
ndarray
|
The vertices of the simplex. |
()
|
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The volume of the simplex. |
Source code in commensurability/tessellation/dim3.py
simplex_sides(*vertices)
staticmethod
¶
Compute the side lengths of a 3D simplex defined by its vertices.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*vertices
|
ndarray
|
The vertices of the simplex. |
()
|
Returns:
| Name | Type | Description |
|---|---|---|
list |
list
|
List of side lengths. |