engeom 0.2.4__cp38-abi3-win_amd64.whl → 0.2.5__cp38-abi3-win_amd64.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/engeom.pyd
CHANGED
Binary file
|
engeom/geom2.pyi
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
from __future__ import annotations
|
2
|
-
import numpy
|
3
|
-
from typing import Iterable, Tuple, Type, TypeVar
|
4
2
|
|
3
|
+
from typing import Iterable, Tuple, TypeVar, Iterator, Any
|
4
|
+
|
5
|
+
import numpy
|
5
6
|
from engeom.engeom import Resample
|
6
7
|
|
7
8
|
Transformable2 = TypeVar("Transformable2", Vector2, Point2, Iso2, SurfacePoint2)
|
@@ -9,6 +10,9 @@ PointOrVec2 = TypeVar("PointOrVec2", Point2, Vector2)
|
|
9
10
|
|
10
11
|
|
11
12
|
class Vector2(Iterable[float]):
|
13
|
+
def __iter__(self) -> Iterator[float]:
|
14
|
+
pass
|
15
|
+
|
12
16
|
def __init__(self, x: float, y: float):
|
13
17
|
"""
|
14
18
|
|
@@ -40,6 +44,9 @@ class Vector2(Iterable[float]):
|
|
40
44
|
def __mul__(self, x: float) -> Vector2:
|
41
45
|
...
|
42
46
|
|
47
|
+
def __truediv__(self, x: float) -> Vector2:
|
48
|
+
...
|
49
|
+
|
43
50
|
def as_numpy(self) -> numpy.ndarray[float]:
|
44
51
|
"""
|
45
52
|
Create a numpy array of shape (2,) from the vector.
|
@@ -78,6 +85,9 @@ class Vector2(Iterable[float]):
|
|
78
85
|
|
79
86
|
|
80
87
|
class Point2(Iterable[float]):
|
88
|
+
def __iter__(self) -> Iterator[float]:
|
89
|
+
pass
|
90
|
+
|
81
91
|
def __init__(self, x: float, y: float):
|
82
92
|
"""
|
83
93
|
|
@@ -108,6 +118,18 @@ class Point2(Iterable[float]):
|
|
108
118
|
def __add__(self, other: Vector2) -> Vector2:
|
109
119
|
...
|
110
120
|
|
121
|
+
def __mul__(self, other) -> Point2:
|
122
|
+
...
|
123
|
+
|
124
|
+
def __truediv__(self, other) -> Point2:
|
125
|
+
...
|
126
|
+
|
127
|
+
def __rmul__(self, other) -> Point2:
|
128
|
+
...
|
129
|
+
|
130
|
+
def __neg__(self) -> Point2:
|
131
|
+
...
|
132
|
+
|
111
133
|
def as_numpy(self) -> numpy.ndarray[float]:
|
112
134
|
"""
|
113
135
|
Create a numpy array of shape (2,) from the point.
|
@@ -200,6 +222,49 @@ class SurfacePoint2:
|
|
200
222
|
"""
|
201
223
|
...
|
202
224
|
|
225
|
+
def rot_normal(self, angle: float) -> SurfacePoint2:
|
226
|
+
"""
|
227
|
+
Rotate the normal vector of the surface point by a given angle in radians and return a new surface point. The
|
228
|
+
position of the surface point is not affected. The angle is positive for counter-clockwise rotation and negative
|
229
|
+
for clockwise rotation.
|
230
|
+
|
231
|
+
:param angle: the angle to rotate the normal vector by.
|
232
|
+
:return:
|
233
|
+
"""
|
234
|
+
|
235
|
+
def __mul__(self, other: float) -> SurfacePoint2:
|
236
|
+
"""
|
237
|
+
Multiply the position of the surface point by a scalar value. The normal vector is not affected unless the
|
238
|
+
scalar is negative, in which case the normal vector is inverted.
|
239
|
+
:param other:
|
240
|
+
:return:
|
241
|
+
"""
|
242
|
+
...
|
243
|
+
|
244
|
+
def __rmul__(self, other: float) -> SurfacePoint2:
|
245
|
+
"""
|
246
|
+
Multiply the position of the surface point by a scalar value. The normal vector is not affected unless the
|
247
|
+
scalar is negative, in which case the normal vector is inverted.
|
248
|
+
:param other:
|
249
|
+
:return:
|
250
|
+
"""
|
251
|
+
...
|
252
|
+
|
253
|
+
def __truediv__(self, other: float) -> SurfacePoint2:
|
254
|
+
"""
|
255
|
+
Divide the position of the surface point by a scalar value. The normal vector is not affected unless the
|
256
|
+
scalar is negative, in which case the normal vector is inverted.
|
257
|
+
:param other:
|
258
|
+
:return:
|
259
|
+
"""
|
260
|
+
...
|
261
|
+
|
262
|
+
def __neg__(self) -> SurfacePoint2:
|
263
|
+
"""
|
264
|
+
Invert both the position AND the normal vector of the surface point.
|
265
|
+
"""
|
266
|
+
...
|
267
|
+
|
203
268
|
|
204
269
|
class Iso2:
|
205
270
|
def __init__(self, tx: float, ty: float, r: float):
|
@@ -233,7 +298,7 @@ class Iso2:
|
|
233
298
|
"""
|
234
299
|
...
|
235
300
|
|
236
|
-
def transform_points(self, points: numpy.ndarray[
|
301
|
+
def transform_points(self, points: numpy.ndarray[Any, numpy.dtype]) -> numpy.ndarray[float]:
|
237
302
|
"""
|
238
303
|
Transform an array of points using the isometry.
|
239
304
|
:param points: a numpy array of shape (N, 2)
|
@@ -241,7 +306,7 @@ class Iso2:
|
|
241
306
|
"""
|
242
307
|
...
|
243
308
|
|
244
|
-
def transform_vectors(self, vectors: numpy.ndarray[
|
309
|
+
def transform_vectors(self, vectors: numpy.ndarray[Any, numpy.dtype]) -> numpy.ndarray[float]:
|
245
310
|
"""
|
246
311
|
Transform an array of vectors using the isometry. The translation part of the isometry is ignored.
|
247
312
|
:param vectors:
|
@@ -254,13 +319,75 @@ class SvdBasis2:
|
|
254
319
|
|
255
320
|
def __init__(
|
256
321
|
self,
|
257
|
-
points: numpy.ndarray
|
258
|
-
weights: numpy.ndarray
|
322
|
+
points: numpy.ndarray,
|
323
|
+
weights: numpy.ndarray | None = None
|
259
324
|
):
|
260
325
|
"""
|
326
|
+
Create a basis from a set of points. The basis will be calculated using a singular value decomposition of the
|
327
|
+
points.
|
328
|
+
|
329
|
+
:param points: a numpy array of shape (n, 2) containing the points to calculate the basis from.
|
330
|
+
:param weights: a numpy array of shape (n,) containing the weights of the points. If None, all points will be
|
331
|
+
weighted equally.
|
332
|
+
"""
|
333
|
+
...
|
334
|
+
|
335
|
+
def rank(self, tol: float) -> int:
|
336
|
+
"""
|
337
|
+
Retrieve the rank of the decomposition by counting the number of singular values that are
|
338
|
+
greater than the provided tolerance. A rank of 0 indicates that all singular values are
|
339
|
+
less than the tolerance, and thus the point set is essentially a single point. A rank of 1
|
340
|
+
indicates that the point set is essentially a line. A rank of 2 indicates that the point
|
341
|
+
set exists roughly in a plane.
|
342
|
+
|
343
|
+
The singular values do not directly have a clear physical meaning. They are square roots of
|
344
|
+
the variance multiplied by the number of points used to compute the basis. Thus, they can
|
345
|
+
be interpreted in relation to each other, and when they are very small.
|
261
346
|
|
262
|
-
|
263
|
-
|
347
|
+
This method should be used either when you know roughly what a cutoff tolerance for the
|
348
|
+
problem you're working on should be, or when you know the cutoff value should be very
|
349
|
+
small. Otherwise, consider examining the standard deviations of the basis vectors
|
350
|
+
instead, as they will be easier to interpret (`basis_stdevs()`).
|
351
|
+
:param tol: the tolerance to use when determining the rank.
|
352
|
+
:return: the rank of the decomposition.
|
353
|
+
"""
|
354
|
+
...
|
355
|
+
|
356
|
+
def largest(self) -> Vector2:
|
357
|
+
"""
|
358
|
+
Get the largest singular vector of the basis.
|
359
|
+
:return: the largest singular vector.
|
360
|
+
"""
|
361
|
+
...
|
362
|
+
|
363
|
+
def smallest(self) -> Vector2:
|
364
|
+
"""
|
365
|
+
Get the smallest singular vector of the basis.
|
366
|
+
:return: the smallest singular vector.
|
367
|
+
"""
|
368
|
+
...
|
369
|
+
|
370
|
+
def basis_variances(self) -> numpy.ndarray[float]:
|
371
|
+
"""
|
372
|
+
Get the variance of the points along the singular vectors.
|
373
|
+
:return: a numpy array of the variance of the points along the singular vectors.
|
374
|
+
"""
|
375
|
+
...
|
376
|
+
|
377
|
+
def basis_stdevs(self) -> numpy.ndarray[float]:
|
378
|
+
"""
|
379
|
+
Get the standard deviation of the points along the singular vectors.
|
380
|
+
:return: a numpy array of the standard deviation of the points along the singular vectors.
|
381
|
+
"""
|
382
|
+
...
|
383
|
+
|
384
|
+
def to_iso2(self) -> Iso2:
|
385
|
+
"""
|
386
|
+
Produce an isometry which will transform from the world space to the basis space.
|
387
|
+
|
388
|
+
For example, if the basis is created from a set of points that lie roughly on an arbitrary line, multiplying
|
389
|
+
original points by this isometry will move the points such that all points are aligned with the x-axis.
|
390
|
+
:return: the isometry that transforms from the world space to the basis space.
|
264
391
|
"""
|
265
392
|
...
|
266
393
|
|
@@ -533,7 +660,6 @@ class Circle2:
|
|
533
660
|
"""
|
534
661
|
...
|
535
662
|
|
536
|
-
|
537
663
|
@property
|
538
664
|
def center(self) -> Point2:
|
539
665
|
"""
|
@@ -658,14 +784,16 @@ class Arc2:
|
|
658
784
|
"""
|
659
785
|
...
|
660
786
|
|
787
|
+
|
661
788
|
class Aabb2:
|
662
|
-
def __init__(self, x_min: float,
|
789
|
+
def __init__(self, x_min: float, y_min: float, x_max: float, y_max: float):
|
663
790
|
"""
|
791
|
+
Create an axis-aligned bounding box from the given bounds.
|
664
792
|
|
665
|
-
:param x_min:
|
666
|
-
:param
|
667
|
-
:param
|
668
|
-
:param y_max:
|
793
|
+
:param x_min: the minimum x-coordinate of the AABB
|
794
|
+
:param y_min: the minimum y-coordinate of the AABB
|
795
|
+
:param x_max: the maximum x-coordinate of the AABB
|
796
|
+
:param y_max: the maximum y-coordinate of the AABB
|
669
797
|
"""
|
670
798
|
...
|
671
799
|
|
@@ -681,6 +809,16 @@ class Aabb2:
|
|
681
809
|
"""
|
682
810
|
...
|
683
811
|
|
812
|
+
@staticmethod
|
813
|
+
def from_points(points: numpy.ndarray) -> Aabb2:
|
814
|
+
"""
|
815
|
+
Create an AABB that bounds a set of points. If the point array is empty or the wrong shape, an error will be
|
816
|
+
thrown.
|
817
|
+
:param points: a numpy array of shape (N, 2) containing the points to bound
|
818
|
+
:return: a new AABB object
|
819
|
+
"""
|
820
|
+
...
|
821
|
+
|
684
822
|
@property
|
685
823
|
def min(self) -> Point2:
|
686
824
|
"""
|
@@ -731,4 +869,4 @@ class Aabb2:
|
|
731
869
|
:param d: the distance to shrink the AABB by.
|
732
870
|
:return: a new AABB object with the shrunk bounds.
|
733
871
|
"""
|
734
|
-
...
|
872
|
+
...
|
engeom/geom3.pyi
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
3
|
from pathlib import Path
|
4
|
-
from typing import Tuple, Iterable, List, TypeVar
|
4
|
+
from typing import Tuple, Iterable, List, TypeVar, Iterator, Any
|
5
5
|
|
6
6
|
import numpy
|
7
|
+
from numpy.typing import NDArray
|
7
8
|
from engeom import DeviationMode, Resample, SelectOp
|
8
9
|
from .metrology import Length3
|
9
10
|
|
@@ -11,13 +12,13 @@ Transformable3 = TypeVar("Transformable3", Vector3, Point3, Plane3, Iso3, Surfac
|
|
11
12
|
PointOrVector3 = TypeVar("PointOrVector3", Vector3, Point3)
|
12
13
|
|
13
14
|
|
14
|
-
class Vector3:
|
15
|
+
class Vector3(Iterable[float]):
|
15
16
|
def __init__(self, x: float, y: float, z: float):
|
16
17
|
"""
|
17
|
-
|
18
|
-
:param x:
|
19
|
-
:param y:
|
20
|
-
:param z:
|
18
|
+
Create a vector in 3D space by specifying the x, y, and z components.
|
19
|
+
:param x: the x component of the vector
|
20
|
+
:param y: the y component of the vector
|
21
|
+
:param z: the z component of the vector
|
21
22
|
"""
|
22
23
|
...
|
23
24
|
|
@@ -33,7 +34,7 @@ class Vector3:
|
|
33
34
|
def z(self) -> float:
|
34
35
|
...
|
35
36
|
|
36
|
-
def __iter__(self) ->
|
37
|
+
def __iter__(self) -> Iterator[float]:
|
37
38
|
...
|
38
39
|
|
39
40
|
def __rmul__(self, other: float) -> Vector3:
|
@@ -51,7 +52,10 @@ class Vector3:
|
|
51
52
|
def __mul__(self, x: float) -> Vector3:
|
52
53
|
...
|
53
54
|
|
54
|
-
def
|
55
|
+
def __truediv__(self, x: float) -> Vector3:
|
56
|
+
...
|
57
|
+
|
58
|
+
def as_numpy(self) -> NDArray[float]:
|
55
59
|
"""
|
56
60
|
Create a numpy array of shape (3,) from the vector.
|
57
61
|
"""
|
@@ -94,13 +98,14 @@ class Vector3:
|
|
94
98
|
...
|
95
99
|
|
96
100
|
|
97
|
-
class Point3:
|
101
|
+
class Point3(Iterable[float]):
|
98
102
|
def __init__(self, x: float, y: float, z: float):
|
99
103
|
"""
|
104
|
+
Create a point in 3D space by specifying the x, y, and z coordinates.
|
100
105
|
|
101
|
-
:param x:
|
102
|
-
:param y:
|
103
|
-
:param z:
|
106
|
+
:param x: the x coordinate of the point
|
107
|
+
:param y: the y coordinate of the point
|
108
|
+
:param z: the z coordinate of the point
|
104
109
|
"""
|
105
110
|
...
|
106
111
|
|
@@ -116,7 +121,7 @@ class Point3:
|
|
116
121
|
def z(self) -> float:
|
117
122
|
...
|
118
123
|
|
119
|
-
def __iter__(self) ->
|
124
|
+
def __iter__(self) -> Iterator[float]:
|
120
125
|
...
|
121
126
|
|
122
127
|
@property
|
@@ -133,7 +138,19 @@ class Point3:
|
|
133
138
|
def __add__(self, other: Vector3) -> Vector3:
|
134
139
|
...
|
135
140
|
|
136
|
-
def
|
141
|
+
def __neg__(self) -> Point3:
|
142
|
+
...
|
143
|
+
|
144
|
+
def __mul__(self, x: float) -> Point3:
|
145
|
+
...
|
146
|
+
|
147
|
+
def __rmul__(self, x: float) -> Point3:
|
148
|
+
...
|
149
|
+
|
150
|
+
def __truediv__(self, x: float) -> Point3:
|
151
|
+
...
|
152
|
+
|
153
|
+
def as_numpy(self) -> NDArray[float]:
|
137
154
|
"""
|
138
155
|
Create a numpy array of shape (2,) from the point.
|
139
156
|
"""
|
@@ -143,13 +160,16 @@ class Point3:
|
|
143
160
|
class SurfacePoint3:
|
144
161
|
def __init__(self, x: float, y: float, z: float, nx: float, ny: float, nz: float):
|
145
162
|
"""
|
163
|
+
Create a surface point in 3D space by specifying the x, y, and z coordinates of the point, as well as the x, y,
|
164
|
+
and z components of the normal vector. The normal components will be normalized before being stored, so they
|
165
|
+
do not need to be scaled to unit length before being passed to this constructor.
|
146
166
|
|
147
|
-
:param x:
|
148
|
-
:param y:
|
149
|
-
:param z:
|
150
|
-
:param nx:
|
151
|
-
:param ny:
|
152
|
-
:param nz:
|
167
|
+
:param x: the x coordinate of the point
|
168
|
+
:param y: the y coordinate of the point
|
169
|
+
:param z: the z coordinate of the point
|
170
|
+
:param nx: the x component of the normal vector (will be normalized after construction)
|
171
|
+
:param ny: the y component of the normal vector (will be normalized after construction)
|
172
|
+
:param nz: the z component of the normal vector (will be normalized after construction)
|
153
173
|
"""
|
154
174
|
...
|
155
175
|
|
@@ -223,11 +243,44 @@ class SurfacePoint3:
|
|
223
243
|
"""
|
224
244
|
...
|
225
245
|
|
246
|
+
def __mul__(self, other: float) -> SurfacePoint3:
|
247
|
+
"""
|
248
|
+
Multiply the position of the surface point by a scalar value. The normal vector is not affected unless the
|
249
|
+
scalar is negative, in which case the normal vector is inverted.
|
250
|
+
:param other:
|
251
|
+
:return:
|
252
|
+
"""
|
253
|
+
...
|
254
|
+
|
255
|
+
def __rmul__(self, other: float) -> SurfacePoint3:
|
256
|
+
"""
|
257
|
+
Multiply the position of the surface point by a scalar value. The normal vector is not affected unless the
|
258
|
+
scalar is negative, in which case the normal vector is inverted.
|
259
|
+
:param other:
|
260
|
+
:return:
|
261
|
+
"""
|
262
|
+
...
|
263
|
+
|
264
|
+
def __truediv__(self, other: float) -> SurfacePoint3:
|
265
|
+
"""
|
266
|
+
Divide the position of the surface point by a scalar value. The normal vector is not affected unless the
|
267
|
+
scalar is negative, in which case the normal vector is inverted.
|
268
|
+
:param other:
|
269
|
+
:return:
|
270
|
+
"""
|
271
|
+
...
|
272
|
+
|
273
|
+
def __neg__(self) -> SurfacePoint3:
|
274
|
+
"""
|
275
|
+
Invert both the position AND the normal vector of the surface point.
|
276
|
+
"""
|
277
|
+
...
|
278
|
+
|
226
279
|
|
227
280
|
class Iso3:
|
228
281
|
""" An isometry (rigid body transformation) in 3D space. """
|
229
282
|
|
230
|
-
def __init__(self, matrix:
|
283
|
+
def __init__(self, matrix: NDArray[float]):
|
231
284
|
""" Create an isometry from a 4x4 matrix. """
|
232
285
|
...
|
233
286
|
|
@@ -266,7 +319,7 @@ class Iso3:
|
|
266
319
|
""" Return the inverse of the isometry. """
|
267
320
|
...
|
268
321
|
|
269
|
-
def transform_points(self, points:
|
322
|
+
def transform_points(self, points: NDArray[float]) -> NDArray[float]:
|
270
323
|
""" Transform a set of points by the isometry. This will transform the points by the rotation and translation
|
271
324
|
of the isometry.
|
272
325
|
|
@@ -275,7 +328,7 @@ class Iso3:
|
|
275
328
|
"""
|
276
329
|
...
|
277
330
|
|
278
|
-
def transform_vectors(self, vector:
|
331
|
+
def transform_vectors(self, vector: NDArray[float]) -> NDArray[float]:
|
279
332
|
""" Transform a set of vectors by the isometry. This will only transform the direction of the vectors, not
|
280
333
|
their magnitude.
|
281
334
|
|
@@ -284,7 +337,7 @@ class Iso3:
|
|
284
337
|
"""
|
285
338
|
...
|
286
339
|
|
287
|
-
def as_numpy(self) ->
|
340
|
+
def as_numpy(self) -> NDArray[float]:
|
288
341
|
""" Return a copy of the 4x4 matrix representation of the isometry. This is a copy operation. """
|
289
342
|
...
|
290
343
|
|
@@ -310,11 +363,7 @@ class SvdBasis3:
|
|
310
363
|
fitting basis for the points using a singular value decomposition.
|
311
364
|
"""
|
312
365
|
|
313
|
-
def __init__(
|
314
|
-
self,
|
315
|
-
points: numpy.ndarray[float],
|
316
|
-
weights: numpy.ndarray[float] | None = None
|
317
|
-
):
|
366
|
+
def __init__(self, points: NDArray[float], weights: NDArray[float] | None = None):
|
318
367
|
"""
|
319
368
|
Create a basis from a set of points. The basis will be calculated using a singular value decomposition of the
|
320
369
|
points.
|
@@ -335,28 +384,28 @@ class SvdBasis3:
|
|
335
384
|
"""
|
336
385
|
...
|
337
386
|
|
338
|
-
def largest(self) ->
|
387
|
+
def largest(self) -> Vector3:
|
339
388
|
"""
|
340
389
|
Return the largest normalized basis vector.
|
341
|
-
:return: a
|
390
|
+
:return: a Vector3 object containing the largest basis vector.
|
342
391
|
"""
|
343
392
|
...
|
344
393
|
|
345
|
-
def smallest(self) ->
|
394
|
+
def smallest(self) -> Vector3:
|
346
395
|
"""
|
347
396
|
Return the smallest normalized basis vector.
|
348
|
-
:return: a
|
397
|
+
:return: a Vector3 object containing the smallest basis vector.
|
349
398
|
"""
|
350
399
|
...
|
351
400
|
|
352
|
-
def basis_variances(self) ->
|
401
|
+
def basis_variances(self) -> NDArray[float]:
|
353
402
|
"""
|
354
403
|
Return the variances of the basis vectors.
|
355
404
|
:return: a numpy array of shape (3,) containing the variances of the basis vectors.
|
356
405
|
"""
|
357
406
|
...
|
358
407
|
|
359
|
-
def basis_stdevs(self) ->
|
408
|
+
def basis_stdevs(self) -> NDArray[float]:
|
360
409
|
"""
|
361
410
|
Return the standard deviations of the basis vectors.
|
362
411
|
:return: a numpy array of shape (3,) containing the standard deviations of the basis vectors.
|
@@ -434,8 +483,8 @@ class Mesh:
|
|
434
483
|
|
435
484
|
def __init__(
|
436
485
|
self,
|
437
|
-
vertices:
|
438
|
-
faces:
|
486
|
+
vertices: NDArray[float],
|
487
|
+
faces: NDArray[numpy.uint32],
|
439
488
|
merge_duplicates: bool = False,
|
440
489
|
delete_degenerate: bool = False
|
441
490
|
):
|
@@ -507,7 +556,7 @@ class Mesh:
|
|
507
556
|
...
|
508
557
|
|
509
558
|
@property
|
510
|
-
def vertices(self) ->
|
559
|
+
def vertices(self) -> NDArray[float]:
|
511
560
|
"""
|
512
561
|
Will return an immutable view of the vertices of the mesh as a numpy array of shape (n, 3).
|
513
562
|
:return: a numpy array of shape (n, 3) containing the vertices of the mesh.
|
@@ -515,7 +564,7 @@ class Mesh:
|
|
515
564
|
...
|
516
565
|
|
517
566
|
@property
|
518
|
-
def faces(self) ->
|
567
|
+
def faces(self) -> NDArray[numpy.uint32]:
|
519
568
|
"""
|
520
569
|
Will return an immutable view of the triangles of the mesh as a numpy array of shape (m, 3).
|
521
570
|
:return: a numpy array of shape (m, 3) containing the triangles of the mesh.
|
@@ -534,7 +583,7 @@ class Mesh:
|
|
534
583
|
"""
|
535
584
|
...
|
536
585
|
|
537
|
-
def deviation(self, points:
|
586
|
+
def deviation(self, points: NDArray[float], mode: DeviationMode) -> NDArray[float]:
|
538
587
|
"""
|
539
588
|
Calculate the deviation between a set of points and their respective closest points on the mesh surface. The
|
540
589
|
deviation can be calculated in two modes: absolute and normal. In the absolute mode, the deviation is the
|
@@ -548,7 +597,7 @@ class Mesh:
|
|
548
597
|
"""
|
549
598
|
...
|
550
599
|
|
551
|
-
def sample_poisson(self, radius: float) ->
|
600
|
+
def sample_poisson(self, radius: float) -> NDArray[float]:
|
552
601
|
"""
|
553
602
|
Sample the surface of the mesh using a Poisson disk sampling algorithm. This will return a numpy array of points
|
554
603
|
and their normals that are approximately evenly distributed across the surface of the mesh. The radius parameter
|
@@ -632,7 +681,7 @@ class Mesh:
|
|
632
681
|
:return:
|
633
682
|
"""
|
634
683
|
|
635
|
-
def boundary_first_flatten(self) ->
|
684
|
+
def boundary_first_flatten(self) -> NDArray[float]:
|
636
685
|
"""
|
637
686
|
|
638
687
|
:return:
|
@@ -751,7 +800,7 @@ class Curve3:
|
|
751
800
|
between them.
|
752
801
|
"""
|
753
802
|
|
754
|
-
def __init__(self, vertices:
|
803
|
+
def __init__(self, vertices: NDArray[float], tol: float = 1.0e-6):
|
755
804
|
"""
|
756
805
|
Create a curve from a set of vertices. The vertices should be a numpy array of shape (n, 3).
|
757
806
|
|
@@ -778,7 +827,7 @@ class Curve3:
|
|
778
827
|
...
|
779
828
|
|
780
829
|
@property
|
781
|
-
def points(self) ->
|
830
|
+
def points(self) -> NDArray[float]:
|
782
831
|
"""
|
783
832
|
Will return an immutable view of the vertices of the mesh as a numpy array of shape (n, 3).
|
784
833
|
:return: a numpy array of shape (n, 3) containing the vertices of the mesh.
|
@@ -900,3 +949,47 @@ class Aabb3:
|
|
900
949
|
def extent(self) -> Vector3:
|
901
950
|
""" The extent of the box. """
|
902
951
|
...
|
952
|
+
|
953
|
+
@staticmethod
|
954
|
+
def at_point(x: float, y: float, z: float, w: float, h: float | None = None, l: float | None = None) -> Aabb3:
|
955
|
+
"""
|
956
|
+
Create an AABB centered at a point with a given width and height.
|
957
|
+
:param x: the x-coordinate of the center of the AABB.
|
958
|
+
:param y: the y-coordinate of the center of the AABB.
|
959
|
+
:param z: the z-coordinate of the center of the AABB.
|
960
|
+
:param w: the width of the AABB.
|
961
|
+
:param h: the height of the AABB. If not provided, the AABB will be square.
|
962
|
+
:param l: the length of the AABB. If not provided, the AABB will be square.
|
963
|
+
:return: a new AABB object.
|
964
|
+
"""
|
965
|
+
...
|
966
|
+
|
967
|
+
@staticmethod
|
968
|
+
def from_points(points: NDArray[float]) -> Aabb3:
|
969
|
+
"""
|
970
|
+
Create an AABB that bounds a set of points. If the point array is empty or the wrong shape, an error will be
|
971
|
+
thrown.
|
972
|
+
:param points: a numpy array of shape (N, 2) containing the points to bound
|
973
|
+
:return: a new AABB object
|
974
|
+
"""
|
975
|
+
...
|
976
|
+
|
977
|
+
def expand(self, d: float) -> Aabb3:
|
978
|
+
"""
|
979
|
+
Expand the AABB by a given distance in all directions. The resulting height and
|
980
|
+
width will be increased by 2 * d.
|
981
|
+
|
982
|
+
:param d: the distance to expand the AABB by.
|
983
|
+
:return: a new AABB object with the expanded bounds.
|
984
|
+
"""
|
985
|
+
...
|
986
|
+
|
987
|
+
def shrink(self, d: float) -> Aabb3:
|
988
|
+
"""
|
989
|
+
Shrink the AABB by a given distance in all directions. The resulting height and
|
990
|
+
width will be decreased by 2 * d.
|
991
|
+
|
992
|
+
:param d: the distance to shrink the AABB by.
|
993
|
+
:return: a new AABB object with the shrunk bounds.
|
994
|
+
"""
|
995
|
+
...
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: engeom
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.5
|
4
4
|
Classifier: Programming Language :: Rust
|
5
5
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
6
6
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
@@ -8,3 +8,9 @@ Requires-Dist: numpy
|
|
8
8
|
Requires-Dist: pytest ; extra == 'tests'
|
9
9
|
Provides-Extra: tests
|
10
10
|
Requires-Python: >=3.8
|
11
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
12
|
+
|
13
|
+
# Engeom Python Bindings
|
14
|
+
|
15
|
+
Full documentation at https://mattj23.github.io/py-engeom/
|
16
|
+
|
@@ -1,18 +1,18 @@
|
|
1
|
-
engeom-0.2.
|
2
|
-
engeom-0.2.
|
1
|
+
engeom-0.2.5.dist-info/METADATA,sha256=N4o4hLHur_HzFZEffX0FYKefzKmcNhCPfOUkUDnDq9U,497
|
2
|
+
engeom-0.2.5.dist-info/WHEEL,sha256=_g1M2QM3kt1Ssm_sHOg_3TUY7GxNE2Ueyslb9ZDtPwk,94
|
3
3
|
engeom/airfoil/__init__.py,sha256=G6m7JEvHVk3sM2JooJPOg8JNA3VuEp0EIqczSEbC_PY,180
|
4
4
|
engeom/airfoil.pyi,sha256=0TVpXkolFUXbBqJp93FenA_XqvU7FD1DnbncAF0ubow,14654
|
5
5
|
engeom/align/__init__.py,sha256=SEeMqeqLKqJC73Mg8GwPwd9NwWnl-dcCqJ4rPdh8yyc,196
|
6
6
|
engeom/align.pyi,sha256=QCSKrTLkCoaIubcrPU9J-wDZe1lRP0GbPgWZmonXjo0,997
|
7
7
|
engeom/engeom.pyi,sha256=Jia11rU8ZnMKdlXgfGeBPlSmsYPEfALM-_ufNwR0ibQ,254
|
8
8
|
engeom/geom2/__init__.py,sha256=mRu8Zh6DE-EQyhxScoxszPqDjGVzGWVJEQO6RIAtS4A,174
|
9
|
-
engeom/geom2.pyi,sha256=
|
9
|
+
engeom/geom2.pyi,sha256=GJk8tRDyBD9HYgLY6YmF3iDrXDJfAdkbvWYiOpLgyGs,28330
|
10
10
|
engeom/geom3/__init__.py,sha256=DG5jt2xgS9WRNb58ZkkrcKQQO6bIG-irg-uV_BkHEj4,174
|
11
|
-
engeom/geom3.pyi,sha256=
|
11
|
+
engeom/geom3.pyi,sha256=XiM9SLZ7JAT3Ulk6ZR462pPgfBt2hFx6alJZzP3R_Sk,38179
|
12
12
|
engeom/matplotlib.py,sha256=A0gdQshzE3G7joNHna4viYnioQtA8LVXfSuZ_X6AHeo,9001
|
13
13
|
engeom/metrology/__init__.py,sha256=cpsB0-hJGitzW79Coxwf7r_mpNaeI6yG3myDEVdBJgk,186
|
14
14
|
engeom/metrology.pyi,sha256=P_2pkoLUAOB0-RKppj0FN01XGY0jx1lGw9H1eKXrW8s,1144
|
15
15
|
engeom/pyvista.py,sha256=WVjaMG1hhd6hkknfxgkgCH8rZRXaM2AweG39T0UQkGc,6044
|
16
16
|
engeom/__init__.py,sha256=kYgFq3jq1quDfV013wEYQMlUBz4QNSpP6u8lFiuTHvc,115
|
17
|
-
engeom/engeom.pyd,sha256=
|
18
|
-
engeom-0.2.
|
17
|
+
engeom/engeom.pyd,sha256=fCxcjqmiFrg-UITOBXomKiv56yEjmq4JvMUPv1HjQAo,2363904
|
18
|
+
engeom-0.2.5.dist-info/RECORD,,
|
File without changes
|