1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00

add m_cumulate

This commit is contained in:
Justin Lin 2019-05-03 09:14:14 +08:00
parent 3603b92258
commit 4fe79dc568

10
src/m_cumulate.scad Normal file
View File

@ -0,0 +1,10 @@
include <__private__/__m_multiply.scad>;
function _m_cumulate(matrice, i) =
i == len(matrice) - 2 ?
__m_multiply(matrice[i], matrice[i + 1]) :
__m_multiply(matrice[i], _m_cumulate(matrice, i + 1));
function m_cumulate(matrice) =
len(matrice) == 1 ? matrice[0] : _m_cumulate(matrice, 0);