1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-06 06:47:46 +02:00
This commit is contained in:
Justin Lin
2020-02-18 20:41:59 +08:00
parent 771edcf831
commit ed6fafd0fc

View File

@@ -3,6 +3,7 @@ use <hollow_out.scad>;
use <ellipse_extrude.scad>; use <ellipse_extrude.scad>;
use <arc.scad>; use <arc.scad>;
use <experimental/mz_blocks.scad>; use <experimental/mz_blocks.scad>;
use <experimental/mz_get.scad>;
radius_of_heart = 12; radius_of_heart = 12;
height_of_heart = 25; height_of_heart = 25;
@@ -58,20 +59,14 @@ module heart_to_heart_wall(radius, length, angle, thickness) {
} }
module heart_maze(maze, radius, cblocks, levels, thickness = 1) { module heart_maze(maze, radius, cblocks, levels, thickness = 1) {
// NO_WALL = 0; function no_wall(block) = get_wall_type(block) == "NO_WALL";
// UPPER_WALL = 1; function upper_wall(block) = get_wall_type(block) == "UPPER_WALL";
// RIGHT_WALL = 2; function right_wall(block) = get_wall_type(block) == "RIGHT_WALL";
// UPPER_RIGHT_WALL = 3; function upper_right_wall(block) = get_wall_type(block) == "UPPER_RIGHT_WALL";
function no_wall(block) = get_wall_type(block) == 0; function get_x(block) = mz_get(block, "x");
function upper_wall(block) = get_wall_type(block) == 1; function get_y(block) = mz_get(block, "y");
function right_wall(block) = get_wall_type(block) == 2; function get_wall_type(block) = mz_get(block, "w");
function upper_right_wall(block) = get_wall_type(block) == 3;
function block(x, y, wall_type, visited) = [x, y, wall_type, visited];
function get_x(block) = block[0];
function get_y(block) = block[1];
function get_wall_type(block) = block[2];
arc_angle = 360 / cblocks; arc_angle = 360 / cblocks;
r = radius / (levels + 1); r = radius / (levels + 1);