From 0cbc72eb4dadd89b9fa06fb2f30484ffa5aa31d9 Mon Sep 17 00:00:00 2001 From: Spiros Tsalikis Date: Sun, 6 Apr 2025 22:42:52 -0400 Subject: [PATCH] Clip: Fix edgeInterpolationIndexToUnique creation bug This is the correct order: 1. Copy the existing edges (which include duplicates) 2. Sort the copies edges 3. Remove the duplicate edges from the copied edges so that they are unique 4. Create a edgeInterpolationIndexToUnique map by querying each edge (including duplicates) and find the which unique id they have by looking into the unique copied edges --- vtkm/filter/contour/worklet/Clip.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vtkm/filter/contour/worklet/Clip.h b/vtkm/filter/contour/worklet/Clip.h index 4622804897..67c9fd3a26 100644 --- a/vtkm/filter/contour/worklet/Clip.h +++ b/vtkm/filter/contour/worklet/Clip.h @@ -678,10 +678,10 @@ public: // Release batchesWithClippedCellsMask since it's no longer needed. batchesWithClippedCellsMask.ReleaseResources(); - // Sort the edge interpolations. - vtkm::cont::Algorithm::Sort(edgeInterpolation, EdgeInterpolation::LessThanOp()); // Copy the edge interpolations to the output. vtkm::cont::Algorithm::Copy(edgeInterpolation, this->EdgePointsInterpolation); + // Sort the edge interpolations. + vtkm::cont::Algorithm::Sort(this->EdgePointsInterpolation, EdgeInterpolation::LessThanOp()); // Remove duplicates. vtkm::cont::Algorithm::Unique(this->EdgePointsInterpolation, EdgeInterpolation::EqualToOp()); // Get the edge index to unique index. -- GitLab