ansys-pyensight-core 0.10.8__tar.gz → 0.10.9__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.

Files changed (37) hide show
  1. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/PKG-INFO +1 -1
  2. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/pyproject.toml +1 -1
  3. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/utils/views.py +39 -10
  4. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/LICENSE +0 -0
  5. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/README.rst +0 -0
  6. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/__init__.py +0 -0
  7. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/common.py +0 -0
  8. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/deep_pixel_view.html +0 -0
  9. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/dockerlauncher.py +0 -0
  10. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/dvs.py +0 -0
  11. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/enscontext.py +0 -0
  12. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/enshell_grpc.py +0 -0
  13. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/ensight_grpc.py +0 -0
  14. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/ensobj.py +0 -0
  15. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/launch_ensight.py +0 -0
  16. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/launcher.py +0 -0
  17. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/libuserd.py +0 -0
  18. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/listobj.py +0 -0
  19. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/locallauncher.py +0 -0
  20. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/py.typed +0 -0
  21. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/renderable.py +0 -0
  22. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/session.py +0 -0
  23. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/sgeo_poll.html +0 -0
  24. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/utils/__init__.py +0 -0
  25. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/utils/adr.py +0 -0
  26. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/utils/dsg_server.py +0 -0
  27. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/utils/export.py +0 -0
  28. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/utils/omniverse.py +0 -0
  29. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/utils/omniverse_cli.py +0 -0
  30. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/utils/omniverse_dsg_server.py +0 -0
  31. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/utils/omniverse_glb_server.py +0 -0
  32. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/utils/parts.py +0 -0
  33. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/utils/query.py +0 -0
  34. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/utils/readers.py +0 -0
  35. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/utils/resources/Materials/000_sky.exr +0 -0
  36. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/utils/support.py +0 -0
  37. {ansys_pyensight_core-0.10.8 → ansys_pyensight_core-0.10.9}/src/ansys/pyensight/core/utils/variables.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ansys-pyensight-core
3
- Version: 0.10.8
3
+ Version: 0.10.9
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>
@@ -6,7 +6,7 @@ build-backend = "flit_core.buildapi"
6
6
 
7
7
  [project]
8
8
  name = "ansys-pyensight-core"
9
- version = "0.10.8"
9
+ version = "0.10.9"
10
10
  description = "A python wrapper for Ansys EnSight"
11
11
  readme = "README.rst"
12
12
  requires-python = ">=3.10,<3.14"
@@ -209,7 +209,7 @@ class _Simba:
209
209
  return camera_position, focal_point, self.views._normalize_vector(view_up), parallel_scale
210
210
 
211
211
  def set_camera(
212
- self, orthographic, view_up=None, position=None, focal_point=None, view_angle=None
212
+ self, orthographic, view_up=None, position=None, focal_point=None, view_angle=None, pan=None
213
213
  ):
214
214
  """Set the EnSight camera settings from the VTK input."""
215
215
  self.ensight.view_transf.function("global")
@@ -221,15 +221,18 @@ class _Simba:
221
221
  vport.PERSPECTIVEANGLE = view_angle / 2
222
222
 
223
223
  if view_up and position and focal_point:
224
- q_current = self.normalize(np.array(vport.ROTATION.copy()))
225
- q_target = self.normalize(
226
- self.compute_model_rotation_quaternion(position, focal_point, view_up)
227
- )
228
- q_relative = self.quaternion_multiply(
229
- q_target, np.array([-q_current[0], -q_current[1], -q_current[2], q_current[3]])
230
- )
231
- angles = self.quaternion_to_euler(q_relative)
232
- self.ensight.view_transf.rotate(*angles)
224
+ if not pan:
225
+ q_current = self.normalize(np.array(vport.ROTATION.copy()))
226
+ q_target = self.normalize(
227
+ self.compute_model_rotation_quaternion(position, focal_point, view_up)
228
+ )
229
+ q_relative = self.quaternion_multiply(
230
+ q_target, np.array([-q_current[0], -q_current[1], -q_current[2], q_current[3]])
231
+ )
232
+ angles = self.quaternion_to_euler(q_relative)
233
+ self.ensight.view_transf.rotate(*angles)
234
+ else:
235
+ self.ensight.view_transf.translate(*pan)
233
236
  self.render()
234
237
 
235
238
  def set_perspective(self, value):
@@ -257,9 +260,35 @@ class _Simba:
257
260
  return {"model_point": model_point, "camera": self.get_camera()}
258
261
 
259
262
  def render(self):
263
+ """Force render update in EnSight."""
264
+ self.ensight.view_transf.zoom(1)
260
265
  self.ensight.render()
261
266
  self.ensight.refresh(1)
262
267
 
268
+ def drag_allowed(self, mousex, mousey, invert_y=False):
269
+ """Return True if the picked object is allowed dragging in the interactor."""
270
+ mousex = int(mousex)
271
+ mousey = int(mousey)
272
+ if isinstance(self.ensight, ModuleType):
273
+ part_id, tool_id = self.ensight.objs.core.VPORTS[0].simba_what_is_picked(
274
+ mousex, mousey, invert_y
275
+ )
276
+ else:
277
+ part_id, tool_id = self.ensight._session.cmd(
278
+ f"ensight.objs.core.VPORTS[0].simba_what_is_picked({mousex}, {mousey}, {invert_y})"
279
+ )
280
+ if tool_id > -1:
281
+ return True
282
+ part_types_allowed = [
283
+ self.ensight.objs.enums.PART_CLIP_PLANE,
284
+ self.ensight.objs.enums.PART_ISO_SURFACE,
285
+ self.ensight.objs.enums.PART_CONTOUR,
286
+ ]
287
+ if part_id > -1:
288
+ part_obj = self.ensight.objs.core.PARTS.find(part_id, "PARTNUMBER")[0]
289
+ return part_obj.PARTTYPE in part_types_allowed
290
+ return False
291
+
263
292
 
264
293
  class Views:
265
294
  """Controls the view in the current EnSight ``Session`` instance."""