mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-23 06:43:10 +02:00
refactor
This commit is contained in:
@@ -79,7 +79,7 @@ function gyroid_points(pp, w)=
|
|||||||
let(wall=(k==0 || k==2*j || j==pp) ? 0 : i)
|
let(wall=(k==0 || k==2*j || j==pp) ? 0 : i)
|
||||||
wall_gyroid(p_xy.x,p_xy.y,gyroid_point(x=p_xy.x, y=p_xy.y),wall) // calculate point in row, line within gyroid wall
|
wall_gyroid(p_xy.x,p_xy.y,gyroid_point(x=p_xy.x, y=p_xy.y),wall) // calculate point in row, line within gyroid wall
|
||||||
]) // matrix of points for all primitives of a gyroid micro cell
|
]) // matrix of points for all primitives of a gyroid micro cell
|
||||||
[ [for(i=p) i], // copy of p
|
[ p, // copy of p
|
||||||
[for(i=p) [180,180,180]-i], // diagonally oposing part of p
|
[for(i=p) [180,180,180]-i], // diagonally oposing part of p
|
||||||
[for(i=p) [i.y,i.z,i.x]], // first cyclic permutation of coordinates
|
[for(i=p) [i.y,i.z,i.x]], // first cyclic permutation of coordinates
|
||||||
[for(i=p) [180-i.y,180-i.z,180-i.x]], // diagonally oposing part of permutation
|
[for(i=p) [180-i.y,180-i.z,180-i.x]], // diagonally oposing part of permutation
|
||||||
|
@@ -9,7 +9,7 @@ module gyroid(detail, thickness, period) {
|
|||||||
|
|
||||||
points_lt = gyroid_points(pp = pp, w = w);
|
points_lt = gyroid_points(pp = pp, w = w);
|
||||||
range = [0:len(points_lt) - 1];
|
range = [0:len(points_lt) - 1];
|
||||||
faces_lt = [ for(i = range) (i % 2 == 0) ? fi : f];
|
faces_lt = [for(i = range) (i % 2 == 0) ? fi : f];
|
||||||
|
|
||||||
module cell() {
|
module cell() {
|
||||||
gyroid_cell()
|
gyroid_cell()
|
||||||
@@ -18,13 +18,9 @@ module gyroid(detail, thickness, period) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(z = [0:period.z - 1]) {
|
for(z = [0:period.z - 1], y = [0:period.y - 1], x = [0:period.x - 1]) {
|
||||||
for(y = [0:period.y - 1]) {
|
translate([x, y, z] * 360)
|
||||||
for(x = [0:period.x - 1]) {
|
cell();
|
||||||
translate([x, y, z] * 360)
|
|
||||||
cell();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user