1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-12 09:44:16 +02:00
This commit is contained in:
Justin Lin
2022-04-03 14:16:17 +08:00
parent fb4a626707
commit 8ce96f9128
5 changed files with 66 additions and 75 deletions

View File

@@ -18,8 +18,7 @@ module noisy_circle_maze(r_cells, cell_width, wall_thickness, origin_offset, noi
noisy_f = is_undef(noisy_factor) ? 1 : noisy_factor;
half_wall_thickness = wall_thickness / 2;
seed = rand(0, 256);
for(wall = walls) {
for(i = [0:len(wall) - 2]) {
for(wall = walls, i = [0:len(wall) - 2]) {
p0 = ptf_circle(rect_size, wall[i]);
p1 = ptf_circle(rect_size, wall[i + 1]);
pn00 = nz_perlin2(p0[0], p0[1], seed) * noisy_f;
@@ -30,7 +29,6 @@ module noisy_circle_maze(r_cells, cell_width, wall_thickness, origin_offset, noi
circle(half_wall_thickness);
}
}
}
noisy_circle_maze(
r_cells = 8,

View File

@@ -10,13 +10,11 @@ module pyramid_hex_maze(columns, cell_radius, wall_thickness) {
module bottom(rows, columns, cell_radius, wall_thickness) {
grid_h = 2 * cell_radius * sin(60);
grid_w = cell_radius + cell_radius * cos(60);
for(x_cell = [0:columns - 1]) {
for(y_cell = [0:rows - 1]) {
for(x_cell = [0:columns - 1], (y_cell = [0:rows - 1]) {
translate([grid_w * x_cell, grid_h * y_cell + (x_cell % 2 == 0 ? 0 : grid_h / 2), 0])
circle(cell_radius + wall_thickness, $fn = 6);
}
}
}
rows = round(0.866 * columns - 0.211);

View File

@@ -52,7 +52,7 @@ module regular_polygon_maze(radius, ccells, levels, thickness = 1, sides) {
cells = mz_square(ccells, levels, y_wrapping = true);
difference() {
render() union() {
union() {
for(i = [1 : levels + 1]) {
ring_regular_polygon(r * i, thickness, sides);
}
@@ -70,7 +70,7 @@ module regular_polygon_maze(radius, ccells, levels, thickness = 1, sides) {
}
}
render() union() {
union() {
// maze entry
// ring_regular_polygon_sector(r, arc_angle / 1.975 , thickness, r / 3, sides);

View File

@@ -44,9 +44,7 @@ module rock_theta_maze(rings, begining_columns, cell_width, rock_size, height_sc
scale([1, 1, height_scale])
difference() {
union() {
for(rings = maze) {
for(cell = rings) {
for(rings = maze, cell = rings) {
ri = mz_theta_get(cell, "r");
ci = mz_theta_get(cell, "c");
if([ri, ci] != [0, 0]) {
@@ -70,7 +68,6 @@ module rock_theta_maze(rings, begining_columns, cell_width, rock_size, height_sc
}
}
}
}
thetaStep = 360 / len(maze[rings - 1]);
r = cell_width * (rings + 1);

View File

@@ -18,8 +18,7 @@ module theta_maze(rings, beginning_number, cell_width, wall_thickness, wall_heig
half_wall_thickness = wall_thickness / 2;
linear_extrude(wall_height) {
for(rings = maze) {
for(cell = rings) {
for(rings = maze, cell = rings) {
ri = mz_theta_get(cell, "r");
ci = mz_theta_get(cell, "c");
wallType = mz_theta_get(cell, "t");
@@ -43,7 +42,6 @@ module theta_maze(rings, beginning_number, cell_width, wall_thickness, wall_heig
circle(half_wall_thickness);
}
}
}
thetaStep = 360 / len(maze[rings - 1]);
r = cell_width * (rings + 1);