engeom 0.2.6__cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl → 0.2.8__cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
engeom/_plot/pyvista.py CHANGED
@@ -176,19 +176,48 @@ else:
176
176
  bold=False,
177
177
  )
178
178
 
179
- def coordinate_frame(self, iso: Iso3, size: float = 1.0):
179
+ def coordinate_frame(self, iso, size: float = 1.0, line_width=3.0, label: str | None = None,
180
+ label_size: int = 12):
180
181
  """
181
182
  Add a coordinate frame to the plotter. This will appear as three lines, with X in red, Y in green,
182
183
  and Z in blue. The length of each line is determined by the `size` parameter.
183
- :param iso: The isometry to use as the origin and orientation of the coordinate frame.
184
+ :param iso: The isometry to use as the origin and orientation of the coordinate frame. May be an `Iso3`, a
185
+ 4x4 `numpy.ndarray` that validly converts into an `Iso3`, or anything with an `as_numpy` method that
186
+ returns a valid 4x4 `numpy.ndarray`.
184
187
  :param size: The length of each line in the coordinate frame.
188
+ :param line_width: The width of the lines in the coordinate frame.
189
+ :param label: An optional label to display at the origin of the coordinate frame.
190
+ :param label_size: The size of the label text.
185
191
  """
192
+ if not isinstance(iso, Iso3):
193
+ if hasattr(iso, "as_numpy"):
194
+ iso = iso.as_numpy()
195
+
196
+ if isinstance(iso, numpy.ndarray):
197
+ if iso.shape == (4, 4):
198
+ iso = Iso3(iso)
199
+ else:
200
+ raise ValueError("Invalid shape for iso: expected (4, 4), got {iso.shape}")
201
+ else:
202
+ raise TypeError("Invalid type for iso: expected Iso3 or numpy.ndarray, got {type(iso)}")
203
+
186
204
  points = numpy.array([[0, 0, 0], [size, 0, 0], [0, size, 0], [0, 0, size]], dtype=numpy.float64)
187
205
  points = iso.transform_points(points)
188
206
 
189
- self.plotter.add_lines(points[[0, 1]], color="red", width=5.0)
190
- self.plotter.add_lines(points[[0, 2]], color="green", width=5.0)
191
- self.plotter.add_lines(points[[0, 3]], color="blue", width=5.0)
207
+ self.plotter.add_lines(points[[0, 1]], color="red", width=line_width)
208
+ self.plotter.add_lines(points[[0, 2]], color="green", width=line_width)
209
+ self.plotter.add_lines(points[[0, 3]], color="blue", width=line_width)
210
+
211
+ if label:
212
+ self.plotter.add_point_labels(
213
+ [points[0]],
214
+ [label],
215
+ show_points=False,
216
+ background_color="white",
217
+ font_family="courier",
218
+ font_size=label_size,
219
+ bold=False,
220
+ )
192
221
 
193
222
  def label(self, point: PlotCoords, text: str, **kwargs):
194
223
  """
engeom/engeom.abi3.so CHANGED
Binary file
engeom/geom3.pyi CHANGED
@@ -1282,3 +1282,29 @@ class Aabb3:
1282
1282
  :return: a new AABB object with the shrunk bounds.
1283
1283
  """
1284
1284
  ...
