diff --git a/doc/changelog.d/281.fixed.md b/doc/changelog.d/281.fixed.md new file mode 100644 index 00000000..062cdcda --- /dev/null +++ b/doc/changelog.d/281.fixed.md @@ -0,0 +1 @@ +fix: pyvista read-only behaviour \ No newline at end of file diff --git a/src/ansys/tools/visualization_interface/backends/pyvista/pyvista_interface.py b/src/ansys/tools/visualization_interface/backends/pyvista/pyvista_interface.py index 7fe32b7e..3a67d35b 100644 --- a/src/ansys/tools/visualization_interface/backends/pyvista/pyvista_interface.py +++ b/src/ansys/tools/visualization_interface/backends/pyvista/pyvista_interface.py @@ -180,7 +180,11 @@ def clip( Clipped mesh. """ - return mesh.clip(normal=plane.normal, origin=plane.origin) + # Make sure to pass new copies/objects to the mesh for the normal + # This should be fixed by PyVista eventually... it is coming from + # https://github.com/pyvista/pyvista/commit/2db1888a294a14e4f28a140d8aa0466d332912dc + return mesh.clip(normal=[elem for elem in plane.normal], + origin=plane.origin) def plot_meshobject(self, custom_object: MeshObjectPlot, **plotting_options): """Plot a generic ``MeshObjectPlot`` object to the scene.