1
0
mirror of https://github.com/Irev-Dev/Round-Anything.git synced 2025-01-29 08:57:39 +01:00

Correctly instanciate recursion index

Caller of the flatternRecursion method does not set necessarily the index value and OpenSCAD complain that this result in adding number to undefined.
This commit is contained in:
Damien Martin-Guillerez 2021-05-02 11:43:31 +02:00 committed by GitHub
parent c04a81f25c
commit 26fb282626
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,7 +90,7 @@ let(
)
[polyhedronPoints, polyhedronFaces, layerLength];
function flatternRecursion(array, init=[], currentIndex)=
function flatternRecursion(array, init=[], currentIndex=0)=
// this is a private function, init and currentIndex are for the function's use
// only for when it's calling itself, which is why there is a simplified version flatternArray that just calls this one
// array= array to flattern by one level of nesting