1285
+
1286
+
1287
+ class RayBundle3:
1288
+ """
1289
+ A class representing a bundle of rays in 3D space. The rays are represented by a set of origins and directions,
1290
+ which are used to define the rays.
1291
+
1292
+ This class is used for ray tracing operations, such as intersection tests with meshes or other geometric objects.
1293
+ """
1294
+
1295
+ def __init__(self, array: NDArray[float]):
1296
+ """
1297
+ Create a ray bundle from a numpy array of shape (n, 6) containing the origins and directions of the rays.
1298
+ :param array: a numpy array of shape (n, 6) containing the origins and directions of the rays.
1299
+ """
1300
+ ...
1301
+
1302
+ def intersect_mesh(self, mesh: Mesh, iso: Iso3 | None = None, angle: float | None = None) -> NDArray[float]:
1303
+ """
1304
+
1305
+ :param angle:
1306
+ :param mesh:
1307
+ :param iso:
1308
+ :return:
1309
+ """
1310
+ ...
@@ -0,0 +1,9 @@
1
+ """
2
+ This module provides a number of classes and functions for working with 3D raster (voxel) data.
3
+ """
4
+
5
+ from ..engeom import _raster3
6
+
7
+ # Global import of all functions
8
+ for name in [n for n in dir(_raster3) if not n.startswith("_")]:
9
+ globals()[name] = getattr(_raster3, name)
engeom/raster3.pyi ADDED
@@ -0,0 +1,19 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import List
4
+
5
+ from numpy.typing import NDArray
6
+
7
+ def clusters_from_sparse(indices: NDArray[int]) -> List[NDArray[int]]:
8
+ """
9
+ Find clusters of connected voxel indices from a sparse array of voxel coordinates. The input array should be a Nx3
10
+ array of integer voxel indices. The output is a list of arrays, where each array contains the indices of a single
11
+ cluster of connected voxels.
12
+
13
+ The connectivity is defined as 26-connectivity, i.e. each voxel is connected to all neighbors with which it shares
14
+ at least one corner.
15
+
16
+ :param indices: Nx3 array of voxel indices
17
+ :return: List of arrays, each containing a Mx3 numpy array of the indices of a single cluster of connected voxels
18
+ """
19
+ ...
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: engeom
3
- Version: 0.2.6
3
+ Version: 0.2.8
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -1,21 +1,23 @@
1
- engeom-0.2.6.dist-info/METADATA,sha256=OfaBYpqRV9lwR1COpGbkUpjyeoUHLctJLSCv8QC8KoM,494
2
- engeom-0.2.6.dist-info/WHEEL,sha256=enHAT78HPHhu3XKDSOZi_EBRo8KIHOWyiLnoj9YUFq8,129
3
- engeom/geom2/__init__.py,sha256=JFpiLyROUh6vyakG-7JDSlCMCn4QB2MQ8bz3uVCaAIk,373
4
- engeom/align/__init__.py,sha256=SEeMqeqLKqJC73Mg8GwPwd9NwWnl-dcCqJ4rPdh8yyc,196
5
- engeom/engeom.pyi,sha256=BtUBtYZ_MX8Xk2x_FyzVxRXjJQIazQ1xscbCLO_Y3HA,1516
6
- engeom/__init__.py,sha256=QN5uETqrN442w41foyrcCPV_x6NP-mrxkPJhdvdey1g,109
7
- engeom/align.pyi,sha256=QCSKrTLkCoaIubcrPU9J-wDZe1lRP0GbPgWZmonXjo0,997
8
- engeom/geom2.pyi,sha256=508YJVNAJcZxEIZcWi4upcGtiZKoRnGtAW7TfTU3b3A,42922
9
- engeom/metrology.pyi,sha256=9I5un86VB_2gmQBrVYhX8JzILTUADMLB9Em8ttJxrWg,4044
10
- engeom/_plot/__init__.py,sha256=F_KviZtxzZGwfEjjn8Ep46N4UVl8VpFJWBzbBUE_J7A,30
11
- engeom/_plot/common.py,sha256=Py78ufN3yi59hPwv21SoGcqyZUJS-_PmK8tlAKgSG7Q,517
12
- engeom/_plot/matplotlib.py,sha256=tTk4Fu6hDVxP1655koeT9B0JxkoURTr30ZyBV_jzTi8,11643
13
- engeom/_plot/pyvista.py,sha256=-G7ZxJQVfLLsVQP03jRRuu-F3Gq3bQxectBVS2L-bdk,10454
1
+ engeom-0.2.8.dist-info/METADATA,sha256=JEVnOcfRIqLGQ4lLnjmICd0plsKM9yq-GCYZi1K4L1g,494
2
+ engeom-0.2.8.dist-info/WHEEL,sha256=k0er-u5m64P9DpEYbKzvuotgEtd5z5FLn8Li8lnOqEs,129
14
3
  engeom/metrology/__init__.py,sha256=XvEhG8uDm1olWwZHDDrQv9LFP5zXhbsGx27PqRq8WE0,304
