1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-22 22:35:18 +02:00
This commit is contained in:
Justin Lin
2022-03-12 08:37:38 +08:00
parent c76766f5b4
commit da4342441f
2 changed files with 5 additions and 9 deletions

View File

@@ -79,7 +79,7 @@ function gyroid_points(pp, w)=
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
]) // 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) [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

View File

@@ -9,7 +9,7 @@ module gyroid(detail, thickness, period) {
points_lt = gyroid_points(pp = pp, w = w);
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() {
gyroid_cell()
@@ -18,13 +18,9 @@ module gyroid(detail, thickness, period) {
}
}
for(z = [0:period.z - 1]) {
for(y = [0:period.y - 1]) {
for(x = [0:period.x - 1]) {
translate([x, y, z] * 360)
cell();
}
}
for(z = [0:period.z - 1], y = [0:period.y - 1], x = [0:period.x - 1]) {
translate([x, y, z] * 360)
cell();
}
}