mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-17 12:10:47 +02:00
move modules into regular_polygon_maze
This commit is contained in:
@@ -10,11 +10,6 @@ levels = 3;
|
|||||||
sides = 6; // [3:24]
|
sides = 6; // [3:24]
|
||||||
bottom = "NO"; // [YES,NO]
|
bottom = "NO"; // [YES,NO]
|
||||||
|
|
||||||
// give a [x, y] point and length. draw a line in the x direction
|
|
||||||
module x_line(point, length, thickness = 1) {
|
|
||||||
line2d(point, point + [0, length], width = thickness);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* constants, for clearness
|
* constants, for clearness
|
||||||
*
|
*
|
||||||
@@ -151,7 +146,20 @@ function build_wall(i, j, n, rows, columns, maze_vector) =
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
module ring_regular_polygon_sector(radius, angle, thickness, width, sides) {
|
|
||||||
|
module regular_polygon_maze(radius, cblocks, levels, thickness = 1, sides) {
|
||||||
|
full_circle_angle = 360;
|
||||||
|
arc_angle = full_circle_angle / cblocks;
|
||||||
|
r = radius / (levels + 1);
|
||||||
|
|
||||||
|
maze = go_maze(1, 1, cblocks, levels, replace([levels, cblocks - 1, 0, UP_RIGHT_WALL()], [levels, cblocks - 1, 0, UP_WALL()], init_maze(cblocks, levels)));
|
||||||
|
|
||||||
|
// give a [x, y] point and length. draw a line in the x direction
|
||||||
|
module x_line(point, length, thickness = 1) {
|
||||||
|
line2d(point, point + [0, length], width = thickness);
|
||||||
|
}
|
||||||
|
|
||||||
|
module ring_regular_polygon_sector(radius, angle, thickness, width, sides) {
|
||||||
intersection() {
|
intersection() {
|
||||||
arc(
|
arc(
|
||||||
radius = radius - 0.1,
|
radius = radius - 0.1,
|
||||||
@@ -163,24 +171,16 @@ module ring_regular_polygon_sector(radius, angle, thickness, width, sides) {
|
|||||||
|
|
||||||
rotate([0, 0, angle]) x_line([0, 0], radius * 3, width);
|
rotate([0, 0, angle]) x_line([0, 0], radius * 3, width);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module regular_polygon_to_polygon_wall(radius, length, angle, thickness, sides) {
|
module regular_polygon_to_polygon_wall(radius, length, angle, thickness, sides) {
|
||||||
intersection() {
|
intersection() {
|
||||||
hollow_out(shell_thickness = length)
|
hollow_out(shell_thickness = length)
|
||||||
circle(r = radius + length, $fn = sides);
|
circle(r = radius + length, $fn = sides);
|
||||||
rotate([0, 0, angle])
|
rotate([0, 0, angle])
|
||||||
x_line([0, 0], (radius + length) * 2, thickness);
|
x_line([0, 0], (radius + length) * 2, thickness);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module regular_polygon_maze(radius, cblocks, levels, thickness = 1, sides) {
|
|
||||||
full_circle_angle = 360;
|
|
||||||
arc_angle = full_circle_angle / cblocks;
|
|
||||||
r = radius / (levels + 1);
|
|
||||||
|
|
||||||
maze = go_maze(1, 1, cblocks, levels, replace([levels, cblocks - 1, 0, UP_RIGHT_WALL()], [levels, cblocks - 1, 0, UP_WALL()], init_maze(cblocks, levels)));
|
|
||||||
|
|
||||||
|
|
||||||
difference() {
|
difference() {
|
||||||
union() {
|
union() {
|
||||||
|
Reference in New Issue
Block a user