engeom 0.1.1__cp38-abi3-macosx_11_0_arm64.whl → 0.2.1__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/metrology.pyi ADDED
@@ -0,0 +1,32 @@
1
+ from .geom2 import Point2, Vector2, SurfacePoint2
2
+
3
+
4
+ class Length2:
5
+ def __init__(self, a: Point2, b: Point2, direction: Vector2 | None = None):
6
+ """
7
+
8
+ :param a:
9
+ :param b:
10
+ :param direction:
11
+ """
12
+ ...
13
+
14
+ @property
15
+ def a(self) -> Point2:
16
+ ...
17
+
18
+ @property
19
+ def b(self) -> Point2:
20
+ ...
21
+
22
+ @property
23
+ def direction(self) -> Vector2:
24
+ ...
25
+
26
+ @property
27
+ def value(self) -> float:
28
+ ...
29
+
30
+ @property
31
+ def center(self) -> SurfacePoint2:
32
+ ...
engeom/pyvista.py CHANGED
@@ -1,8 +1,15 @@
1
1
  """
2
- This module contains helper functions for working with PyVista.
2
+ This module contains helper functions for working with PyVista.
3
3
  """
4
+
5
+ from __future__ import annotations
6
+
7
+ from typing import List
8
+
4
9
  import numpy
5
- from .geom3 import Mesh
10
+ from pyvista import ColorLike
11
+
12
+ from .geom3 import Mesh, Curve3
6
13
 
7
14
  try:
8
15
  import pyvista
@@ -10,17 +17,48 @@ except ImportError:
10
17
  pass
11
18
  else:
12
19
 
13
- def mesh_polydata(mesh: Mesh) -> pyvista.PolyData:
14
- """
15
- Creates a PyVista PolyData object from a Mesh object.
16
- :param mesh: a Mesh object
17
- :return: a PyVista PolyData object
18
- """
20
+ class PlotterHelper:
21
+ def __init__(self, plotter: pyvista.Plotter):
22
+ self.plotter = plotter
23
+
24
+ def add_curves(
25
+ self,
26
+ *curves: Curve3,
27
+ color: ColorLike = "w",
28
+ width: float = 5.0,
29
+ label: str | None = None,
30
+ name: str | None = None,
31
+ ) -> List[pyvista.vtkActor]:
32
+ """
33
+
34
+ :param curves:
35
+ :param color:
36
+ :param width:
37
+ :param label:
38
+ :param name:
39
+ :return:
40
+ """
41
+ result_list = []
42
+ for curve in curves:
43
+ added = self.plotter.add_lines(
44
+ curve.points,
45
+ connected=True,
46
+ color=color,
47
+ width=width,
48
+ label=label,
49
+ name=name,
50
+ )
51
+ result_list.append(added)
52
+
53
+ return result_list
19
54
 
