1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-08 15:56:42 +02:00

add dedup

This commit is contained in:
Justin Lin
2020-03-04 10:07:01 +08:00
parent a489367eb6
commit aaddea18a7

View File

@@ -0,0 +1,7 @@
use <experimental/has.scad>;
function _dedup(src, dest, leng, i = 0) =
i == leng ? dest :
has(dest, src[i]) ? _dedup(src, dest, leng, i + 1) : _dedup(src, concat(dest, [src[i]]), leng, i + 1);
function dedup(lt) = _dedup(lt, [], len(lt));