Skip to content

Commit 62e5140

Browse files
authored
Merge pull request #2551 from DavidBerger98/fix-stackoverflow-clipclosedsurface
fix(vtkClipClosedSurface): Fix stack overflow when inputPolys.getCellSizes() is too big
2 parents 2171b20 + 93a6f84 commit 62e5140

File tree

1 file changed

+1
-2
lines changed
  • Sources/Filters/General/ClipClosedSurface

1 file changed

+1
-2
lines changed

Sources/Filters/General/ClipClosedSurface/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -799,8 +799,7 @@ function vtkClipClosedSurface(publicAPI, model) {
799799
);
800800

801801
// Check if the input has polys and quads or just triangles
802-
// TODO: Improve performance
803-
polyMax = Math.max(...inputPolys.getCellSizes());
802+
polyMax = inputPolys.getCellSizes().reduce((a, b) => (a > b ? a : b), 0);
804803
}
805804

806805
// Arrays for storing the clipped lines and polys

0 commit comments

Comments
 (0)