mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-28 08:50:30 +02:00
refactor
This commit is contained in:
@@ -3,7 +3,7 @@ use <shape_trapezium.scad>;
|
||||
use <arc.scad>;
|
||||
use <shear.scad>;
|
||||
use <util/rand.scad>;
|
||||
use <experimental/tiles_wang_2e.scad>;
|
||||
use <experimental/tile_w2e.scad>;
|
||||
|
||||
mask = [
|
||||
[0, 1, 1, 0, 0, 0, 1, 1, 0],
|
||||
@@ -24,7 +24,18 @@ random_city(rows, columns, mask);
|
||||
|
||||
module random_city(rows, columns, mask) {
|
||||
tile_width = 30;
|
||||
tiles_wang_2e(rows, columns, tile_width, mask) {
|
||||
|
||||
module tiles() {
|
||||
for(tile = tile_w2e(rows, columns, mask)) {
|
||||
x = tile[0];
|
||||
y = tile[1];
|
||||
i = tile[2];
|
||||
translate([x, y] * tile_width)
|
||||
children(i);
|
||||
}
|
||||
}
|
||||
|
||||
tiles() {
|
||||
tile00();
|
||||
tile01();
|
||||
tile02();
|
||||
|
@@ -1,4 +1,4 @@
|
||||
use <experimental/tiles_wang_2e.scad>;
|
||||
use <experimental/tile_w2e.scad>;
|
||||
use <box_extrude.scad>;
|
||||
|
||||
rows = 8;
|
||||
@@ -12,25 +12,14 @@ module tube_box(rows, columns, tile_width) {
|
||||
half_w = tile_width / 2;
|
||||
quarter_w = tile_width / 4;
|
||||
eighth_w = tile_width / 8;
|
||||
|
||||
translate([eighth_w, eighth_w, -eighth_w])
|
||||
tiles_wang_2e(rows, columns, tile_width) {
|
||||
tube_tile(0, tile_width);
|
||||
tube_tile(1, tile_width);
|
||||
tube_tile(2, tile_width);
|
||||
tube_tile(3, tile_width);
|
||||
tube_tile(4, tile_width);
|
||||
tube_tile(5, tile_width);
|
||||
tube_tile(6, tile_width);
|
||||
tube_tile(7, tile_width);
|
||||
tube_tile(8, tile_width);
|
||||
tube_tile(9, tile_width);
|
||||
tube_tile(10, tile_width);
|
||||
tube_tile(11, tile_width);
|
||||
tube_tile(12, tile_width);
|
||||
tube_tile(13, tile_width);
|
||||
tube_tile(14, tile_width);
|
||||
tube_tile(15, tile_width);
|
||||
|
||||
translate([eighth_w, eighth_w, -eighth_w] + [tile_width, tile_width] / 2)
|
||||
for(tile = tile_w2e(rows, columns)) {
|
||||
x = tile[0];
|
||||
y = tile[1];
|
||||
i = tile[2];
|
||||
translate([x, y] * tile_width)
|
||||
tube_tile(i, tile_width);
|
||||
}
|
||||
|
||||
box_extrude(height = tile_width, shell_thickness = eighth_w)
|
||||
|
Reference in New Issue
Block a user