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:
parent
3603b92258
commit
4fe79dc568
10
src/m_cumulate.scad
Normal file
10
src/m_cumulate.scad
Normal 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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user