pytetwild 0.1.dev1__cp311-cp311-win_amd64.whl → 0.1.1__cp311-cp311-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.
Binary file
pytetwild/__init__.py CHANGED
@@ -2,16 +2,15 @@
2
2
 
3
3
 
4
4
  # start delvewheel patch
5
- def _delvewheel_patch_1_5_4():
5
+ def _delvewheel_patch_1_11_2():
6
6
  import os
7
- libs_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'pytetwild.libs'))
8
- if os.path.isdir(libs_dir):
7
+ if os.path.isdir(libs_dir := os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'pytetwild.libs'))):
9
8
  os.add_dll_directory(libs_dir)
10
9
 
11
10
 
12
- _delvewheel_patch_1_5_4()
13
- del _delvewheel_patch_1_5_4
11
+ _delvewheel_patch_1_11_2()
12
+ del _delvewheel_patch_1_11_2
14
13
  # end delvewheel patch
15
14
 
16
15
  from ._version import __version__ # noqa: F401
17
- from .pytetwild import tetrahedralize, tetrahedralize_pv # noqa: F401
16
+ from .pytetwild import tetrahedralize, tetrahedralize_pv, tetrahedralize_csg # noqa: F401
pytetwild/_version.py CHANGED
@@ -1,4 +1,5 @@
1
1
  """Contains the pytetwild version."""
2
+
2
3
  from importlib import metadata
3
4
 
4
5
  __version__ = metadata.version("pytetwild")
pytetwild/pytetwild.py CHANGED
@@ -1,4 +1,5 @@
1
1
  """Wrapper for fTetWild."""
2
+
2
3
  import warnings
3
4
  import numpy as np
4
5
  from pytetwild import PyfTetWildWrapper # type: ignore
@@ -15,7 +16,7 @@ def _check_edge_length(edge_length_fac: float) -> None:
15
16
  Parameters
16
17
  ----------
17
18
  edge_length_fac : float, default: 0.05
18
- Tetrahedral edge length as a function of bounding box diagional. The
19
+ Tetrahedral edge length as a function of bounding box diagonal. The
19
20
  default ideal edge length is bb/20 (bounding box divided by 20).
20
21
 
21
22
 
