Dim2
This module implements a 2D tessellation and trimming algorithm in the Tessellation2D class.
This module is part of the tessellation package and can be used for 2D orbit tessellation tasks.
It inherits from TessellationBase and includes methods for calculating triangle side lengths
and triangle areas. The Normalization nested class includes normalization methods.
Additionally, the class offers a plotting function to visualize the tessellation.
Tessellation2D
¶
Bases: TessellationBase
A class for the tessellation and trimming algorithm applied in 2 dimensions.
Source code in commensurability/tessellation/dim2.py
17 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 | |
area: float
property
¶
Alias for measure.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Area of the tessellation (same as measure). |
Normalization
¶
A class providing various methods for normalization in 2D.
Methods:
| Name | Description |
|---|---|
circle |
Compute the area of a circle containing the points. |
default |
Default normalization method (circle). |
Source code in commensurability/tessellation/dim2.py
circle()
¶
Compute the area of a circle containing the points.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Area of the circle. |
plot(ax, plot_included=True, plot_removed=False, plot_points=True)
¶
Plot the 2D tessellation. Included triangles are green, excluded triangles are red.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ax
|
Axes
|
Matplotlib 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/dim2.py
simplex_measure(*vertices)
staticmethod
¶
Compute the measure (area) of a 2D simplex defined by its vertices.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*vertices
|
ndarray
|
The vertices of the simplex. |
()
|
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The area of the simplex. |
Source code in commensurability/tessellation/dim2.py
simplex_sides(*vertices)
staticmethod
¶
Compute the side lengths of a 2D 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. |