Skip to content

Commit 93a6f84

Browse files
author
David Berger
committed
fix(vtkClipClosedSurface): Fix stack overflow when inputPolys.getCellSizes() is too big
1 parent 2171b20 commit 93a6f84

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)