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