ansys-pyensight-core 0.9.1__py3-none-any.whl → 0.9.3__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.

@@ -1,4 +1,5 @@
1
1
  import io
2
+ import json
2
3
  import logging
3
4
  import os
4
5
  import sys
@@ -108,6 +109,8 @@ class GLBSession(dsg_server.DSGSession):
108
109
  part_pb.ambient = 1.0
109
110
  part_pb.diffuse = 1.0
110
111
  part_pb.specular_intensity = 1.0
112
+ if "ANSYS_material_details" in mat.extensions:
113
+ part_pb.material_name = json.dumps(mat.extensions["ANSYS_material_details"])
111
114
  # if the material maps to a variable, set the variable id for coloring
112
115
  glb_varid = self._find_variable_from_glb_mat(glb_materialid)
113
116
  if glb_varid:
@@ -132,7 +135,6 @@ class GLBSession(dsg_server.DSGSession):
132
135
  """
133
136
  mesh = self._gltf.meshes[meshid]
134
137
  for prim_idx, prim in enumerate(mesh.primitives):
135
- # TODO: line width/point size
136
138
  # POINTS, LINES, TRIANGLES, LINE_LOOP, LINE_STRIP, TRIANGLE_STRIP, TRIANGLE_FAN
137
139
  mode = prim.mode
138
140
  if mode not in (
@@ -147,9 +149,7 @@ class GLBSession(dsg_server.DSGSession):
147
149
  self.warn(f"Unhandled connectivity detected: {mode}. Geometry skipped.")
148
150
  continue
149
151
  glb_materialid = prim.material
150
-
151
152
  line_width = self._callback_handler._omni.line_width
152
- # TODO: override from scene extension: ANSYS_linewidth
153
153
 
154
154
  # GLB Prim -> DSG Part
155
155
  part_name = f"{parentname}_prim{prim_idx}_"
@@ -583,7 +583,16 @@ class GLBSession(dsg_server.DSGSession):
583
583
  view_pb.fieldofview = camera.perspective.yfov
584
584
  view_pb.aspectratio = camera.aspectratio.aspectRatio
585
585
  self._handle_update_command(cmd)
586
- for node_id in self._gltf.scenes[scene_idx].nodes:
586
+ # walk the scene nodes RJF
587
+ scene = self._gltf.scenes[scene_idx]
588
+ try:
589
+ if self._callback_handler._omni.line_width == 0.0:
590
+ width = float(scene.extensions["ANSYS_linewidth"]["linewidth"])
591
+ self._callback_handler._omni.line_width = width
592
+ except (KeyError, ValueError):
593
+ # in the case where the extension does not exist or is mal-formed
594
+ pass
595
+ for node_id in scene.nodes:
587
596
  self._walk_node(node_id, view_pb.id)
588
597
  self._finish_part()
589
598
 
@@ -621,11 +630,21 @@ class GLBSession(dsg_server.DSGSession):
621
630
  List[float]
622
631
  The computed timeline.
623
632
  """
624
- # if ANSYS_scene_time is used, time ranges will come from there
625
- if "ANSYS_scene_time" in self._gltf.scenes[scene_idx].extensions:
626
- return self._gltf.scenes[scene_idx].extensions["ANSYS_scene_time"]
627
- # if there is only one scene, then use the input timeline
628
633
  num_scenes = len(self._gltf.scenes)
634
+ # if ANSYS_scene_timevalue is used, time ranges will come from there
635
+ try:
636
+ t0 = self._gltf.scenes[scene_idx].extensions["ANSYS_scene_timevalue"]["timevalue"]
637
+ idx = scene_idx + 1
638
+ if idx < num_scenes:
639
+ t1 = self._gltf.scenes[idx].extensions["ANSYS_scene_timevalue"]["timevalue"]
640
+ else:
641
+ t1 = t0
642
+ return [t0, t1]
643
+ except KeyError:
644
+ # If we fail due to dictionary key issue, the extension does not exist or is
645
+ # improperly formatted.
646
+ pass
647
+ # if there is only one scene, then use the input timeline
629
648
  if num_scenes == 1:
630
649
  return input_timeline
631
650
  # if the timeline has zero length, we make it the number of scenes
@@ -633,10 +652,13 @@ class GLBSession(dsg_server.DSGSession):
633
652
  if timeline[1] - timeline[0] <= 0.0:
634
653
  timeline = [0.0, float(num_scenes - 1)]
635
654
  # carve time into the input timeline.
636
- delta = (timeline[1] - timeline[0]) / float(num_scenes)
655
+ delta = (timeline[1] - timeline[0]) / float(num_scenes - 1)
637
656
  output: List[float] = []