20
- if pyvista is None:
21
- raise ImportError("PyVista is not installed.")
55
+ def add_mesh(self, mesh: Mesh, **kwargs) -> pyvista.vtkActor:
56
+ """
22
57
 
23
- vertices = mesh.clone_vertices()
24
- faces = mesh.clone_triangles()
25
- faces = numpy.hstack((numpy.ones((faces.shape[0], 1), dtype=faces.dtype) * 3, faces))
26
- return pyvista.PolyData(vertices, faces)
58
+ :param mesh:
59
+ :return:
60
+ """
61
+ prefix = numpy.ones((mesh.triangles.shape[0], 1), dtype=mesh.triangles.dtype)
62
+ faces = numpy.hstack((prefix * 3, mesh.triangles))
63
+ data = pyvista.PolyData(mesh.points, faces)
64
+ return self.plotter.add_mesh(data, **kwargs)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: engeom
3
- Version: 0.1.1
3
+ Version: 0.2.1
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -0,0 +1,18 @@
1
+ engeom-0.2.1.dist-info/METADATA,sha256=8MGvMlNyJjmeSSKaFGTM71uhryuOUrx9K_BpDPwVAfQ,339
2
+ engeom-0.2.1.dist-info/WHEEL,sha256=fPYOJLx2edKzGkAKHiRlt5qr-MtqxrOB4_pSJ_LwCfA,102
3
+ engeom/geom2.pyi,sha256=Jh0ES-Gvkl7sFQV7VG6KdwgDbCPhmiETG_YOObYazhU,22741
4
+ engeom/geom3.pyi,sha256=np6QjaeAS1Ms0Y4xNj4IoLRgI-rd9oh2sAH9TJem8Gw,28230
5
+ engeom/geom3/__init__.py,sha256=DG5jt2xgS9WRNb58ZkkrcKQQO6bIG-irg-uV_BkHEj4,174
6
+ engeom/pyvista.py,sha256=g3wwolj-F0kDSVuDl03CN-DbbR2R71dz-hzqard3bQs,1703
7
+ engeom/geom2/__init__.py,sha256=mRu8Zh6DE-EQyhxScoxszPqDjGVzGWVJEQO6RIAtS4A,174
8
+ engeom/metrology/__init__.py,sha256=cpsB0-hJGitzW79Coxwf7r_mpNaeI6yG3myDEVdBJgk,186
9
+ engeom/matplotlib.py,sha256=3B2gRowUT5UDy-d46i9yANfoxoCa_BBuRo4HHb7NFYU,9275
10
+ engeom/airfoil.pyi,sha256=0TVpXkolFUXbBqJp93FenA_XqvU7FD1DnbncAF0ubow,14654
11
+ engeom/airfoil/__init__.py,sha256=G6m7JEvHVk3sM2JooJPOg8JNA3VuEp0EIqczSEbC_PY,180
12
+ engeom/__init__.py,sha256=QN5uETqrN442w41foyrcCPV_x6NP-mrxkPJhdvdey1g,109
13
+ engeom/align/__init__.py,sha256=SEeMqeqLKqJC73Mg8GwPwd9NwWnl-dcCqJ4rPdh8yyc,196
14
+ engeom/engeom.pyi,sha256=3skN9Dp3o2cWBo-DxBDy4JHkBM73kGLRj0ob3PKlHeE,186
15
+ engeom/metrology.pyi,sha256=dEPRtvc8us6rMLwg3wIWUa92Udew_QN_Y71NV9zGf2s,572
16
+ engeom/align.pyi,sha256=QCSKrTLkCoaIubcrPU9J-wDZe1lRP0GbPgWZmonXjo0,997
17
+ engeom/engeom.abi3.so,sha256=6nD5pcct1vU8Kw-EZflFzNxxZOeH0qwOqtdy5T_pmsA,1894976
18
+ engeom-0.2.1.dist-info/RECORD,,
@@ -1,14 +0,0 @@
1
- engeom-0.1.1.dist-info/METADATA,sha256=z8XmJMWeTVLOwcvkJvmggeYXlOUJKfEjA4NfrS8GlX0,339
2
- engeom-0.1.1.dist-info/WHEEL,sha256=fPYOJLx2edKzGkAKHiRlt5qr-MtqxrOB4_pSJ_LwCfA,102
3
- engeom/geom2.pyi,sha256=nwZ8Isy-PdvNIIyZyNuo78Us95CXd1FaWllqnF9MKbE,2978
4
- engeom/geom3.pyi,sha256=PjDbjM3d20PUbP5pmlb8OqpZ7gM0RQL_f7gEVTbr7kE,16198
5
- engeom/geom3/__init__.py,sha256=DG5jt2xgS9WRNb58ZkkrcKQQO6bIG-irg-uV_BkHEj4,174
6
- engeom/pyvista.py,sha256=zJ-FFwbzxVhhhrh4rfn26iaOK95Tw0L2QZsDNK8MXzg,729
7
- engeom/geom2/__init__.py,sha256=mRu8Zh6DE-EQyhxScoxszPqDjGVzGWVJEQO6RIAtS4A,174
8
- engeom/matplotlib.py,sha256=N3CkAtQjh9xZ1hx6_piFGRNzLRLEMh9OVvWDKx5yiL8,1676
9
- engeom/__init__.py,sha256=QN5uETqrN442w41foyrcCPV_x6NP-mrxkPJhdvdey1g,109
10
- engeom/align/__init__.py,sha256=SEeMqeqLKqJC73Mg8GwPwd9NwWnl-dcCqJ4rPdh8yyc,196
11
- engeom/engeom.pyi,sha256=flbU5LWg6szeBLTaxa1eNvN8wBhLCf9qdFNgxOYS1ng,203
12
- engeom/align.pyi,sha256=KBC0nwcyp4YMfY2hRN1gr3DqFah-unqAd_o1KYwJAqc,1022
13
- engeom/engeom.abi3.so,sha256=XIZRdghy21tMudxO05gzdHSOK3e2tmlUuzmMT_ZcwFU,1295424
14
- engeom-0.1.1.dist-info/RECORD,,
File without changes