mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-01 20:40:28 +02:00
refactor
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
use <experimental/tile_w2e.scad>;
|
use <experimental/tile_w2e.scad>;
|
||||||
|
use <experimental/choose_children.scad>;
|
||||||
use <arc.scad>;
|
use <arc.scad>;
|
||||||
|
|
||||||
size = [15, 10];
|
size = [15, 10];
|
||||||
@@ -124,11 +125,7 @@ module path_tile(n, width) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module select_child(n) {
|
choose_children(n) {
|
||||||
children(n);
|
|
||||||
}
|
|
||||||
|
|
||||||
select_child(n) {
|
|
||||||
square(width, center = true);
|
square(width, center = true);
|
||||||
tile1();
|
tile1();
|
||||||
rotate(-90) tile1();
|
rotate(-90) tile1();
|
||||||
|
@@ -4,6 +4,7 @@ use <arc.scad>;
|
|||||||
use <shear.scad>;
|
use <shear.scad>;
|
||||||
use <util/rand.scad>;
|
use <util/rand.scad>;
|
||||||
use <experimental/tile_w2e.scad>;
|
use <experimental/tile_w2e.scad>;
|
||||||
|
use <experimental/choose_children.scad>;
|
||||||
|
|
||||||
mask = [
|
mask = [
|
||||||
[0, 1, 1, 0, 0, 0, 1, 1, 0],
|
[0, 1, 1, 0, 0, 0, 1, 1, 0],
|
||||||
@@ -25,16 +26,12 @@ random_city(rows, columns, mask);
|
|||||||
module random_city(rows, columns, mask) {
|
module random_city(rows, columns, mask) {
|
||||||
tile_width = 30;
|
tile_width = 30;
|
||||||
|
|
||||||
module select_child(n) {
|
|
||||||
children(n);
|
|
||||||
}
|
|
||||||
|
|
||||||
for(tile = tile_w2e([columns, rows], mask)) {
|
for(tile = tile_w2e([columns, rows], mask)) {
|
||||||
x = tile[0];
|
x = tile[0];
|
||||||
y = tile[1];
|
y = tile[1];
|
||||||
i = tile[2];
|
i = tile[2];
|
||||||
translate([x, y] * tile_width)
|
translate([x, y] * tile_width)
|
||||||
select_child(i) {
|
choose_children(i) {
|
||||||
tile00();
|
tile00();
|
||||||
tile01();
|
tile01();
|
||||||
tile02();
|
tile02();
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
use <experimental/tile_w2e.scad>;
|
use <experimental/tile_w2e.scad>;
|
||||||
|
use <experimental/choose_children.scad>;
|
||||||
use <box_extrude.scad>;
|
use <box_extrude.scad>;
|
||||||
|
|
||||||
size = [15, 8];
|
size = [15, 8];
|
||||||
@@ -111,11 +112,7 @@ module tube_tile(n, width) {
|
|||||||
tile5();
|
tile5();
|
||||||
}
|
}
|
||||||
|
|
||||||
module select_child(n) {
|
choose_children(n) {
|
||||||
children(n);
|
|
||||||
}
|
|
||||||
|
|
||||||
select_child(n) {
|
|
||||||
tile0();
|
tile0();
|
||||||
tile1();
|
tile1();
|
||||||
rotate(-90) tile1();
|
rotate(-90) tile1();
|
||||||
|
Reference in New Issue
Block a user