ansys-pyensight-core 0.9.13__py3-none-any.whl → 0.9.15__py3-none-any.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.

Potentially problematic release.


This version of ansys-pyensight-core might be problematic. Click here for more details.

@@ -384,8 +384,7 @@ class DockerLauncher(Launcher):
384
384
 
385
385
  def launch_webui(self, container_env_str):
386
386
  # Run websocketserver
387
- cmd = f"cpython /ansys_inc/v{self._ansys_version}/CEI/"
388
- cmd += f"nexus{self._ansys_version}/nexus_launcher/webui_launcher.py"
387
+ cmd = "cpython -m ansys.simba.plugin.post.simba_post"
389
388
  # websocket port - this needs to come first since we now have
390
389
  # --add_header as a optional arg that can take an arbitrary
391
390
  # number of optional headers.
@@ -102,10 +102,8 @@ class LocalLauncher(Launcher):
102
102
  """Type of app to launch. Options are ``ensight`` and ``envision``."""
103
103
  return self._application
104
104
 
105
- def launch_webui(self, cpython, webui_script, popen_common):
106
- cmd = [cpython]
107
- cmd += [webui_script]
108
- version = re.findall(r"nexus(\d+)", webui_script)[0]
105
+ def launch_webui(self, cpython, version, popen_common):
106
+ cmd = [cpython, "-m", "ansys.simba.plugin.post.simba_post"]
109
107
  path_to_webui = self._install_path
110
108
  # Dev environment