@@ -35,7 +36,7 @@ def tetrahedralize_pv(
35
36
  mesh : pv.PolyData
36
37
  The input surface mesh.
37
38
  edge_length_fac : float, default: 0.05
38
- Tetrahedral edge length as a function of bounding box diagional. The
39
+ Tetrahedral edge length as a function of bounding box diagonal. The
39
40
  default ideal edge length is bb/20 (bounding box divided by 20).
40
41
  optimize : bool
41
42
  Improve the minimum scaled Jacobean for each cell. This leads to higher
@@ -66,7 +67,7 @@ def tetrahedralize_pv(
66
67
  import pyvista as pv
67
68
  except:
68
69
  raise ModuleNotFoundError(
69
- "Install PyVista to use this feature with:\n\n" "pip install pytetwild[all]"
70
+ "Install PyVista to use this feature with:\n\npip install pytetwild[all]"
70
71
  )
71
72
 
72
73
  if not isinstance(mesh, pv.PolyData):
@@ -96,7 +97,7 @@ def tetrahedralize_pv(
96
97
  )
97
98
  cell_types = np.full(tetrahedral_mesh_tetrahedra.shape[0], 10, dtype=np.uint8)
98
99
 
99
- return pv.UnstructuredGrid(cells, cell_types, tetrahedral_mesh_vertices)
100
+ return pv.UnstructuredGrid(cells, cell_types, tetrahedral_mesh_vertices).clean()
100
101
 
101
102
 
102
103
  def tetrahedralize(
@@ -118,7 +119,7 @@ def tetrahedralize(
118
119
  Improve the minimum scaled Jacobean for each cell. This leads to higher
119
120
  cell quality at the expense of computation time.
120
121
  edge_length_fac : float, default: 0.05
121
- Tetrahedral edge length as a function of bounding box diagional. The
122
+ Tetrahedral edge length as a function of bounding box diagonal. The
122
123
  default ideal edge length is bb/20 (bounding box divided by 20).
123
124
 
124
125
  Returns
@@ -134,3 +135,64 @@ def tetrahedralize(
134
135
  vertices = vertices.astype(np.float64, copy=False)
135
136
  faces = faces.astype(np.int32, copy=False)
136
137
  return PyfTetWildWrapper.tetrahedralize_mesh(vertices, faces, optimize, edge_length_fac)
138
+
139
+
140
+ def tetrahedralize_csg(
141
+ csg_file: str,
142
+ epsilon: float = 1e-3,
143
+ edge_length_r: float = 0.05,
144
+ stop_energy: float = 10.0,
145
+ coarsen: bool = True,
146
+ num_threads: int = 0,
147
+ loglevel: int = 3,
148
+ ) -> "pv.UnstructuredGrid":
149
+ """
150
+ Generate a tetrahedral mesh based on a the CSG tree specified in the csf_file.
151
+
152
+ Parameters
153
+ ----------
154
+ csg_file : str
155
+ Path to the input json file.
156
+ epsilon : float, default 1e-3
157
+ Envelop size, specifying the maximum distance of the output surface from the input surface,
158
+ relative to the bounding box size.
159
+ edge_length_r : float, default: 0.05
160
+ Tetrahedral edge length as a function of bounding box diagonal. The
161
+ default ideal edge length is bb/20 (bounding box divided by 20).
162
+ stop_energy : float, default: 10.0
163
+ The mesh optimization stops when the conformal AMIPS energy reaches 'stop_energy'.
164
+ coarsen : bool, default: true
165
+ Coarsen the output as much as possible, while maintaining the mesh quality.
166
+ num_threads : int, default: 0
167
+ Set number of threads used (0 means all available cores).
168
+ loglevel : int, default: 6
169
+ Set log level (0 = most verbose, 6 = minimal output).
170
+
171
+ Returns
172
+ -------
173
+ pv.UnstructuredGrid
174
+ The converted unstructured grid containing only tetrahedra,
175
+ with a cell attribute 'marker' indicating which of the input surfaces the cell belongs to.
176
+ """
177
+ try:
178
+ import pyvista as pv
179
+ except:
180
+ raise ModuleNotFoundError(
181
+ "Install PyVista to use this feature with:\n\npip install pytetwild[all]"
182
+ )
183
+ (tetrahedral_mesh_vertices, tetrahedral_mesh_tetrahedra, tetrahedral_marker) = (
184
+ PyfTetWildWrapper.tetrahedralize_csg(
185
+ csg_file, epsilon, edge_length_r, stop_energy, coarsen, num_threads, loglevel
186
+ )
187
+ )
188
+ cells = np.hstack(
189
+ [
190
+ np.full((tetrahedral_mesh_tetrahedra.shape[0], 1), 4, dtype=np.int32),
191
+ tetrahedral_mesh_tetrahedra,
192
+ ]
193
+ )
194
+ cell_types = np.full(tetrahedral_mesh_tetrahedra.shape[0], 10, dtype=np.uint8)
195
+
196
+ grid = pv.UnstructuredGrid(cells, cell_types, tetrahedral_mesh_vertices).clean()
197
+ grid["marker"] = tetrahedral_marker
198
+ return grid
@@ -0,0 +1,2 @@
1
+ Version: 1.11.2
2
+ Arguments: ['C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-aufwxr3e\\cp311-win_amd64\\build\\venv\\Scripts\\delvewheel', 'repair', '-w', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-aufwxr3e\\cp311-win_amd64\\repaired_wheel', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-aufwxr3e\\cp311-win_amd64\\built_wheel\\pytetwild-0.1.1-cp311-cp311-win_amd64.whl', '--add-path', '.']
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: pytetwild
3
- Version: 0.1.dev1
3
+ Version: 0.1.1
4
4
  Summary: Python wrapper of fTetWild
5
5
  Author-Email: Alex Kaszynski <akascap@gmail.com>
6
6
  Classifier: Development Status :: 3 - Alpha
@@ -10,22 +10,20 @@ Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
10
10
  Classifier: Operating System :: Microsoft :: Windows
11
11
  Classifier: Operating System :: POSIX
12
12
  Classifier: Operating System :: MacOS
13
- Classifier: Programming Language :: Python :: 3.8
14
- Classifier: Programming Language :: Python :: 3.9
15
13
  Classifier: Programming Language :: Python :: 3.10
16
14
  Classifier: Programming Language :: Python :: 3.11
17
15
  Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
18
17
  Requires-Dist: numpy
18
+ Provides-Extra: all
19
19
  Requires-Dist: pyvista; extra == "all"
20
+ Provides-Extra: dev
20
21
  Requires-Dist: pytest; extra == "dev"
21
22
  Requires-Dist: pre-commit; extra == "dev"
22
23
  Requires-Dist: pyvista; extra == "dev"
23
24
  Requires-Dist: scipy; extra == "dev"
24
25
  Requires-Dist: meshio; extra == "dev"
25
- Provides-Extra: all
26
- Provides-Extra: dev
27
26
  Description-Content-Type: text/x-rst
28
- License-File: LICENSE
29
27
 
30
28
  pytetwild
31
29
  #########
@@ -75,7 +73,7 @@ To tetrahedralize a surface mesh from `PyVista <https://docs.pyvista.org>`_:
75
73
 
76
74
  # Convert the surface mesh to a tetrahedral mesh. For this example let's
77
75
  # use a coarse mesh
78
- tetrahedral_mesh = pytetwild.tetrahedralize_pv(surface_mesh, edge_length_fac=1))
76
+ tetrahedral_mesh = pytetwild.tetrahedralize_pv(surface_mesh, edge_length_fac=1)
79
77
 
80
78
  # Visualize the tetrahedral mesh in an "exploded" view
81
79
  tetrahedral_mesh.explode(1).plot(show_edges=True)
@@ -84,7 +82,7 @@ To tetrahedralize a surface mesh from `PyVista <https://docs.pyvista.org>`_:
84
82
 
85
83
  You can also work with raw arrays. Here's a simple cube that we turn into tetrahedra.
86
84
 
87
- .. code:: pycon
85
+ .. code:: py
88
86
 
89
87
  import numpy as np
90
88
 
@@ -123,7 +121,7 @@ We've surfaced a handful of parameters to each of our interfaces
123
121
  Additional Parameters
124
122
  ---------------------
125
123
  edge_length_fac : float, default: 0.05
126
- Tetrahedral edge length as a function of bounding box diagional. The
124
+ Tetrahedral edge length as a function of bounding box diagonal. The
127
125
  default ideal edge length is bb/20 (bounding box divided by 20).
128
126
  optimize : bool
129
127
  Improve the minimum scaled Jacobean for each cell. This leads to higher
@@ -0,0 +1,13 @@
1
+ pytetwild/py.typed,sha256=mDShSrm8qg9qjacQc2F-rI8ATllqP6EdgHuEYxuCXZ0,7
2
+ pytetwild/PyfTetWildWrapper.pyd,sha256=u_3BzPeSqOfgPYJkMMrS5p0JHEGD0KI4JTX7xFD-Mdw,5939712
3
+ pytetwild/pytetwild.py,sha256=JZNJzIsoC9fOLqb4xDJ7oREJarEYkdvCgbIgRCvp52Q,6977
4
+ pytetwild/_version.py,sha256=A4_1DWpVQi-Rp5-lH3Itz0MNxg-VoQh0v0s0Wub4PQ4,120
5
+ pytetwild/__init__.py,sha256=l0Dwm58loQqSSrYqdxUx8lRHxeEBYyxr9gBvmvo-QIA,498
6
+ pytetwild-0.1.1.dist-info/DELVEWHEEL,sha256=DSm1D0Hj4Eo999dSUCjNre2BZOrnVWEvVBQfc3IPw_Q,421
7
+ pytetwild-0.1.1.dist-info/METADATA,sha256=4NA0MlyTgECJengiMK3QHzM89oMFU_IPMCscS8Mg4u0,4508
8
+ pytetwild-0.1.1.dist-info/RECORD,,
9
+ pytetwild-0.1.1.dist-info/WHEEL,sha256=oXhHG6ewLm-FNdEna2zwgy-K0KEl4claZ1ztR4VTx0I,106
10
+ pytetwild-0.1.1.dist-info/licenses/LICENSE,sha256=k0P1sbYupRWlxoESvbYq2UzoMW6MXA84LltqR-4mEo4,17096
11
+ pytetwild.libs/concrt140-63a42d2def1023b22584817146cee33d.dll,sha256=tWTNrcqIbCkALGnMNEoKRuaSbXscOIw0F5gWYZzfmDY,304128
12
+ pytetwild.libs/mpir-68915c4420c2a122a0aba56cd715bd26.dll,sha256=96pOmyi8-b4gAyXakkz7w0arxMoDHxmlAU33OZXMKAY,612352
13
+ pytetwild.libs/msvcp140-8f141b4454fa78db34bc1f28c571b4da.dll,sha256=jxQbRFT6eNs0vB8oxXG02g4AzSxD960OKC8xMDaCaq4,557648
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: scikit-build-core 0.8.2
2
+ Generator: scikit-build-core 0.11.6
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp311-cp311-win_amd64
5
5
 
@@ -1,2 +0,0 @@
1
- Version: 1.5.4
2
- Arguments: ['C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-rdukv1yg\\cp311-win_amd64\\build\\venv\\Scripts\\delvewheel', 'repair', '-w', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-rdukv1yg\\cp311-win_amd64\\repaired_wheel', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-rdukv1yg\\cp311-win_amd64\\built_wheel\\pytetwild-0.1.dev1-cp311-cp311-win_amd64.whl', '--add-path', '.']
@@ -1,14 +0,0 @@
1
- pytetwild/py.typed,sha256=mDShSrm8qg9qjacQc2F-rI8ATllqP6EdgHuEYxuCXZ0,7
2
- pytetwild/PyfTetWildWrapper.pyd,sha256=ojH-nbIrsvbCd6rCpHDE2HNSwsTag2x_-HM8c1rdh50,4990976
3
- pytetwild/pytetwild.py,sha256=PSLlG5czLo2Z2aZtcgxmZAy97E9eAtbo7EdvY0WONIs,4646
4
- pytetwild/_version.py,sha256=hbg9UkagWDGV6Zg23kEpex_otuUYHUzMCHXYTnFnHmE,118
5
- pytetwild/__init__.py,sha256=QdK3GINbrnK1cwEauX0cPgzkVCa1VPait8aGT2AJN4Q,486
6
- pytetwild-0.1.dev1.dist-info/DELVEWHEEL,sha256=Jof_OsfrYCWD5xfBGEx3t8btsaL3IAHoWQjxgLVys5U,423
7
- pytetwild-0.1.dev1.dist-info/entry_points.txt,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- pytetwild-0.1.dev1.dist-info/METADATA,sha256=6I1FzXoY9ezDC8EWamtUR2MVxWtBvgjD5frhxz4gw6Y,4587
9
- pytetwild-0.1.dev1.dist-info/RECORD,,
10
- pytetwild-0.1.dev1.dist-info/WHEEL,sha256=BqEX1Ir2N732jBkDsbdh_aEJYw2lve5DIKlaeaAffeY,105
11
- pytetwild-0.1.dev1.dist-info/licenses/LICENSE,sha256=k0P1sbYupRWlxoESvbYq2UzoMW6MXA84LltqR-4mEo4,17096
12
- pytetwild.libs/concrt140-ddbfd8b75976783430ced289c6b989c3.dll,sha256=BZPGv1uz0YBgBOgTWBBL0elt7C3clmR348_2Zlqh47Q,302080
13
- pytetwild.libs/mpir-0f58ffaa159ebf7efb9359a55c2d7f23.dll,sha256=qd6vEIL0JPtRZ39EzelGE9rApfJ6duoMgV8jT8UHGns,612352
14
- pytetwild.libs/msvcp140-3499a3a8427eec4915749ee9a8991ddd.dll,sha256=oDDcLf0uyiipN1ySmJrfTa8WH5iNteFrnhBnjrDf9Mc,573008
File without changes