From a9e14f5dc228b5eefdf7a85b7dfc09723b50782f Mon Sep 17 00:00:00 2001 From: PozzettiAndrea Date: Fri, 14 Aug 2026 13:35:17 +0200 Subject: [PATCH] VTK viewer: restore Surface after a point cloud forces Points mode Loading a point cloud correctly locks the shared actor to Points representation, but the surface-mesh branch of the LOAD_MESH handler never reset it -- so navigating from a point cloud back to a surface mesh (e.g. scrolling a batch) left the mesh stuck rendering as points until you manually picked Surface in settings. Fix: in the non-point-cloud branch, restore property.setRepresentation to the user's chosen mode (currentSettings.representation, default Surface). Point clouds still switch to Points; switching back now returns to the chosen mode. --- javascript/viewer_vtk.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/javascript/viewer_vtk.html b/javascript/viewer_vtk.html index 13f0a817..99f124e6 100644 --- a/javascript/viewer_vtk.html +++ b/javascript/viewer_vtk.html @@ -384,6 +384,12 @@ const filteredPolyData = normalsFilter.getOutputData(); mapper.setInputData(filteredPolyData); currentPolyData = filteredPolyData; // Update reference for field visualization + + // Restore the user's chosen representation (default Surface). + // A point cloud forces Points mode on the shared actor property; + // without this, a surface mesh loaded right after a point cloud + // would stay stuck rendering as points. + property.setRepresentation(currentSettings.representation); } mapper.update();