111
109
  path_to_webui_internal = os.path.join(
@@ -267,7 +265,7 @@ class LocalLauncher(Launcher):
267
265
  except Exception:
268
266
  pass
269
267
  websocket_script = found_scripts[idx]
270
- webui_script = websocket_script.replace("websocketserver.py", "webui_launcher.py")
268
+ version = re.findall(r"nexus(\d+)", websocket_script)[0]
271
269
  # build the commandline
272
270
  cmd = [os.path.join(self._install_path, "bin", "cpython"), websocket_script]
273
271
  if is_windows:
@@ -319,7 +317,7 @@ class LocalLauncher(Launcher):
319
317
  self._sessions.append(session)
320
318
 
321
319
  if self._launch_webui:
322
- self.launch_webui(ensight_python, webui_script, popen_common)
320
+ self.launch_webui(ensight_python, version, popen_common)
323
321
  return session
324
322
 
325
323
  def stop(self) -> None:
@@ -1084,6 +1084,21 @@ class DSGSession(object):
1084
1084
  self._finish_part()
1085
1085
  self._part.reset(part_cmd)
1086
1086
 
1087
+ def find_group_pb(self, group_id: int) -> Any:
1088
+ """Return the group command protobuffer for a specific group id.
1089
+
1090
+ Parameters
1091
+ ----------
1092
+ group_id: int
1093
+ The group DSG protocol entity id.
1094
+
1095
+ Returns
1096
+ -------
1097
+ any
1098
+ The group command protobuffer or None.
1099
+ """
1100
+ return self._groups.get(group_id, None)
1101
+
1087
1102
  def _handle_group(self, group: Any) -> None:
1088
1103
  """Handle a DSG UPDATE_GROUP command
1089
1104
 
@@ -156,6 +156,7 @@ class GLBSession(dsg_server.DSGSession):
156
156
  cmd, part_pb = self._create_pb("PART", parent_id=parentid, name=part_name)
157
157
  if mode == pygltflib.POINTS:
158
158
  part_pb.render = dynamic_scene_graph_pb2.UpdatePart.RenderingMode.NODES
159
+ # Size of the spheres
159
160
  part_pb.node_size_default = line_width
160
161
  else:
161
162
  part_pb.render = dynamic_scene_graph_pb2.UpdatePart.RenderingMode.CONNECTIVITY
@@ -404,10 +405,39 @@ class GLBSession(dsg_server.DSGSession):
404
405
  # GLB node -> DSG Group
405
406
  cmd, group_pb = self._create_pb("GROUP", parent_id=parentid, name=name)
406
407
  group_pb.matrix4x4.extend(matrix)
407
- self._handle_update_command(cmd)
408
-
409
408
  if node.mesh is not None:
409
+ # This is a little ugly, but spheres have a size that is part of the PART
410
+ # protobuffer. So, if the current mesh has the "ANSYS_linewidth" extension,
411
+ # we need to temporally change the line width. However, if this is a lines
412
+ # object, then we need to set the ANSYS_linewidth attribute. Unfortunately,
413
+ # this is only available on the GROUP protobuffer, thus we will try to set
414
+ # both here.
415
+ # Note: in the EnSight push, ANSYS_linewidth will only ever be set on the
416
+ # top level node. In the GLB case, we will scope it to the group. Thus,
417
+ # every "mesh" protobuffer sequence will have an explicit line width in
418
+ # the group above the part.
419
+
420
+ # save/restore the current line_width
421
+ orig_width = self._callback_handler._omni.line_width
422
+ mesh = self._gltf.meshes[node.mesh]
423
+ try:
424
+ # check for line_width on the mesh object
425
+ width = float(mesh.extensions["ANSYS_linewidth"]["linewidth"])
426
+ # make sure spheres work
427
+ self._callback_handler._omni.line_width = width
428
+ except (KeyError, ValueError):
429
+ pass
430
+ # make sure lines work (via the group attributes map)
431
+ group_pb.attributes["ANSYS_linewidth"] = str(self._callback_handler._omni.line_width)
432
+ # send the group protobuffer
433
+ self._handle_update_command(cmd)
434
+ # Export the mesh
410
435
  self._parse_mesh(node.mesh, group_pb.id, name)
436
+ # restore the old line_width
437
+ self._callback_handler._omni.line_width = orig_width
438
+ else:
439
+ # send the group protobuffer
440
+ self._handle_update_command(cmd)
411
441
 
412
442
  # Handle node.rotation, node.translation, node.scale, node.matrix
413
443
  for child_id in node.children:
@@ -583,7 +613,7 @@ class GLBSession(dsg_server.DSGSession):
583
613
  view_pb.fieldofview = camera.perspective.yfov
584
614
  view_pb.aspectratio = camera.aspectratio.aspectRatio
585
615
  self._handle_update_command(cmd)
586
- # walk the scene nodes RJF
616
+ # walk the scene nodes
587
617
  scene = self._gltf.scenes[scene_idx]
588
618
  try:
589
619
  if self._callback_handler._omni.line_width == 0.0:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ansys-pyensight-core
3
- Version: 0.9.13
3
+ Version: 0.9.15
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>
@@ -19,7 +19,7 @@ Requires-Dist: importlib-metadata>=4.0; python_version<='3.8'
19
19
  Requires-Dist: ansys-api-pyensight==0.4.7
20
20
  Requires-Dist: requests>=2.28.2
21
21
  Requires-Dist: docker>=6.1.0
22
- Requires-Dist: urllib3<3.0.0
22
+ Requires-Dist: urllib3<2.4.0
23
23
  Requires-Dist: numpy>=1.21.0,<3
24
24
  Requires-Dist: Pillow>=9.3.0
25
25
  Requires-Dist: pypng>=0.0.20
@@ -1,7 +1,7 @@
1
1
  ansys/pyensight/core/__init__.py,sha256=BCfpDonS2OZRM2O6wjcyOYhLSgdy9hMQRl6G-_9Bvkg,845
2
2
  ansys/pyensight/core/common.py,sha256=f28uGaJhpSmOE1i6MwzqFH0_jKpIByglM2plB2K4Hdk,7574
3
3
  ansys/pyensight/core/deep_pixel_view.html,sha256=6u4mGOuzJiPze8N8pIKJsEGPv5y6-zb38m9IfrarATE,3510
4
- ansys/pyensight/core/dockerlauncher.py,sha256=9JYXbUbKimr4C6uILdsVCAELtARiTleaCCjN2V-OcRg,28494
4
+ ansys/pyensight/core/dockerlauncher.py,sha256=Qu3zbldCOdSfcXmvw6l3L3mocJs3ttc-Cc3S9BvTvhM,28414
5
5
  ansys/pyensight/core/dvs.py,sha256=xL2LeJ9uja3mFBuU8vsE26O_NFgaR9uhDvxZKAHGGvg,31284
6
6
  ansys/pyensight/core/enscontext.py,sha256=GSKkjZt1QEPyHEQ59EEBgKGMik9vjCdR9coR4uX7fEw,12141
7
7
  ansys/pyensight/core/enshell_grpc.py,sha256=-OxSdFI_p3DmQnqh1jT_a_aSh_w-EUD2IaWGKxrnyjI,17122
@@ -11,19 +11,19 @@ ansys/pyensight/core/launch_ensight.py,sha256=iZJM6GdpzGRDLzrv1V2QZ5veIOpNSB5xPp
11
11
  ansys/pyensight/core/launcher.py,sha256=x6L1E6OGpqL2jrDdIGI0p4BxQZhHt93yl1Pwj_2lAiQ,13143
12
12
  ansys/pyensight/core/libuserd.py,sha256=YKXY1aaaTBT2uwcyhPEW-f93KLtCYQNMJXTlBsenWDI,75459
13
13
  ansys/pyensight/core/listobj.py,sha256=Trw87IxIMXtmUd1DzywRmMzORU704AG4scX4fqYmO6M,9340
14
- ansys/pyensight/core/locallauncher.py,sha256=ptvbVoGYrb9OHawMpi9RRj_KVxR60mMaZaIPW4CPERI,17122
14
+ ansys/pyensight/core/locallauncher.py,sha256=1zrBK2NTdodMaKYI2588a8HR7_SqMVmoUW7ItqwxMEI,17039
15
15
  ansys/pyensight/core/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  ansys/pyensight/core/renderable.py,sha256=KidVTVCZ4hKYq54pP9KoJ8OCxeWBXNUJYyKSwMZ2Sls,36362
17
17
  ansys/pyensight/core/session.py,sha256=6UEMn6X_08JzaAhmpIi4TQfv8zdONDG1cH8UaO7MQR8,74114
18
18
  ansys/pyensight/core/sgeo_poll.html,sha256=1M4BIc5CZpYA3b40qzk22NcPCLhjFnWdoS2PrS6Rhn4,752
19
19
  ansys/pyensight/core/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  ansys/pyensight/core/utils/adr.py,sha256=XslZhlwcrSGzOlnhzprOv3ju_ppxxsWBjCnQL5KiNms,3570
21
- ansys/pyensight/core/utils/dsg_server.py,sha256=C1rNlL5M36Ee5kMroQrqAykGICpjJsx_qhJspQ0x4LE,46381
21
+ ansys/pyensight/core/utils/dsg_server.py,sha256=ScNf7sb339kvEGIwIAlJpxzPvOGbUSnvNrCat9soFlw,46769
22
22
  ansys/pyensight/core/utils/export.py,sha256=UAJQcrElo3esQD0CWdxxjMQ8yE1vB4cdAhF33_uZfQw,22605
23
23
  ansys/pyensight/core/utils/omniverse.py,sha256=irghU1wcIvo_lHhZV2VxYKCSQkNWCF8njJjWfExiFgI,18455
24
24
  ansys/pyensight/core/utils/omniverse_cli.py,sha256=aVYu4HsSZBl7A9_xU3DfItNB-hpxCdMPXm_oMAOU_HQ,20261
25
25
  ansys/pyensight/core/utils/omniverse_dsg_server.py,sha256=JCklPQC4xqwnvB7zVdLW80RpB9DlKN3hgs_Sj4sPhFY,39995
26
- ansys/pyensight/core/utils/omniverse_glb_server.py,sha256=aWAsGTxSl0w6VYRXCx8FaKGlLtfii2OUm_wBmP2Ay0I,30100
26
+ ansys/pyensight/core/utils/omniverse_glb_server.py,sha256=KSaLvGfyREu9bSTA3wgiAzf68s0KfQuWLwHbZ1Zf5vE,31824
27
27
  ansys/pyensight/core/utils/parts.py,sha256=222XFRCjLgH7hho-cK9JrGCg3-KlTf54KIgc7y50sTE,52173
28
28
  ansys/pyensight/core/utils/query.py,sha256=OXKDbf1sOTX0sUvtKcp64LhVl-BcrEsE43w8uMxLOYI,19828
29
29
  ansys/pyensight/core/utils/readers.py,sha256=cNNzrE5pjy4wpQKWAzIIJfJCSpY3HU43az02f5I3pVU,11968
@@ -31,7 +31,7 @@ ansys/pyensight/core/utils/support.py,sha256=QI3z9ex7zJxjFbkCPba9DWqWgPFIThORqr0
31
31
  ansys/pyensight/core/utils/variables.py,sha256=ZUiJdDIeRcowrnLXaJQqGwA0RbrfXhc1s4o4v9A4PiY,95133
32
32
  ansys/pyensight/core/utils/views.py,sha256=ZKhJ6vMT7Rdd4bwJ0egMYTV7-D7Q7I19fF2_j_CMQ0o,12489
33
33
  ansys/pyensight/core/utils/resources/Materials/000_sky.exr,sha256=xAR1gFd2uxPZDnvgfegdhEhRaqKtZldQDiR_-1rHKO0,8819933
34
- ansys_pyensight_core-0.9.13.dist-info/licenses/LICENSE,sha256=K6LiJHOa9IbWFelXmXNRzFr3zG45SOGZIN7vdLdURGU,1097
35
- ansys_pyensight_core-0.9.13.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
36
- ansys_pyensight_core-0.9.13.dist-info/METADATA,sha256=D3oXbr-Xj7-093QZxVTSNCjLhMnbmpgbi1CtBaK6fRM,12121
37
- ansys_pyensight_core-0.9.13.dist-info/RECORD,,
34
+ ansys_pyensight_core-0.9.15.dist-info/licenses/LICENSE,sha256=K6LiJHOa9IbWFelXmXNRzFr3zG45SOGZIN7vdLdURGU,1097
35
+ ansys_pyensight_core-0.9.15.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
36
+ ansys_pyensight_core-0.9.15.dist-info/METADATA,sha256=yYzPp1LJfYzJ__WakywsVAAV-Kpa1ZJEJ5HlTHJoamI,12121
37
+ ansys_pyensight_core-0.9.15.dist-info/RECORD,,