gyroid.scad
1 use <_impl/Gyroid3.scad> 2 3 module gyroid(detail, thickness, period) { 4 pp = 2 + detail; 5 w = thickness; 6 7 f = gyroid_faces(pp = pp); 8 fi = swap_xy(m = f); 9 10 points_lt = gyroid_points(pp = pp, w = w); 11 range = [0:len(points_lt) - 1]; 12 faces_lt = [for(i = range) (i % 2 == 0) ? fi : f]; 13 14 module cell() { 15 gyroid_cell() 16 for(i = range) { 17 polyhedron(points_lt[i], faces_lt[i]); 18 } 19 } 20 21 for(z = [0:period.z - 1], y = [0:period.y - 1], x = [0:period.x - 1]) { 22 translate([x, y, z] * 360) 23 cell(); 24 } 25 } 26 27 // detail = 10; 28 // thickness = 20; 29 // period = [2, 2, 2]; 30 31 // gyroid(detail, thickness, period);