638
657
  output.append(float(scene_idx) * delta + timeline[0])
639
- output.append(output[0] + delta)
658
+ if scene_idx < num_scenes - 1:
659
+ output.append(output[0] + delta)
660
+ else:
661
+ output.append(output[0])
640
662
  return output
641
663
 
642
664
  @staticmethod
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ansys-pyensight-core
3
- Version: 0.9.1
3
+ Version: 0.9.3
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>
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3.10
16
16
  Classifier: Programming Language :: Python :: 3.11
17
17
  Classifier: Programming Language :: Python :: 3.12
18
18
  Requires-Dist: importlib-metadata>=4.0; python_version<='3.8'
19
- Requires-Dist: ansys-api-pyensight==0.4.2
19
+ Requires-Dist: ansys-api-pyensight==0.4.6
20
20
  Requires-Dist: requests>=2.28.2
21
21
  Requires-Dist: docker>=6.1.0
22
22
  Requires-Dist: urllib3<3.0.0
@@ -26,6 +26,7 @@ Requires-Dist: pypng>=0.0.20
26
26
  Requires-Dist: psutil>=5.9.2
27
27
  Requires-Dist: usd-core>=24.8
28
28
  Requires-Dist: pygltflib>=1.16.2
29
+ Requires-Dist: grpcio==1.67.0
29
30
  Requires-Dist: build>=0.10.0 ; extra == "dev"
30
31
  Requires-Dist: bump2version>=1.0.1 ; extra == "dev"
31
32
  Requires-Dist: ipdb>=0.9.4 ; extra == "dev"
@@ -1,14 +1,15 @@
1
- ansys/pyensight/core/__init__.py,sha256=yF8ER4bnq8oPCdC1iyO-0Po8zg1hnmkXIooOtyz2INQ,845
2
- ansys/pyensight/core/common.py,sha256=_sB53zKEL1vmOLEFZCJthCZQbszkk48PiVKLfhNkiJI,6870
1
+ ansys/pyensight/core/__init__.py,sha256=BCfpDonS2OZRM2O6wjcyOYhLSgdy9hMQRl6G-_9Bvkg,845
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=LmgEFEjl0l3D_JaeJu5bbGR28aluHYtzb0-BmrC7ta8,28251
4
+ ansys/pyensight/core/dockerlauncher.py,sha256=Fgl9FhCNHEAvRthXed5Mo0iXjh_gj3TRxnaq6amWMMI,28443
5
+ ansys/pyensight/core/dvs.py,sha256=iPVs4ugVSlxVvhhh8Dx6mxjNHZLdivlCU7TlX_WpmLc,31545
5
6
  ansys/pyensight/core/enscontext.py,sha256=GSKkjZt1QEPyHEQ59EEBgKGMik9vjCdR9coR4uX7fEw,12141
6
7
  ansys/pyensight/core/enshell_grpc.py,sha256=-OxSdFI_p3DmQnqh1jT_a_aSh_w-EUD2IaWGKxrnyjI,17122
7
- ansys/pyensight/core/ensight_grpc.py,sha256=0_qv9gUQsWyRSGGtTW84PNNEVegtsCPrnT6oXix-hvc,16415
8
+ ansys/pyensight/core/ensight_grpc.py,sha256=IkntqzHmNzhADZ1VZJtWGpaB3ZlSThcovsbXyliW_Sk,29458
8
9
  ansys/pyensight/core/ensobj.py,sha256=uDtM2KHcAwd4hu5pcUYWbSD729ApHGIvuqZhEq8PxTI,18558
9
10
  ansys/pyensight/core/launch_ensight.py,sha256=iZJM6GdpzGRDLzrv1V2QZ5veIOpNSB5xPpJUFY7rBuo,10254
10
11
  ansys/pyensight/core/launcher.py,sha256=ymwfixwoHO7_c4qOetqccQbZjGT1HjeA7jwPi2JxlmE,10585
11
- ansys/pyensight/core/libuserd.py,sha256=JIORrVqmbjsqnT9O-FUPwq1B1-Jt-lmDKaPkrrtVHJ0,70628
12
+ ansys/pyensight/core/libuserd.py,sha256=YKXY1aaaTBT2uwcyhPEW-f93KLtCYQNMJXTlBsenWDI,75459
12
13
  ansys/pyensight/core/listobj.py,sha256=Trw87IxIMXtmUd1DzywRmMzORU704AG4scX4fqYmO6M,9340
13
14
  ansys/pyensight/core/locallauncher.py,sha256=ot05X0vj-xDqNSx-2A_RDBBuN9Fyk2dONjkkD9gtVyM,16264
