1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-13 18:24:28 +02:00

add people param

This commit is contained in:
Justin Lin
2021-02-05 12:04:07 +08:00
parent c9b1718eab
commit 73c10c356e

View File

@@ -7,10 +7,11 @@ rows = 1;
columns = 3; columns = 3;
floors = 2; floors = 2;
up_down_rand = true; 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 // based on wang tiles, 3D version
edges = [ edges = [
for(z = [0:floors]) for(z = [0:floors])
@@ -165,6 +166,7 @@ module magic_apartment(width, rows, columns, floors, up_down_rand) {
linear_extrude(t * 3, center = true) 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); rounded_square(size = [one_third_w + double_t, one_third_w + double_t, t], corner_r = 2, center = true, $fn = 24);
if(people) {
// people // people
mirror([0, 0, up_down_rand && choose([true, false]) ? 1 : 0]) mirror([0, 0, up_down_rand && choose([true, false]) ? 1 : 0])
translate([0, 0, t * 1.5]) translate([0, 0, t * 1.5])
@@ -174,4 +176,5 @@ module magic_apartment(width, rows, columns, floors, up_down_rand) {
text(font = "Webdings", choose(symbols), size = width / 5.5, halign = "center"); text(font = "Webdings", choose(symbols), size = width / 5.5, halign = "center");
} }
} }
}
} }