15
- engeom/geom3/__init__.py,sha256=l8B0iDhJ4YiRbslJLN791XWai2DWrpmZptnzIETMS9g,370
16
- engeom/geom3.pyi,sha256=ZW37Pg2SLA74RTUmz0Ac82UmLTFm6K9BSHG_rWeX-Ro,55237
17
4
  engeom/plot.py,sha256=2b81-dW7aKKC1TjoDtRmppFKpzQOia7w6c4T2pExN0E,1065
18
5
  engeom/airfoil/__init__.py,sha256=gpS9pVepUu90XJ-ePndNupbUMKI0RGxNXPxD9x0iVHY,274
6
+ engeom/_plot/common.py,sha256=Py78ufN3yi59hPwv21SoGcqyZUJS-_PmK8tlAKgSG7Q,517
7
+ engeom/_plot/matplotlib.py,sha256=tTk4Fu6hDVxP1655koeT9B0JxkoURTr30ZyBV_jzTi8,11643
8
+ engeom/_plot/pyvista.py,sha256=COVgiw4XlcbGjiLYE-eJjK_TJgONMGdW54pFsLczFm4,11879
9
+ engeom/_plot/__init__.py,sha256=F_KviZtxzZGwfEjjn8Ep46N4UVl8VpFJWBzbBUE_J7A,30
10
+ engeom/__init__.py,sha256=QN5uETqrN442w41foyrcCPV_x6NP-mrxkPJhdvdey1g,109
11
+ engeom/align/__init__.py,sha256=SEeMqeqLKqJC73Mg8GwPwd9NwWnl-dcCqJ4rPdh8yyc,196
12
+ engeom/geom3.pyi,sha256=fcWaBcwVp76enp9aZrpnmVhIDpWxgay8eBauLR9T1Lk,56105
13
+ engeom/geom3/__init__.py,sha256=l8B0iDhJ4YiRbslJLN791XWai2DWrpmZptnzIETMS9g,370
14
+ engeom/raster3.pyi,sha256=sBXXYXcDBiDU_OFDQiwa7Q3GcwSiUc4CLy6nJ1MwFqM,790
19
15
  engeom/airfoil.pyi,sha256=VTeJBoS9Iij7p-92R7jCqzPasHmvAUocyzc6BSx7mvM,23557
20
- engeom/engeom.abi3.so,sha256=Opl3ft9h2rZPz0Pjw7CSsuBd_IAXFRvDRsb-EqBnbZM,3111368
21
- engeom-0.2.6.dist-info/RECORD,,
16
+ engeom/metrology.pyi,sha256=9I5un86VB_2gmQBrVYhX8JzILTUADMLB9Em8ttJxrWg,4044
17
+ engeom/geom2.pyi,sha256=508YJVNAJcZxEIZcWi4upcGtiZKoRnGtAW7TfTU3b3A,42922
18
+ engeom/engeom.pyi,sha256=BtUBtYZ_MX8Xk2x_FyzVxRXjJQIazQ1xscbCLO_Y3HA,1516
19
+ engeom/geom2/__init__.py,sha256=JFpiLyROUh6vyakG-7JDSlCMCn4QB2MQ8bz3uVCaAIk,373
20
+ engeom/align.pyi,sha256=QCSKrTLkCoaIubcrPU9J-wDZe1lRP0GbPgWZmonXjo0,997
21
+ engeom/raster3/__init__.py,sha256=iaayLrvco-ZMZPyeK47ox7rYne_51DNb2T2Q0iNNeKE,289
22
+ engeom/engeom.abi3.so,sha256=AacYClSMsRGWHVP6i4qsugKaLlnRW4MEjIbiSKgXNWo,3169120
23
+ engeom-0.2.8.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: maturin (1.8.2)
2
+ Generator: maturin (1.8.3)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64