ansys-pyensight-core 0.9.11__tar.gz → 0.9.12__tar.gz
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.
Potentially problematic release.
This version of ansys-pyensight-core might be problematic. Click here for more details.
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/PKG-INFO +3 -4
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/README.rst +1 -1
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/pyproject.toml +3 -4
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/launcher.py +1 -1
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/session.py +5 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/utils/dsg_server.py +74 -49
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/utils/omniverse_dsg_server.py +6 -4
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/LICENSE +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/__init__.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/common.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/deep_pixel_view.html +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/dockerlauncher.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/dvs.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/enscontext.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/enshell_grpc.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/ensight_grpc.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/ensobj.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/launch_ensight.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/libuserd.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/listobj.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/locallauncher.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/py.typed +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/renderable.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/sgeo_poll.html +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/utils/__init__.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/utils/adr.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/utils/export.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/utils/omniverse.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/utils/omniverse_cli.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/utils/omniverse_glb_server.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/utils/parts.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/utils/query.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/utils/readers.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/utils/resources/Materials/000_sky.exr +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/utils/support.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/utils/variables.py +0 -0
- {ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/utils/views.py +0 -0
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ansys-pyensight-core
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.12
|
|
4
4
|
Summary: A python wrapper for Ansys EnSight
|
|
5
5
|
Author-email: "ANSYS, Inc." <pyansys.core@ansys.com>
|
|
6
6
|
Maintainer-email: "ANSYS, Inc." <pyansys.core@ansys.com>
|
|
7
|
-
Requires-Python: >=3.
|
|
7
|
+
Requires-Python: >=3.10,<3.14
|
|
8
8
|
Description-Content-Type: text/x-rst
|
|
9
9
|
Classifier: Development Status :: 4 - Beta
|
|
10
10
|
Classifier: Intended Audience :: Science/Research
|
|
11
11
|
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
12
12
|
Classifier: License :: OSI Approved :: MIT License
|
|
13
13
|
Classifier: Operating System :: OS Independent
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
@@ -140,7 +139,7 @@ Installation
|
|
|
140
139
|
------------
|
|
141
140
|
To use PyEnSight, you must have a locally installed and licensed copy of
|
|
142
141
|
Ansys EnSight 2022 R2 or later. The ``ansys-pyensight-core`` package supports
|
|
143
|
-
Python 3.
|
|
142
|
+
Python 3.10 through Python 3.12 on Windows and Linux.
|
|
144
143
|
|
|
145
144
|
Two modes of installation are available:
|
|
146
145
|
|
|
@@ -72,7 +72,7 @@ Installation
|
|
|
72
72
|
------------
|
|
73
73
|
To use PyEnSight, you must have a locally installed and licensed copy of
|
|
74
74
|
Ansys EnSight 2022 R2 or later. The ``ansys-pyensight-core`` package supports
|
|
75
|
-
Python 3.
|
|
75
|
+
Python 3.10 through Python 3.12 on Windows and Linux.
|
|
76
76
|
|
|
77
77
|
Two modes of installation are available:
|
|
78
78
|
|
|
@@ -6,10 +6,10 @@ build-backend = "flit_core.buildapi"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "ansys-pyensight-core"
|
|
9
|
-
version = "0.9.
|
|
9
|
+
version = "0.9.12"
|
|
10
10
|
description = "A python wrapper for Ansys EnSight"
|
|
11
11
|
readme = "README.rst"
|
|
12
|
-
requires-python = ">=3.
|
|
12
|
+
requires-python = ">=3.10,<3.14"
|
|
13
13
|
license = {file = "LICENSE"}
|
|
14
14
|
authors = [{name = "ANSYS, Inc.", email = "pyansys.core@ansys.com"}]
|
|
15
15
|
maintainers = [{name = "ANSYS, Inc.", email = "pyansys.core@ansys.com"}]
|
|
@@ -19,7 +19,6 @@ classifiers = [
|
|
|
19
19
|
"Topic :: Scientific/Engineering :: Information Analysis",
|
|
20
20
|
"License :: OSI Approved :: MIT License",
|
|
21
21
|
"Operating System :: OS Independent",
|
|
22
|
-
"Programming Language :: Python :: 3.9",
|
|
23
22
|
"Programming Language :: Python :: 3.10",
|
|
24
23
|
"Programming Language :: Python :: 3.11",
|
|
25
24
|
"Programming Language :: Python :: 3.12",
|
|
@@ -161,7 +160,7 @@ recursive = true
|
|
|
161
160
|
exclude = ["venv/*", "tests/*"]
|
|
162
161
|
|
|
163
162
|
[tool.mypy]
|
|
164
|
-
python_version = 3.
|
|
163
|
+
python_version = 3.10
|
|
165
164
|
strict = false
|
|
166
165
|
namespace_packages = true
|
|
167
166
|
explicit_package_bases = true
|
{ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/launcher.py
RENAMED
|
@@ -234,7 +234,7 @@ class Launcher:
|
|
|
234
234
|
for process in psutil.process_iter():
|
|
235
235
|
try:
|
|
236
236
|
process_cmdline = process.cmdline()
|
|
237
|
-
except (psutil.AccessDenied, psutil.ZombieProcess, OSError):
|
|
237
|
+
except (psutil.AccessDenied, psutil.ZombieProcess, OSError, psutil.NoSuchProcess):
|
|
238
238
|
continue
|
|
239
239
|
if not process_cmdline:
|
|
240
240
|
continue
|
{ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/session.py
RENAMED
|
@@ -1058,6 +1058,11 @@ class Session:
|
|
|
1058
1058
|
except RuntimeError: # pragma: no cover
|
|
1059
1059
|
# handle some intermediate EnSight builds.
|
|
1060
1060
|
pass
|
|
1061
|
+
except IOError: # pragma: no cover
|
|
1062
|
+
# The session might already have been closed via another
|
|
1063
|
+
# session object. If grpc is inactive, there's no sense
|
|
1064
|
+
# in raising an exception since we are closing it anyway
|
|
1065
|
+
pass
|
|
1061
1066
|
if self._launcher and self._halt_ensight_on_close:
|
|
1062
1067
|
self._launcher.close(self)
|
|
1063
1068
|
else:
|
|
@@ -12,6 +12,13 @@ from ansys.api.pyensight.v0 import dynamic_scene_graph_pb2
|
|
|
12
12
|
from ansys.pyensight.core import ensight_grpc
|
|
13
13
|
import numpy
|
|
14
14
|
|
|
15
|
+
try:
|
|
16
|
+
import dsgutils
|
|
17
|
+
|
|
18
|
+
dsgutils_loaded = True
|
|
19
|
+
except ModuleNotFoundError:
|
|
20
|
+
dsgutils_loaded = False
|
|
21
|
+
|
|
15
22
|
if TYPE_CHECKING:
|
|
16
23
|
from ansys.pyensight.core import Session
|
|
17
24
|
|
|
@@ -238,36 +245,51 @@ class Part(object):
|
|
|
238
245
|
self.session.log("Warning: zero length normals!")
|
|
239
246
|
else:
|
|
240
247
|
new_normals = numpy.ndarray((num_prims * verts_per_prim * 3,), dtype="float32")
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
248
|
+
if dsgutils_loaded:
|
|
249
|
+
dsgutils.build_nodal_surface_rep(
|
|
250
|
+
verts_per_prim,
|
|
251
|
+
self.normals_elem,
|
|
252
|
+
self.tcoords_elem,
|
|
253
|
+
conn,
|
|
254
|
+
verts,
|
|
255
|
+
normals,
|
|
256
|
+
tcoords,
|
|
257
|
+
new_conn,
|
|
258
|
+
new_verts,
|
|
259
|
+
new_normals,
|
|
260
|
+
new_tcoords,
|
|
261
|
+
)
|
|
262
|
+
else:
|
|
263
|
+
j = 0
|
|
264
|
+
for i0 in range(num_prims):
|
|
265
|
+
for i1 in range(verts_per_prim):
|
|
266
|
+
idx = conn[i0 * verts_per_prim + i1]
|
|
267
|
+
# new connectivity (identity)
|
|
268
|
+
new_conn[j] = j
|
|
269
|
+
# copy the vertex
|
|
270
|
+
new_verts[j * 3 + 0] = verts[idx * 3 + 0]
|
|
271
|
+
new_verts[j * 3 + 1] = verts[idx * 3 + 1]
|
|
272
|
+
new_verts[j * 3 + 2] = verts[idx * 3 + 2]
|
|
273
|
+
if new_normals is not None:
|
|
274
|
+
if self.normals_elem:
|
|
275
|
+
# copy the normal associated with the face
|
|
276
|
+
new_normals[j * 3 + 0] = normals[i0 * 3 + 0]
|
|
277
|
+
new_normals[j * 3 + 1] = normals[i0 * 3 + 1]
|
|
278
|
+
new_normals[j * 3 + 2] = normals[i0 * 3 + 2]
|
|
279
|
+
else:
|
|
280
|
+
# copy the same normal as the vertex
|
|
281
|
+
new_normals[j * 3 + 0] = normals[idx * 3 + 0]
|
|
282
|
+
new_normals[j * 3 + 1] = normals[idx * 3 + 1]
|
|
283
|
+
new_normals[j * 3 + 2] = normals[idx * 3 + 2]
|
|
284
|
+
if new_tcoords is not None:
|
|
285
|
+
# remember, 1D texture coords at this point
|
|
286
|
+
if self.tcoords_elem:
|
|
287
|
+
# copy the texture coord associated with the face
|
|
288
|
+
new_tcoords[j] = tcoords[i0]
|
|
289
|
+
else:
|
|
290
|
+
# copy the same texture coord as the vertex
|
|
291
|
+
new_tcoords[j] = tcoords[idx]
|
|
292
|
+
j += 1
|
|
271
293
|
# new arrays.
|
|
272
294
|
verts = new_verts
|
|
273
295
|
conn = new_conn
|
|
@@ -349,24 +371,27 @@ class Part(object):
|
|
|
349
371
|
var_minmax: List[float] = [v_min, v_max] # type: ignore
|
|
350
372
|
# build a power of two x 1 texture
|
|
351
373
|
num_texels = len(var_cmd.texture) // 4
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
s
|
|
368
|
-
|
|
369
|
-
|
|
374
|
+
if dsgutils_loaded:
|
|
375
|
+
tmp = dsgutils.build_st_coords(tcoords, v_min, v_max, num_texels)
|
|
376
|
+
else:
|
|
377
|
+
half_texel = 1 / (num_texels * 2.0)
|
|
378
|
+
tmp = numpy.ndarray((num_verts * 2,), dtype="float32")
|
|
379
|
+
tmp.fill(0.5) # fill in the T coordinate...
|
|
380
|
+
tex_width = half_texel * 2 * (num_texels - 1) # center to center of num_texels
|
|
381
|
+
# if the range is 0, adjust the min by -1. The result is that the texture
|
|
382
|
+
# coords will get mapped to S=1.0 which is what EnSight does in this situation
|
|
383
|
+
if (var_minmax[1] - var_minmax[0]) == 0.0:
|
|
384
|
+
var_minmax[0] = var_minmax[0] - 1.0
|
|
385
|
+
var_width = var_minmax[1] - var_minmax[0]
|
|
386
|
+
for idx in range(num_verts):
|
|
387
|
+
# normalized S coord value (clamp)
|
|
388
|
+
s = (tcoords[idx] - var_minmax[0]) / var_width
|
|
389
|
+
if s < 0.0:
|
|
390
|
+
s = 0.0
|
|
391
|
+
if s > 1.0:
|
|
392
|
+
s = 1.0
|
|
393
|
+
# map to the texture range and set the S value
|
|
394
|
+
tmp[idx * 2] = s * tex_width + half_texel
|
|
370
395
|
return tmp, var_cmd
|
|
371
396
|
|
|
372
397
|
def line_rep(self):
|
|
@@ -925,7 +950,7 @@ class DSGSession(object):
|
|
|
925
950
|
except Exception:
|
|
926
951
|
self._shutdown = True
|
|
927
952
|
self.log("DSG connection broken, calling exit")
|
|
928
|
-
|
|
953
|
+
sys.exit(0)
|
|
929
954
|
|
|
930
955
|
def _get_next_message(self, wait: bool = True) -> Any:
|
|
931
956
|
"""Get the next queued up protobuffer message
|
|
@@ -844,7 +844,8 @@ class OmniverseUpdateHandler(UpdateHandler):
|
|
|
844
844
|
if part.cmd.render == part.cmd.CONNECTIVITY:
|
|
845
845
|
has_triangles = False
|
|
846
846
|
command, verts, conn, normals, tcoords, var_cmd = part.nodal_surface_rep()
|
|
847
|
-
verts
|
|
847
|
+
if verts is not None:
|
|
848
|
+
verts = numpy.multiply(verts, self._omni._units_per_meter)
|
|
848
849
|
if command is not None:
|
|
849
850
|
has_triangles = True
|
|
850
851
|
# Generate the mesh block
|
|
@@ -865,7 +866,8 @@ class OmniverseUpdateHandler(UpdateHandler):
|
|
|
865
866
|
mat_info=mat_info,
|
|
866
867
|
)
|
|
867
868
|
command, verts, tcoords, var_cmd = part.line_rep()
|
|
868
|
-
verts
|
|
869
|
+
if verts is not None:
|
|
870
|
+
verts = numpy.multiply(verts, self._omni._units_per_meter)
|
|
869
871
|
if command is not None:
|
|
870
872
|
# If there are no triangle (ideally if these are not hidden line
|
|
871
873
|
# edges), then use the base color for the part. If there are
|
|
@@ -921,8 +923,8 @@ class OmniverseUpdateHandler(UpdateHandler):
|
|
|
921
923
|
|
|
922
924
|
elif part.cmd.render == part.cmd.NODES:
|
|
923
925
|
command, verts, sizes, colors, var_cmd = part.point_rep()
|
|
924
|
-
verts
|
|
925
|
-
|
|
926
|
+
if verts is not None:
|
|
927
|
+
verts = numpy.multiply(verts, self._omni._units_per_meter)
|
|
926
928
|
if sizes is not None:
|
|
927
929
|
sizes = numpy.multiply(sizes, self._omni._units_per_meter)
|
|
928
930
|
if command is not None:
|
|
File without changes
|
{ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/__init__.py
RENAMED
|
File without changes
|
{ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/common.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/enscontext.py
RENAMED
|
File without changes
|
{ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/enshell_grpc.py
RENAMED
|
File without changes
|
{ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/ensight_grpc.py
RENAMED
|
File without changes
|
{ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/ensobj.py
RENAMED
|
File without changes
|
|
File without changes
|
{ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/libuserd.py
RENAMED
|
File without changes
|
{ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/listobj.py
RENAMED
|
File without changes
|
|
File without changes
|
{ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/py.typed
RENAMED
|
File without changes
|
{ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/renderable.py
RENAMED
|
File without changes
|
{ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/sgeo_poll.html
RENAMED
|
File without changes
|
|
File without changes
|
{ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/utils/adr.py
RENAMED
|
File without changes
|
{ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/utils/export.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/utils/parts.py
RENAMED
|
File without changes
|
{ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/utils/query.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ansys_pyensight_core-0.9.11 → ansys_pyensight_core-0.9.12}/src/ansys/pyensight/core/utils/views.py
RENAMED
|
File without changes
|