mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-21 05:52:16 +02:00
refactor
This commit is contained in:
@@ -3,9 +3,39 @@ use <box_extrude.scad>;
|
|||||||
rows = 8;
|
rows = 8;
|
||||||
columns = 15;
|
columns = 15;
|
||||||
tile_width = 10;
|
tile_width = 10;
|
||||||
tile_thickness = 2;
|
|
||||||
$fn = 12;
|
$fn = 12;
|
||||||
|
|
||||||
|
tube_box(rows, columns, tile_width);
|
||||||
|
|
||||||
|
module tube_box(rows, columns, tile_width) {
|
||||||
|
half_w = tile_width / 2;
|
||||||
|
quarter_w = tile_width / 4;
|
||||||
|
eighth_w = tile_width / 8;
|
||||||
|
|
||||||
|
two_edge_wang_tiles(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([-half_w - eighth_w, -half_w - eighth_w, -eighth_w])
|
||||||
|
box_extrude(height = tile_width, shell_thickness = eighth_w)
|
||||||
|
square([columns * tile_width + quarter_w, rows * tile_width + quarter_w]);
|
||||||
|
}
|
||||||
|
|
||||||
module two_edge_wang_tiles(rows, columns, tile_width) {
|
module two_edge_wang_tiles(rows, columns, tile_width) {
|
||||||
edges = [
|
edges = [
|
||||||
for(y = [0:rows])
|
for(y = [0:rows])
|
||||||
@@ -27,29 +57,6 @@ module two_edge_wang_tiles(rows, columns, tile_width) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
two_edge_wang_tiles(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([-tile_width / 2 - tile_width / 8, -tile_width / 2 - tile_width / 8, -tile_width / 8])
|
|
||||||
box_extrude(height = tile_width, shell_thickness = tile_width / 8)
|
|
||||||
square([columns * tile_width + tile_width / 4, rows * tile_width + tile_width / 4]);
|
|
||||||
|
|
||||||
module tube_tile(n, width) {
|
module tube_tile(n, width) {
|
||||||
half_w = width / 2;
|
half_w = width / 2;
|
||||||
quarter_w = width / 4;
|
quarter_w = width / 4;
|
||||||
|
Reference in New Issue
Block a user