From f0e43766db11c29cd1c296b24c56c405bbf162ca Mon Sep 17 00:00:00 2001 From: Alex Fernandez <21alex295@gmail.com> Date: Tue, 1 Oct 2024 11:13:22 +0200 Subject: [PATCH] fix: PyVista deprecation (#899) Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> --- doc/changelog.d/899.fixed.md | 1 + src/ansys/meshing/prime/core/mesh.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 doc/changelog.d/899.fixed.md diff --git a/doc/changelog.d/899.fixed.md b/doc/changelog.d/899.fixed.md new file mode 100644 index 0000000000..7cd14af24c --- /dev/null +++ b/doc/changelog.d/899.fixed.md @@ -0,0 +1 @@ +fix: PyVista deprecation \ No newline at end of file diff --git a/src/ansys/meshing/prime/core/mesh.py b/src/ansys/meshing/prime/core/mesh.py index 78231f04cc..beedb5007e 100644 --- a/src/ansys/meshing/prime/core/mesh.py +++ b/src/ansys/meshing/prime/core/mesh.py @@ -325,7 +325,7 @@ def get_face_polydata( vertices, faces = self._get_vertices_and_surf_faces(face_facet_res, index) surf = pv.PolyData(vertices, faces) fcolor = np.array(self.get_face_color(part, ColorByType.ZONE)) - colors = np.tile(fcolor, (surf.n_faces, 1)) + colors = np.tile(fcolor, (surf.n_faces_strict, 1)) surf["colors"] = colors surf.disp_mesh = self has_mesh = True @@ -415,7 +415,7 @@ def get_spline_cp_polydata(self, part_id: int, spline_id: int) -> MeshObjectPlot faces = self.compute_face_list_from_structured_nodes(dim) surf = pv.PolyData(vertices, faces) fcolor = np.array([0, 0, 255]) - colors = np.tile(fcolor, (surf.n_faces, 1)) + colors = np.tile(fcolor, (surf.n_faces_strict, 1)) surf["colors"] = colors surf.disp_mesh = self if surf.n_points > 0: @@ -443,7 +443,7 @@ def get_spline_surface_polydata(self, part_id: int, spline_id: int) -> MeshObjec faces = self.compute_face_list_from_structured_nodes(dim) surf = pv.PolyData(vertices, faces) fcolor = np.array(color_matrix[1]) - colors = np.tile(fcolor, (surf.n_faces, 1)) + colors = np.tile(fcolor, (surf.n_faces_strict, 1)) surf["colors"] = colors surf.disp_mesh = self if surf.n_points > 0: