engeom 0.2.14__cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl → 0.2.15__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/align.pyi
CHANGED
@@ -29,4 +29,25 @@ def points_to_cloud(
|
|
29
29
|
search_radius: float,
|
30
30
|
initial: Iso3,
|
31
31
|
) -> Iso3:
|
32
|
+
...
|
33
|
+
|
34
|
+
def mesh_to_mesh_iterative(
|
35
|
+
mesh: Mesh,
|
36
|
+
reference: Mesh,
|
37
|
+
sample_spacing: float,
|
38
|
+
initial: Iso3,
|
39
|
+
mode: DeviationMode,
|
40
|
+
max_iter: int
|
41
|
+
) -> Iso3:
|
42
|
+
"""
|
43
|
+
Perform an iterative alignment of a mesh to a reference mesh using the specified parameters.
|
44
|
+
|
45
|
+
:param mesh: the mesh to align.
|
46
|
+
:param reference: the reference mesh to align to.
|
47
|
+
:param sample_spacing: the spacing between samples for the alignment.
|
48
|
+
:param initial: the initial guess for the isometry.
|
49
|
+
:param mode: the mode to use for the deviation calculation.
|
50
|
+
:param max_iter: the maximum number of iterations to perform.
|
51
|
+
:return: the isometry that best aligns the mesh to the reference mesh.
|
52
|
+
"""
|
32
53
|
...
|
engeom/engeom.abi3.so
CHANGED
Binary file
|
engeom/geom3.pyi
CHANGED
@@ -11,6 +11,50 @@ import metrology
|
|
11
11
|
Transformable3 = TypeVar("Transformable3", Vector3, Point3, Plane3, Iso3, SurfacePoint3)
|
12
12
|
PointOrVector3 = TypeVar("PointOrVector3", Vector3, Point3)
|
13
13
|
|
14
|
+
type Lptf3LoadEnum = Lptf3Load.All | Lptf3Load.TakeEveryN | Lptf3Load.SmoothSample
|
15
|
+
|
16
|
+
|
17
|
+
class Lptf3Load:
|
18
|
+
"""
|
19
|
+
An enumeration representing the different load types that can be used when loading LPTF3 files.
|
20
|
+
"""
|
21
|
+
|
22
|
+
class All:
|
23
|
+
def __init__(self):
|
24
|
+
"""
|
25
|
+
Load all points from the file
|
26
|
+
"""
|
27
|
+
...
|
28
|
+
|
29
|
+
class TakeEveryN:
|
30
|
+
def __init__(self, n: int):
|
31
|
+
"""
|
32
|
+
Load every nth row from the file. The loader will attempt to roughly match the inter-row spacing when
|
33
|
+
loading the individual points, resulting in an approximate grid-like array of points.
|
34
|
+
:param n: the interval at which to take rows from the file.
|
35
|
+
"""
|
36
|
+
...
|
37
|
+
|
38
|
+
class SmoothSample:
|
39
|
+
def __init__(self, take_every: int, look_scale: float, weight_scale: float, max_move: float):
|
40
|
+
"""
|
41
|
+
Load the points using a downsampling filter, which downsamples the point cloud similar to the `TakeEveryN`
|
42
|
+
method, but also performs a gaussian smoothing step using the full original cloud. This takes the longest
|
43
|
+
time, but can remove a significant amount of noise from the data by making use of an adjacency structure
|
44
|
+
that will be lost once the points are turned into a cloud.
|
45
|
+
|
46
|
+
:param take_every: the interval at which to take rows from the file.
|
47
|
+
:param look_scale: smoothing will use a sampling window relative to the `take_every` spacing, so a value
|
48
|
+
of 1 will use the same spacing as `take_every`, while a value of 2 will use twice that spacing. A reasonable
|
49
|
+
default for preserving detail is 0.5.
|
50
|
+
:param weight_scale: during the gaussian smoothing, neighboring points will be weighted by their distance
|
51
|
+
from the point being smoothed. At `weight_scale` of 1, the standard deviation of the gaussian will be
|
52
|
+
slightly larger than the `look_scale` distance.
|
53
|
+
:param max_move: the maximum distance a point can move when smoothing. If a point attempts to move more
|
54
|
+
than 10x this distance, it will not be moved at all. Otherwise, it will be clamped to within this distance.
|
55
|
+
"""
|
56
|
+
...
|
57
|
+
|
14
58
|
|
15
59
|
class Vector3(Iterable[float]):
|
16
60
|
"""
|
@@ -487,6 +531,13 @@ class Iso3:
|
|
487
531
|
""" Return the identity isometry. """
|
488
532
|
...
|
489
533
|
|
534
|
+
@staticmethod
|
535
|
+
def from_quaternion(tx: float, ty: float, tz: float, i: float, j: float, k: float, w: float) -> Iso3:
|
536
|
+
"""
|
537
|
+
Create an isometry from a translation and a quaternion representing the rotation.
|
538
|
+
:return: an isometry containing both translation and rotation components.
|
539
|
+
"""
|
540
|
+
|
490
541
|
@staticmethod
|
491
542
|
def from_translation(x: float, y: float, z: float) -> Iso3:
|
492
543
|
"""
|
@@ -956,6 +1007,36 @@ class Mesh:
|
|
956
1007
|
"""
|
957
1008
|
...
|
958
1009
|
|
1010
|
+
@staticmethod
|
1011
|
+
def load_lptf3(path: str | Path, params: Lptf3LoadEnum) -> Mesh:
|
1012
|
+
"""
|
1013
|
+
This function reads a LPTF3 file, which is a compact file format for storing 3D point data
|
1014
|
+
taken from a laser profile triangulation scanner. The format is simple and compact, capable
|
1015
|
+
of practically storing about 200k points (with an 8-bit color value each) per MB when using a
|
1016
|
+
16-bit coordinate format, or half that when using a 32-bit coordinate format.
|
1017
|
+
|
1018
|
+
There are a few different ways to load the data, controlled by the `Lptf3Load` enum:
|
1019
|
+
- `Lptf3Load.All`: Load all points from the file.
|
1020
|
+
- `Lptf3Load.TakeEveryN(n)`: Load every Nth row from the file. The loader will attempt to
|
1021
|
+
roughly match the x spacing of the points to the gap distance between rows, resulting in a
|
1022
|
+
grid-like point cloud with an approximately uniform point spacing when viewed from the
|
1023
|
+
X-Y plane. This is a very fast method of retrieving a downsampled set of points.
|
1024
|
+
- `Lptf3Load.SmoothSample(params)`: Load the points using a downsampling filter, which
|
1025
|
+
downsamples the point cloud similar to the `TakeEveryN` method, but also performs a gaussian
|
1026
|
+
smoothing step using the full original cloud. This takes the longest time, but can remove
|
1027
|
+
a significant amount of noise from the data by making use of an adjacency structure that
|
1028
|
+
will be lost once the points are turned into a mesh.
|
1029
|
+
|
1030
|
+
Once the points are loaded, they will be converted into a triangle mesh by connecting points in adjacent
|
1031
|
+
rows with triangles that meet certain edge length criterial. The result is a fast mesh that can be built
|
1032
|
+
using knowledge of the LPTF3's internal structure rather than having to rely on more general techniques
|
1033
|
+
that can build meshes from arbitrary point clouds.
|
1034
|
+
|
1035
|
+
:param path: the path to the LPTF3 file to load.
|
1036
|
+
:param params: the method and parameters to use when loading the LPTF3 file.
|
1037
|
+
"""
|
1038
|
+
...
|
1039
|
+
|
959
1040
|
def write_stl(self, path: str | Path):
|
960
1041
|
"""
|
961
1042
|
Write the mesh to an STL file. This will write the vertices and triangles of the mesh to the file in binary
|
@@ -1082,6 +1163,35 @@ class Mesh:
|
|
1082
1163
|
"""
|
1083
1164
|
...
|
1084
1165
|
|
1166
|
+
def sample_alignment_points(
|
1167
|
+
self,
|
1168
|
+
reference: Mesh,
|
1169
|
+
iso: Iso3,
|
1170
|
+
max_spacing: float,
|
1171
|
+
max_neighbor_angle: float,
|
1172
|
+
out_of_plane_ratio: float,
|
1173
|
+
centroid_ratio: float,
|
1174
|
+
filter_distances: float | None
|
1175
|
+
) -> NDArray[float]:
|
1176
|
+
"""
|
1177
|
+
This is a very specialized, highly selective sampling method used to identify high quality points for
|
1178
|
+
the alignment between two meshes. It begins with a Poisson disk sampling of the mesh, and then inspects the
|
1179
|
+
individual points to evaluate the quality and consistency of their local neighborhood, before projecting their
|
1180
|
+
local neighborhood onto the reference mesh and looking for the same qualities in the projections.
|
1181
|
+
|
1182
|
+
This method will return a numpy array of points which are spaced at least `max_spacing` apart, and which lie
|
1183
|
+
on areas of the mesh of low curvature, away from corners and edges, and which plausibly overlap with a
|
1184
|
+
correspondingly low-curvature area of the reference mesh away from its corners and edges.
|
1185
|
+
|
1186
|
+
:param max_spacing: a Poisson disk sampling radius used to start sampling the mesh. This value is also used to
|
1187
|
+
derive a set of physical limits which will selectively filter different aspects of the sample points.
|
1188
|
+
:param reference: the reference mesh that the alignment candidates will be sampled against. Assuming these
|
1189
|
+
points will be used to perform an alignment, this mesh should be the one that is being aligned to.
|
1190
|
+
:param iso: an isometry to apply to the sampled points before checking against the reference mesh.
|
1191
|
+
:return: a numpy array of shape (n, 3) containing the sampled points.
|
1192
|
+
"""
|
1193
|
+
...
|
1194
|
+
|
1085
1195
|
def section(self, plane: Plane3, tol: float | None = None) -> List[Curve3]:
|
1086
1196
|
"""
|
1087
1197
|
Calculate and return the intersection curves between the mesh and a plane.
|
@@ -1207,6 +1317,15 @@ class Mesh:
|
|
1207
1317
|
:return: a `SurfacePoint3` object containing the closest point and normal
|
1208
1318
|
"""
|
1209
1319
|
...
|
1320
|
+
def point_closest_to(self, x: float, y: float, z: float) -> Point3:
|
1321
|
+
"""
|
1322
|
+
Find the closest point on the surface of the mesh to a given point in space, returning the point
|
1323
|
+
:param x: the x coordinate of the point to find the closest point to
|
1324
|
+
:param y: the y coordinate of the point to find the closest point to
|
1325
|
+
:param z: the z coordinate of the point to find the closest point to
|
1326
|
+
:return: a `Point3` object containing the closest point and normal
|
1327
|
+
"""
|
1328
|
+
...
|
1210
1329
|
|
1211
1330
|
def visual_outline(
|
1212
1331
|
self,
|
@@ -1241,6 +1360,16 @@ class Mesh:
|
|
1241
1360
|
"""
|
1242
1361
|
...
|
1243
1362
|
|
1363
|
+
def boundary_curves(self) -> List[Curve3]:
|
1364
|
+
"""
|
1365
|
+
Extract the boundary curves of the mesh. This will return a list of `Curve3` objects representing the
|
1366
|
+
boundaries of the mesh. The curves will be ordered in a way that they can be used to reconstruct the boundary
|
1367
|
+
of the mesh.
|
1368
|
+
|
1369
|
+
:return: a list of `Curve3` objects representing the boundary curves of the mesh.
|
1370
|
+
"""
|
1371
|
+
...
|
1372
|
+
|
1244
1373
|
@staticmethod
|
1245
1374
|
def create_box(length: float, width: float, height: float) -> Mesh:
|
1246
1375
|
"""
|
@@ -1845,15 +1974,27 @@ class PointCloud:
|
|
1845
1974
|
...
|
1846
1975
|
|
1847
1976
|
@staticmethod
|
1848
|
-
def load_lptf3(path: str | Path,
|
1849
|
-
"""
|
1850
|
-
|
1851
|
-
|
1977
|
+
def load_lptf3(path: str | Path, params: Lptf3LoadEnum) -> PointCloud:
|
1978
|
+
"""
|
1979
|
+
This function reads a LPTF3 file, which is a compact file format for storing 3D point data
|
1980
|
+
taken from a laser profile triangulation scanner. The format is simple and compact, capable
|
1981
|
+
of practically storing about 200k points (with an 8-bit color value each) per MB when using a
|
1982
|
+
16-bit coordinate format, or half that when using a 32-bit coordinate format.
|
1983
|
+
|
1984
|
+
There are a few different ways to load the data, controlled by the `Lptf3Load` enum:
|
1985
|
+
- `Lptf3Load.All`: Load all points from the file.
|
1986
|
+
- `Lptf3Load.TakeEveryN(n)`: Load every Nth row from the file. The loader will attempt to
|
1987
|
+
roughly match the x spacing of the points to the gap distance between rows, resulting in a
|
1988
|
+
grid-like point cloud with an approximately uniform point spacing when viewed from the
|
1989
|
+
X-Y plane. This is a very fast method of retrieving a downsampled point cloud.
|
1990
|
+
- `Lptf3Load.SmoothSample(params)`: Load the points using a downsampling filter, which
|
1991
|
+
downsamples the point cloud similar to the `TakeEveryN` method, but also performs a gaussian
|
1992
|
+
smoothing step using the full original cloud. This takes the longest time, but can remove
|
1993
|
+
a significant amount of noise from the data by making use of an adjacency structure that
|
1994
|
+
will be lost once the points are turned into a cloud.
|
1852
1995
|
|
1853
1996
|
:param path: the path to the LPTF3 file to load.
|
1854
|
-
:param
|
1855
|
-
spacing of the points along the profile to also sample at a rough distance
|
1856
|
-
:return: a `PointCloud` object containing the points, normals, and colors from the file.
|
1997
|
+
:param params: the method and parameters to use when loading the LPTF3 file.
|
1857
1998
|
"""
|
1858
1999
|
...
|
1859
2000
|
|
@@ -1928,7 +2069,7 @@ class PointCloud:
|
|
1928
2069
|
:return: a list of indices of points in this point cloud that overlap with points in the other point cloud.
|
1929
2070
|
"""
|
1930
2071
|
...
|
1931
|
-
|
2072
|
+
|
1932
2073
|
def overlap_mesh_by_reciprocity(self, mesh: Mesh, max_distance: float) -> list[int]:
|
1933
2074
|
"""
|
1934
2075
|
Find the indices of points in this point cloud that "overlap" with triangles in a mesh by looking for
|
engeom/sensors.pyi
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
|
+
from pathlib import Path
|
4
|
+
|
3
5
|
from .geom3 import Point3, Mesh, Iso3, Vector3, PointCloud
|
4
6
|
|
5
7
|
|
@@ -57,8 +59,6 @@ class LaserProfile:
|
|
57
59
|
less than this limit.
|
58
60
|
"""
|
59
61
|
...
|
60
|
-
|
61
|
-
|
62
62
|
|
63
63
|
def get_points(self, target: Mesh, obstruction: Mesh | None, iso: Iso3) -> PointCloud:
|
64
64
|
"""
|
@@ -70,6 +70,19 @@ class LaserProfile:
|
|
70
70
|
"""
|
71
71
|
...
|
72
72
|
|
73
|
+
def load_lptf3(self, path: str | Path, take_every: int | None = None,
|
74
|
+
normal_neighborhood: float | None = None) -> PointCloud:
|
75
|
+
"""
|
76
|
+
Load a laser profile from a LPTF3 file.
|
77
|
+
|
78
|
+
:param path: The path to the LPTF3 file.
|
79
|
+
:param take_every: Optional parameter to take every nth row/col from the file.
|
80
|
+
:param normal_neighborhood: Optional parameter to specify the neighborhood size for normal
|
81
|
+
calculation.
|
82
|
+
:return: A PointCloud containing the points from the LPTF3 file.
|
83
|
+
"""
|
84
|
+
...
|
85
|
+
|
73
86
|
|
74
87
|
class PanningLaserProfile:
|
75
88
|
def __init__(self, laser_line: LaserProfile, y_step: float, steps: int):
|
@@ -1,5 +1,5 @@
|
|
1
|
-
engeom-0.2.
|
2
|
-
engeom-0.2.
|
1
|
+
engeom-0.2.15.dist-info/METADATA,sha256=WoxcP2de4LzW9Sr6URHa3m7fL68MYDvBonV6MtEKYm4,340
|
2
|
+
engeom-0.2.15.dist-info/WHEEL,sha256=wqgoUCPss73LGLEiE1v20si55AN_iZnkZ6-cuGWrS5o,129
|
3
3
|
engeom/__init__.py,sha256=QN5uETqrN442w41foyrcCPV_x6NP-mrxkPJhdvdey1g,109
|
4
4
|
engeom/_plot/__init__.py,sha256=F_KviZtxzZGwfEjjn8Ep46N4UVl8VpFJWBzbBUE_J7A,30
|
5
5
|
engeom/_plot/common.py,sha256=Py78ufN3yi59hPwv21SoGcqyZUJS-_PmK8tlAKgSG7Q,517
|
@@ -7,19 +7,19 @@ engeom/_plot/matplotlib.py,sha256=ahLfgE3QHUFcNig6cHkFu9mwSwfMbDcNqkZmGaBh4Zk,15
|
|
7
7
|
engeom/_plot/pyvista.py,sha256=lzwDWUFTbq1cR46nwVtuK4nn_hzbZnXiJPdoxHcKVDU,13930
|
8
8
|
engeom/airfoil.pyi,sha256=SivSrUo3LZSVgXwIFJtgUUejhPh71y8rekzBwaX6exI,24165
|
9
9
|
engeom/airfoil/__init__.py,sha256=gpS9pVepUu90XJ-ePndNupbUMKI0RGxNXPxD9x0iVHY,274
|
10
|
-
engeom/align.pyi,sha256=
|
10
|
+
engeom/align.pyi,sha256=SaC46l0mqANzp3JAtIk4DdXTLtKBrEr9_xW21algMTk,1935
|
11
11
|
engeom/align/__init__.py,sha256=SEeMqeqLKqJC73Mg8GwPwd9NwWnl-dcCqJ4rPdh8yyc,196
|
12
|
-
engeom/engeom.abi3.so,sha256=
|
12
|
+
engeom/engeom.abi3.so,sha256=SUg2a70BGrgpT7ZL91ex4oLxM0mo-FRGk8jOErU2dUQ,5228984
|
13
13
|
engeom/engeom.pyi,sha256=BtUBtYZ_MX8Xk2x_FyzVxRXjJQIazQ1xscbCLO_Y3HA,1516
|
14
14
|
engeom/geom2.pyi,sha256=oUSner8BEJzJLv82POfOGyjAESw-McZzPq51o9VbdYg,51601
|
15
15
|
engeom/geom2/__init__.py,sha256=JFpiLyROUh6vyakG-7JDSlCMCn4QB2MQ8bz3uVCaAIk,373
|
16
|
-
engeom/geom3.pyi,sha256=
|
16
|
+
engeom/geom3.pyi,sha256=S6PIfcGDxc4kMZDn6uJO_L-DBepzMnUM8RzjiDkQcOU,92982
|
17
17
|
engeom/geom3/__init__.py,sha256=l8B0iDhJ4YiRbslJLN791XWai2DWrpmZptnzIETMS9g,370
|
18
18
|
engeom/metrology.pyi,sha256=9I5un86VB_2gmQBrVYhX8JzILTUADMLB9Em8ttJxrWg,4044
|
19
19
|
engeom/metrology/__init__.py,sha256=XvEhG8uDm1olWwZHDDrQv9LFP5zXhbsGx27PqRq8WE0,304
|
20
20
|
engeom/plot.py,sha256=LTqqO-h1EJL6wanM0hB79s9ohWwaCIijMOHVplY3vmc,1079
|
21
21
|
engeom/raster3.pyi,sha256=sBXXYXcDBiDU_OFDQiwa7Q3GcwSiUc4CLy6nJ1MwFqM,790
|
22
22
|
engeom/raster3/__init__.py,sha256=iaayLrvco-ZMZPyeK47ox7rYne_51DNb2T2Q0iNNeKE,289
|
23
|
-
engeom/sensors.pyi,sha256=
|
23
|
+
engeom/sensors.pyi,sha256=8dQS6PVkbBOdbO17x9UskBOIIh6cP0EILhJXxPVXDNw,4525
|
24
24
|
engeom/sensors/__init__.py,sha256=vy1CXX3gQcaBL25imYmpSAJhlc8v5aDBEBtF6L0PVCs,182
|
25
|
-
engeom-0.2.
|
25
|
+
engeom-0.2.15.dist-info/RECORD,,
|