14
15
  ansys/pyensight/core/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -19,10 +20,10 @@ ansys/pyensight/core/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
19
20
  ansys/pyensight/core/utils/adr.py,sha256=XslZhlwcrSGzOlnhzprOv3ju_ppxxsWBjCnQL5KiNms,3570
20
21
  ansys/pyensight/core/utils/dsg_server.py,sha256=FfiTJ7XsTW3OhI2w7PKMX5SLVoznGgZ6In-Q_wpkggE,45017
21
22
  ansys/pyensight/core/utils/export.py,sha256=UAJQcrElo3esQD0CWdxxjMQ8yE1vB4cdAhF33_uZfQw,22605
22
- ansys/pyensight/core/utils/omniverse.py,sha256=vzPAyPH0cd5fJaeVv3iNPE4shPtuamwEIavq_OBsW48,14716
23
- ansys/pyensight/core/utils/omniverse_cli.py,sha256=m5TgxHxDVVSqEY4kGss0OwV-aYHDVX076JPwKlx1fp0,20042
24
- ansys/pyensight/core/utils/omniverse_dsg_server.py,sha256=gW9uQfHmuSYS9VrwI6jkn6BxIfu3MoxUbK7QlN6Cuec,35482
25
- ansys/pyensight/core/utils/omniverse_glb_server.py,sha256=K-LLXrQsYES19ai6D8BqmxH6PjvGLIqdMVdbaSnfHQA,29118
23
+ ansys/pyensight/core/utils/omniverse.py,sha256=irghU1wcIvo_lHhZV2VxYKCSQkNWCF8njJjWfExiFgI,18455
24
+ ansys/pyensight/core/utils/omniverse_cli.py,sha256=aVYu4HsSZBl7A9_xU3DfItNB-hpxCdMPXm_oMAOU_HQ,20261
25
+ ansys/pyensight/core/utils/omniverse_dsg_server.py,sha256=q5YSFkoD_7zdlzv7zrEQmmIq3pXcNjOWbQShTQIcqVo,38519
26
+ ansys/pyensight/core/utils/omniverse_glb_server.py,sha256=aWAsGTxSl0w6VYRXCx8FaKGlLtfii2OUm_wBmP2Ay0I,30100
26
27
  ansys/pyensight/core/utils/parts.py,sha256=222XFRCjLgH7hho-cK9JrGCg3-KlTf54KIgc7y50sTE,52173
27
28
  ansys/pyensight/core/utils/query.py,sha256=OXKDbf1sOTX0sUvtKcp64LhVl-BcrEsE43w8uMxLOYI,19828
28
29
  ansys/pyensight/core/utils/readers.py,sha256=cNNzrE5pjy4wpQKWAzIIJfJCSpY3HU43az02f5I3pVU,11968
@@ -30,7 +31,7 @@ ansys/pyensight/core/utils/support.py,sha256=QI3z9ex7zJxjFbkCPba9DWqWgPFIThORqr0
30
31
  ansys/pyensight/core/utils/variables.py,sha256=ZUiJdDIeRcowrnLXaJQqGwA0RbrfXhc1s4o4v9A4PiY,95133
31
32
  ansys/pyensight/core/utils/views.py,sha256=ZKhJ6vMT7Rdd4bwJ0egMYTV7-D7Q7I19fF2_j_CMQ0o,12489
32
33
  ansys/pyensight/core/utils/resources/Materials/000_sky.exr,sha256=xAR1gFd2uxPZDnvgfegdhEhRaqKtZldQDiR_-1rHKO0,8819933
33
- ansys_pyensight_core-0.9.1.dist-info/LICENSE,sha256=qQWivZ12ETN5l3QxvTARY-QI5eoRRlyHdwLlAj0Bg5I,1089
34
- ansys_pyensight_core-0.9.1.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
35
- ansys_pyensight_core-0.9.1.dist-info/METADATA,sha256=wnkwJoIFTKw7ZiJTeN2_w54IN8wLj2VVO-gF6TfjXVI,12113
36
- ansys_pyensight_core-0.9.1.dist-info/RECORD,,
34
+ ansys_pyensight_core-0.9.3.dist-info/LICENSE,sha256=qQWivZ12ETN5l3QxvTARY-QI5eoRRlyHdwLlAj0Bg5I,1089
35
+ ansys_pyensight_core-0.9.3.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
36
+ ansys_pyensight_core-0.9.3.dist-info/METADATA,sha256=gg7LkGtkjcypPJ7sl-xNCT-lh-k0V8tWZzC9yLKIhoI,12143
37
+ ansys_pyensight_core-0.9.3.dist-info/RECORD,,