1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-31 10:11:53 +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,31 +18,29 @@ 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) {
ri = mz_theta_get(cell, "r");
ci = mz_theta_get(cell, "c");
wallType = mz_theta_get(cell, "t");
thetaStep = 360 / len(maze[ri]);
innerR = (ri + 1) * cell_width;
outerR = (ri + 2) * cell_width;
theta1 = thetaStep * ci;
theta2 = thetaStep * (ci + 1);
innerVt1 = vt_from_angle(theta1, innerR);
innerVt2 = vt_from_angle(theta2, innerR);
outerVt2 = vt_from_angle(theta2, outerR);
if(wallType == "INWARD_WALL" || wallType == "INWARD_CCW_WALL") {
polyline_join([innerVt1, innerVt2])
circle(half_wall_thickness);
}
for(rings = maze, cell = rings) {
ri = mz_theta_get(cell, "r");
ci = mz_theta_get(cell, "c");
wallType = mz_theta_get(cell, "t");
thetaStep = 360 / len(maze[ri]);
innerR = (ri + 1) * cell_width;
outerR = (ri + 2) * cell_width;
theta1 = thetaStep * ci;
theta2 = thetaStep * (ci + 1);
innerVt1 = vt_from_angle(theta1, innerR);
innerVt2 = vt_from_angle(theta2, innerR);
outerVt2 = vt_from_angle(theta2, outerR);
if(wallType == "INWARD_WALL" || wallType == "INWARD_CCW_WALL") {
polyline_join([innerVt1, innerVt2])
circle(half_wall_thickness);
}
if(wallType == "CCW_WALL" || wallType == "INWARD_CCW_WALL") {
polyline_join([innerVt2, outerVt2])
circle(half_wall_thickness);
}
}
if(wallType == "CCW_WALL" || wallType == "INWARD_CCW_WALL") {
polyline_join([innerVt2, outerVt2])
circle(half_wall_thickness);
}
}
thetaStep = 360 / len(maze[rings - 1]);