/ src / turtle / footprints3.scad
footprints3.scad
 1  /**
 2  * footprints3.scad
 3  *
 4  * @copyright Justin Lin, 2020
 5  * @license https://opensource.org/licenses/lgpl-3.0.html
 6  *
 7  * @see https://openhome.cc/eGossip/OpenSCAD/lib3x-footprints3.html
 8  *
 9  **/ 
10  
11  use <turtle3d.scad>
12  
13  function footprints3(cmds, start = [0, 0, 0]) = 
14      let(leng = len(cmds))
15      [start, each [
16          for(i = 0, t = turtle3d(cmds[i][0], turtle3d("create", start, [[1, 0, 0], [0, 1, 0], [0, 0, 1]]), cmds[i][1]); 
17              i < leng;
18              i = i + 1,
19              t = turtle3d(cmds[i][0], t, cmds[i][1]))
20          if(cmds[i][0] == "forward") turtle3d("pt", t)
21      ]];