engeom 0.2.11__cp38-abi3-macosx_11_0_arm64.whl → 0.2.13__cp38-abi3-macosx_11_0_arm64.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/matplotlib.py +9 -0
- engeom/airfoil.pyi +17 -0
- engeom/engeom.abi3.so +0 -0
- engeom/geom2.pyi +142 -0
- engeom/geom3.pyi +85 -1
- {engeom-0.2.11.dist-info → engeom-0.2.13.dist-info}/METADATA +1 -1
- {engeom-0.2.11.dist-info → engeom-0.2.13.dist-info}/RECORD +19 -19
- {engeom-0.2.11.dist-info → engeom-0.2.13.dist-info}/WHEEL +1 -1
engeom/_plot/matplotlib.py
CHANGED
@@ -147,6 +147,15 @@ else:
|
|
147
147
|
"""
|
148
148
|
self.ax.plot(curve.points[:, 0], curve.points[:, 1], **kwargs)
|
149
149
|
|
150
|
+
def fill_curve(self, curve: Curve2, **kwargs):
|
151
|
+
"""
|
152
|
+
Fill a curve on a Matplotlib Axes object.
|
153
|
+
:param curve: a Curve2 object (can be closed but doesn't need to be, will be closed automatically)
|
154
|
+
:param kwargs: keyword arguments to pass to the inner Axes.fill function
|
155
|
+
:return:
|
156
|
+
"""
|
157
|
+
self.ax.fill(curve.points[:, 0], curve.points[:, 1], **kwargs)
|
158
|
+
|
150
159
|
def distance(
|
151
160
|
self,
|
152
161
|
distance: Distance2,
|
engeom/airfoil.pyi
CHANGED
@@ -315,6 +315,23 @@ class AirfoilGeometry:
|
|
315
315
|
from .geom2 import Curve2, Circle2
|
316
316
|
from .metrology import Distance2
|
317
317
|
|
318
|
+
@staticmethod
|
319
|
+
def from_bytes(data: bytes) -> AirfoilGeometry:
|
320
|
+
"""
|
321
|
+
Create an instance of `AirfoilGeometry` from a byte string containing the airfoil geometry data serialized in
|
322
|
+
a msgpack format.
|
323
|
+
:param data: The byte string containing the serialized data
|
324
|
+
:return: An instance of `AirfoilGeometry`
|
325
|
+
"""
|
326
|
+
...
|
327
|
+
|
328
|
+
def to_bytes(self) -> bytes:
|
329
|
+
"""
|
330
|
+
Serialize the `AirfoilGeometry` instance to a byte string msgpack representation.
|
331
|
+
:return: A byte string containing the serialized data
|
332
|
+
"""
|
333
|
+
...
|
334
|
+
|
318
335
|
@staticmethod
|
319
336
|
def from_analyze(
|
320
337
|
section: Curve2,
|
engeom/engeom.abi3.so
CHANGED
Binary file
|
engeom/geom2.pyi
CHANGED
@@ -138,6 +138,22 @@ class Vector2(Iterable[float]):
|
|
138
138
|
"""
|
139
139
|
...
|
140
140
|
|
141
|
+
def with_x(self, x: float) -> Vector2:
|
142
|
+
"""
|
143
|
+
Return a new vector with the same y component as this vector, but with the x component set to the given value.
|
144
|
+
:param x: the new x component of the vector.
|
145
|
+
:return: a new vector with the same y component as this vector, but with the x component set to the given value.
|
146
|
+
"""
|
147
|
+
...
|
148
|
+
|
149
|
+
def with_y(self, y: float) -> Vector2:
|
150
|
+
"""
|
151
|
+
Return a new vector with the same x component as this vector, but with the y component set to the given value.
|
152
|
+
:param y: the new y component of the vector.
|
153
|
+
:return: a new vector with the same x component as this vector, but with the y component set to the given value.
|
154
|
+
"""
|
155
|
+
...
|
156
|
+
|
141
157
|
|
142
158
|
class Point2(Iterable[float]):
|
143
159
|
"""
|
@@ -243,6 +259,22 @@ class Point2(Iterable[float]):
|
|
243
259
|
"""
|
244
260
|
...
|
245
261
|
|
262
|
+
def with_x(self, x: float) -> Point2:
|
263
|
+
"""
|
264
|
+
Return a new point with the same y component as this point, but with the x component set to the given value.
|
265
|
+
:param x: the new x component of the point.
|
266
|
+
:return: a new point with the same y component as this point, but with the x component set to the given value.
|
267
|
+
"""
|
268
|
+
...
|
269
|
+
|
270
|
+
def with_y(self, y: float) -> Point2:
|
271
|
+
"""
|
272
|
+
Return a new point with the same x component as this point, but with the y component set to the given value.
|
273
|
+
:param y: the new y component of the point.
|
274
|
+
:return: a new point with the same x component as this point, but with the y component set to the given value.
|
275
|
+
"""
|
276
|
+
...
|
277
|
+
|
246
278
|
|
247
279
|
class SurfacePoint2:
|
248
280
|
"""
|
@@ -887,6 +919,55 @@ class Curve2:
|
|
887
919
|
"""
|
888
920
|
...
|
889
921
|
|
922
|
+
def offset_vertices(self, offset: float) -> Curve2:
|
923
|
+
"""
|
924
|
+
Create a new curve which is the result of offsetting the vertices of this curve by the
|
925
|
+
given offset. The direction of each vertex offset will be the same as the direction of the
|
926
|
+
surface normal at the curve station corresponding to that vertex, which is the angle
|
927
|
+
bisecting the normals of the two edges that meet at the vertex. Vertices at the ends of
|
928
|
+
the curve (on an open curve) will have the same normal as the edge they are connected to.
|
929
|
+
|
930
|
+
Compared to `offset_segments`, this method will move the vertices of the curve while
|
931
|
+
allowing the distance between the bodies of the initial and resulting segments to change.
|
932
|
+
Generally speaking, use this method if you primarily care about the vertices and not the
|
933
|
+
segments, or if the curvature between adjacent segments is very low.
|
934
|
+
|
935
|
+
:param offset: the distance to offset the vertices by.
|
936
|
+
:return: a new curve with the vertices offset by the given distance.
|
937
|
+
"""
|
938
|
+
...
|
939
|
+
|
940
|
+
def offset_segments(self, offset: float) -> Curve2:
|
941
|
+
"""
|
942
|
+
Create a new curve which is the result of offsetting the segments of this curve by the
|
943
|
+
given offset. The direction of the offset is perpendicular to the direction of the segment,
|
944
|
+
and a positive offset will move the segment outward from the curve, while a negative offset
|
945
|
+
will move it inward. Outward and inward are defined based on the counter-clockwise winding
|
946
|
+
convention.
|
947
|
+
|
948
|
+
Vertices will be moved to the intersection of their adjacent segments.
|
949
|
+
|
950
|
+
Compared to `offset_vertices`, this method will preserve the distance between the segments
|
951
|
+
bodies of the initial and resulting curves, while allowing vertices on outside corners to
|
952
|
+
get farther from the original as necessary for the segments to be straight lines.
|
953
|
+
|
954
|
+
:param offset: the distance to offset the segments by.
|
955
|
+
:return: a new curve with the segments offset by the given distance.
|
956
|
+
"""
|
957
|
+
...
|
958
|
+
|
959
|
+
def __add__(self, other: Curve2) -> Curve2:
|
960
|
+
"""
|
961
|
+
Concatenate two curves together, returning a new curve that is the result of appending the vertices of the
|
962
|
+
second curve to the first curve. Both curves must be open or this will throw an error. The resulting curve
|
963
|
+
will be open.
|
964
|
+
|
965
|
+
:param other: the curve to append to this curve.
|
966
|
+
:return: a new curve that is the result of concatenating the two curves.
|
967
|
+
"""
|
968
|
+
...
|
969
|
+
|
970
|
+
|
890
971
|
|
891
972
|
class Circle2:
|
892
973
|
"""
|
@@ -950,6 +1031,43 @@ class Circle2:
|
|
950
1031
|
"""
|
951
1032
|
...
|
952
1033
|
|
1034
|
+
@staticmethod
|
1035
|
+
def fitting(points: NDArray[float], guess: Circle2 | None = None, sigma: float | None = None) -> Circle2:
|
1036
|
+
"""
|
1037
|
+
Fit a circle to a set of points using an unconstrained Levenberg-Marquardt minimization of the sum of
|
1038
|
+
squared errors between the points and the boundary of the circle.
|
1039
|
+
|
1040
|
+
The initial guess is used to provide a starting point for the optimization. If no guess is provided, the
|
1041
|
+
unit circle will be used.
|
1042
|
+
|
1043
|
+
The sigma parameter is used to weight the points in the optimization. If no sigma is provided, all points
|
1044
|
+
will be weighted equally, otherwise points beyond `sigma` standard deviations from the mean will be
|
1045
|
+
assigned a weight of 0.0.
|
1046
|
+
:param points: the points to fit the circle to.
|
1047
|
+
:param guess: an optional initial guess for the circle. If None, the unit circle will be used.
|
1048
|
+
:param sigma: an optional standard deviation to use for weighting the points. If None, all points will be
|
1049
|
+
weighted equally.
|
1050
|
+
:return: a new `Circle2` object representing the fitted circle.
|
1051
|
+
"""
|
1052
|
+
...
|
1053
|
+
|
1054
|
+
@staticmethod
|
1055
|
+
def ransac(points: NDArray[float], tol: float, iterations: int | None = None, min_r: float | None = None,
|
1056
|
+
max_r: float | None = None) -> Circle2:
|
1057
|
+
"""
|
1058
|
+
Fit a circle to a set of points using the RANSAC algorithm. The algorithm will randomly sample points from the
|
1059
|
+
input set and fit a circle to them, then check how many points are within the given tolerance of the fitted
|
1060
|
+
circle. The best fitting circle will be returned.
|
1061
|
+
|
1062
|
+
:param points: the points to fit the circle to.
|
1063
|
+
:param tol: the tolerance for the RANSAC algorithm.
|
1064
|
+
:param iterations: the number of iterations to run. If None, a default value of 500 will be used.
|
1065
|
+
:param min_r: the minimum radius of the circle. If None, no minimum will be enforced.
|
1066
|
+
:param max_r: the maximum radius of the circle. If None, no maximum will be enforced.
|
1067
|
+
:return: a new `Circle2` object representing the fitted circle.
|
1068
|
+
"""
|
1069
|
+
...
|
1070
|
+
|
953
1071
|
|
954
1072
|
class Arc2:
|
955
1073
|
"""
|
@@ -1148,3 +1266,27 @@ class Aabb2:
|
|
1148
1266
|
:return: a new AABB object with the shrunk bounds.
|
1149
1267
|
"""
|
1150
1268
|
...
|
1269
|
+
|
1270
|
+
def merged(self, other: Aabb2) -> Aabb2:
|
1271
|
+
"""
|
1272
|
+
Merge this AABB with another AABB and return a new AABB.
|
1273
|
+
:param other: the other AABB to merge with.
|
1274
|
+
:return: a new AABB object that is the result of merging this AABB with the other AABB.
|
1275
|
+
"""
|
1276
|
+
...
|
1277
|
+
|
1278
|
+
def indices_contained(self, points: NDArray[float]) -> NDArray[int]:
|
1279
|
+
"""
|
1280
|
+
Get the indices of the points that are contained within the AABB.
|
1281
|
+
:param points: a numpy array of shape (N, 2) containing the points to check.
|
1282
|
+
:return: a numpy array of indices of the points that are contained within the AABB.
|
1283
|
+
"""
|
1284
|
+
...
|
1285
|
+
|
1286
|
+
def contains_point(self, point: Point2) -> bool:
|
1287
|
+
"""
|
1288
|
+
Check if a point is contained within the AABB.
|
1289
|
+
:param point: the point to check.
|
1290
|
+
:return: True if the point is contained within the AABB, False otherwise.
|
1291
|
+
"""
|
1292
|
+
...
|
engeom/geom3.pyi
CHANGED
@@ -150,6 +150,33 @@ class Vector3(Iterable[float]):
|
|
150
150
|
"""
|
151
151
|
...
|
152
152
|
|
153
|
+
def with_x(self, x: float) -> Vector3:
|
154
|
+
"""
|
155
|
+
Return a new vector with the same y and z components as this vector, but with the x component set to the
|
156
|
+
specified value.
|
157
|
+
:param x: the new x component of the vector.
|
158
|
+
:return: a new vector with the specified x component.
|
159
|
+
"""
|
160
|
+
...
|
161
|
+
|
162
|
+
def with_y(self, y: float) -> Vector3:
|
163
|
+
"""
|
164
|
+
Return a new vector with the same x and z components as this vector, but with the y component set to the
|
165
|
+
specified value.
|
166
|
+
:param y: the new y component of the vector.
|
167
|
+
:return: a new vector with the specified y component.
|
168
|
+
"""
|
169
|
+
...
|
170
|
+
|
171
|
+
def with_z(self, z: float) -> Vector3:
|
172
|
+
"""
|
173
|
+
Return a new vector with the same x and y components as this vector, but with the z component set to the
|
174
|
+
specified value.
|
175
|
+
:param z: the new z component of the vector.
|
176
|
+
:return: a new vector with the specified z component.
|
177
|
+
"""
|
178
|
+
...
|
179
|
+
|
153
180
|
|
154
181
|
class Point3(Iterable[float]):
|
155
182
|
"""
|
@@ -267,6 +294,33 @@ class Point3(Iterable[float]):
|
|
267
294
|
"""
|
268
295
|
...
|
269
296
|
|
297
|
+
def with_x(self, x: float) -> Point3:
|
298
|
+
"""
|
299
|
+
Return a new point with the same y and z coordinates as this point, but with the x coordinate set to the
|
300
|
+
specified value.
|
301
|
+
:param x: the new x coordinate of the point.
|
302
|
+
:return: a new point with the specified x coordinate.
|
303
|
+
"""
|
304
|
+
...
|
305
|
+
|
306
|
+
def with_y(self, y: float) -> Point3:
|
307
|
+
"""
|
308
|
+
Return a new point with the same x and z coordinates as this point, but with the y coordinate set to the
|
309
|
+
specified value.
|
310
|
+
:param y: the new y coordinate of the point.
|
311
|
+
:return: a new point with the specified y coordinate.
|
312
|
+
"""
|
313
|
+
...
|
314
|
+
|
315
|
+
def with_z(self, z: float) -> Point3:
|
316
|
+
"""
|
317
|
+
Return a new point with the same x and y coordinates as this point, but with the z coordinate set to the
|
318
|
+
specified value.
|
319
|
+
:param z: the new z coordinate of the point.
|
320
|
+
:return: a new point with the specified z coordinate.
|
321
|
+
"""
|
322
|
+
...
|
323
|
+
|
270
324
|
|
271
325
|
class SurfacePoint3:
|
272
326
|
"""
|
@@ -1273,7 +1327,8 @@ class Mesh:
|
|
1273
1327
|
...
|
1274
1328
|
|
1275
1329
|
@staticmethod
|
1276
|
-
def create_rect_beam_between(p0: Point3, p1: Point3, width: float, height: float,
|
1330
|
+
def create_rect_beam_between(p0: Point3, p1: Point3, width: float, height: float,
|
1331
|
+
up: Vector3 | None = None) -> Mesh:
|
1277
1332
|
"""
|
1278
1333
|
Create a rectangular cross-sectioned prism between two points with a specified width and height. The prism will
|
1279
1334
|
be centered between the two points and oriented along the line connecting them. The up vector's projection onto
|
@@ -1687,6 +1742,35 @@ class Aabb3:
|
|
1687
1742
|
"""
|
1688
1743
|
...
|
1689
1744
|
|
1745
|
+
def merged(self, other: Aabb3) -> Aabb3:
|
1746
|
+
"""
|
1747
|
+
Merge this AABB with another AABB. The resulting AABB will be the smallest AABB that contains both AABBs.
|
1748
|
+
|
1749
|
+
:param other: the other AABB to merge with.
|
1750
|
+
:return: a new AABB object representing the merged bounds.
|
1751
|
+
"""
|
1752
|
+
...
|
1753
|
+
|
1754
|
+
def indices_contained(self, points: NDArray[float]) -> NDArray[int]:
|
1755
|
+
"""
|
1756
|
+
Get the indices of the points that are contained within this AABB. The points should be a numpy array of shape
|
1757
|
+
(n, 3) where n is the number of points.
|
1758
|
+
|
1759
|
+
:param points: a numpy array of shape (n, 3) containing the points to check.
|
1760
|
+
:return: a numpy array of shape (m,) containing the indices of the points that are contained within this AABB,
|
1761
|
+
where m is the number of points contained within the AABB.
|
1762
|
+
"""
|
1763
|
+
...
|
1764
|
+
|
1765
|
+
def contains_point(self, point: Point3) -> bool:
|
1766
|
+
"""
|
1767
|
+
Check if a point is contained within this AABB.
|
1768
|
+
|
1769
|
+
:param point: the point to check.
|
1770
|
+
:return: True if the point is contained within the AABB, False otherwise.
|
1771
|
+
"""
|
1772
|
+
...
|
1773
|
+
|
1690
1774
|
|
1691
1775
|
class RayBundle3:
|
1692
1776
|
"""
|
@@ -1,25 +1,25 @@
|
|
1
|
-
engeom-0.2.
|
2
|
-
engeom-0.2.
|
3
|
-
engeom/
|
4
|
-
engeom/geom2.pyi,sha256=uMi4WD6-DtFx8H-RZsKIi-p1fN4p8SzOfBZmEuvNGDU,44357
|
5
|
-
engeom/geom3.pyi,sha256=XQKy3lEDybh-81uN7y6DNncj7w6LpR2haF7YTg8TwXg,74421
|
6
|
-
engeom/geom3/__init__.py,sha256=l8B0iDhJ4YiRbslJLN791XWai2DWrpmZptnzIETMS9g,370
|
7
|
-
engeom/geom2/__init__.py,sha256=JFpiLyROUh6vyakG-7JDSlCMCn4QB2MQ8bz3uVCaAIk,373
|
8
|
-
engeom/plot.py,sha256=LTqqO-h1EJL6wanM0hB79s9ohWwaCIijMOHVplY3vmc,1079
|
9
|
-
engeom/metrology/__init__.py,sha256=XvEhG8uDm1olWwZHDDrQv9LFP5zXhbsGx27PqRq8WE0,304
|
10
|
-
engeom/airfoil.pyi,sha256=VTeJBoS9Iij7p-92R7jCqzPasHmvAUocyzc6BSx7mvM,23557
|
11
|
-
engeom/_plot/pyvista.py,sha256=PylGVOa9RtRIYPyHLy969eyW8yIgAk-URVZT0R7WoQ8,12980
|
12
|
-
engeom/_plot/matplotlib.py,sha256=rFL1CPNMUqGO-fwD45V3-shektBMeNq5U15Zxp96hYw,14824
|
1
|
+
engeom-0.2.13.dist-info/METADATA,sha256=AoVEX7woDJ6gLnN23Izt7SaaJELLRu0Fo56gCpNRcqg,495
|
2
|
+
engeom-0.2.13.dist-info/WHEEL,sha256=MatQr8gCUwamU6XQoLbQL47pvFlKZET0ThYE5zAC_Uo,102
|
3
|
+
engeom/__init__.py,sha256=QN5uETqrN442w41foyrcCPV_x6NP-mrxkPJhdvdey1g,109
|
13
4
|
engeom/_plot/__init__.py,sha256=F_KviZtxzZGwfEjjn8Ep46N4UVl8VpFJWBzbBUE_J7A,30
|
14
5
|
engeom/_plot/common.py,sha256=Py78ufN3yi59hPwv21SoGcqyZUJS-_PmK8tlAKgSG7Q,517
|
6
|
+
engeom/_plot/matplotlib.py,sha256=ahLfgE3QHUFcNig6cHkFu9mwSwfMbDcNqkZmGaBh4Zk,15267
|
7
|
+
engeom/_plot/pyvista.py,sha256=PylGVOa9RtRIYPyHLy969eyW8yIgAk-URVZT0R7WoQ8,12980
|
8
|
+
engeom/airfoil.pyi,sha256=SivSrUo3LZSVgXwIFJtgUUejhPh71y8rekzBwaX6exI,24165
|
15
9
|
engeom/airfoil/__init__.py,sha256=gpS9pVepUu90XJ-ePndNupbUMKI0RGxNXPxD9x0iVHY,274
|
16
|
-
engeom/
|
17
|
-
engeom/__init__.py,sha256=QN5uETqrN442w41foyrcCPV_x6NP-mrxkPJhdvdey1g,109
|
10
|
+
engeom/align.pyi,sha256=QCSKrTLkCoaIubcrPU9J-wDZe1lRP0GbPgWZmonXjo0,997
|
18
11
|
engeom/align/__init__.py,sha256=SEeMqeqLKqJC73Mg8GwPwd9NwWnl-dcCqJ4rPdh8yyc,196
|
19
|
-
engeom/
|
12
|
+
engeom/engeom.abi3.so,sha256=KEgN7xBdNFhhs8W3THAcIjnJqO5XGMDFDb-p3SK8B5I,4094736
|
20
13
|
engeom/engeom.pyi,sha256=BtUBtYZ_MX8Xk2x_FyzVxRXjJQIazQ1xscbCLO_Y3HA,1516
|
21
|
-
engeom/
|
14
|
+
engeom/geom2.pyi,sha256=oUSner8BEJzJLv82POfOGyjAESw-McZzPq51o9VbdYg,51601
|
15
|
+
engeom/geom2/__init__.py,sha256=JFpiLyROUh6vyakG-7JDSlCMCn4QB2MQ8bz3uVCaAIk,373
|
16
|
+
engeom/geom3.pyi,sha256=KPWlcAeIZ_CQyuWh-3SFcQerag0D-gzqJS1fPvGWj40,77669
|
17
|
+
engeom/geom3/__init__.py,sha256=l8B0iDhJ4YiRbslJLN791XWai2DWrpmZptnzIETMS9g,370
|
22
18
|
engeom/metrology.pyi,sha256=9I5un86VB_2gmQBrVYhX8JzILTUADMLB9Em8ttJxrWg,4044
|
23
|
-
engeom/
|
24
|
-
engeom/
|
25
|
-
engeom
|
19
|
+
engeom/metrology/__init__.py,sha256=XvEhG8uDm1olWwZHDDrQv9LFP5zXhbsGx27PqRq8WE0,304
|
20
|
+
engeom/plot.py,sha256=LTqqO-h1EJL6wanM0hB79s9ohWwaCIijMOHVplY3vmc,1079
|
21
|
+
engeom/raster3.pyi,sha256=sBXXYXcDBiDU_OFDQiwa7Q3GcwSiUc4CLy6nJ1MwFqM,790
|
22
|
+
engeom/raster3/__init__.py,sha256=iaayLrvco-ZMZPyeK47ox7rYne_51DNb2T2Q0iNNeKE,289
|
23
|
+
engeom/sensor.pyi,sha256=a9y62FqhG-CFFHnJiC03PqBpFtxtfkH0zoDkk9LXWnU,1399
|
24
|
+
engeom/sensor/__init__.py,sha256=p-1osXrlBX_hXSSlvySszSimMv_4_n273joBcTFx2V0,179
|
25
|
+
engeom-0.2.13.dist-info/RECORD,,
|