From 73c10c356ea3e2ac9c6315971ce55c99eb9d4f98 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Fri, 5 Feb 2021 12:04:07 +0800 Subject: [PATCH] add people param --- examples/tiles/magic_apartment.scad | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/examples/tiles/magic_apartment.scad b/examples/tiles/magic_apartment.scad index 67c8ef56..0f793e95 100644 --- a/examples/tiles/magic_apartment.scad +++ b/examples/tiles/magic_apartment.scad @@ -7,10 +7,11 @@ rows = 1; columns = 3; floors = 2; up_down_rand = true; +people = true; -magic_apartment(width, rows, columns, floors, up_down_rand); +magic_apartment(width, rows, columns, floors, up_down_rand, people); -module magic_apartment(width, rows, columns, floors, up_down_rand) { +module magic_apartment(width, rows, columns, floors, up_down_rand, people) { // based on wang tiles, 3D version edges = [ for(z = [0:floors]) @@ -165,13 +166,15 @@ module magic_apartment(width, rows, columns, floors, up_down_rand) { linear_extrude(t * 3, center = true) rounded_square(size = [one_third_w + double_t, one_third_w + double_t, t], corner_r = 2, center = true, $fn = 24); - // people - mirror([0, 0, up_down_rand && choose([true, false]) ? 1 : 0]) - translate([0, 0, t * 1.5]) - rotate([90, 0, rand(0, 359)]) - linear_extrude(half_t) - scale([1, 2]) - text(font = "Webdings", choose(symbols), size = width / 5.5, halign = "center"); + if(people) { + // people + mirror([0, 0, up_down_rand && choose([true, false]) ? 1 : 0]) + translate([0, 0, t * 1.5]) + rotate([90, 0, rand(0, 359)]) + linear_extrude(half_t) + scale([1, 2]) + text(font = "Webdings", choose(symbols), size = width / 5.5, halign = "center"); + } } } } \ No newline at end of file