mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-08 07:46:39 +02:00
format
This commit is contained in:
@@ -16,8 +16,8 @@ module tiled_line_ring(radius, height, line_diameter) {
|
|||||||
lines = [
|
lines = [
|
||||||
for(tile = tile_truchet(size))
|
for(tile = tile_truchet(size))
|
||||||
let(
|
let(
|
||||||
x = tile[0],
|
x = tile.x,
|
||||||
y = tile[1],
|
y = tile.y,
|
||||||
i = tile[2]
|
i = tile[2]
|
||||||
)
|
)
|
||||||
if(i <= 1) [
|
if(i <= 1) [
|
||||||
|
@@ -11,11 +11,10 @@ module tiled_line_torus(size, twist, line_diameter = 1) {
|
|||||||
lines = [
|
lines = [
|
||||||
for(tile = tile_truchet(size))
|
for(tile = tile_truchet(size))
|
||||||
let(
|
let(
|
||||||
x = tile[0],
|
x = tile.x,
|
||||||
y = tile[1],
|
y = tile.y
|
||||||
i = tile[2]
|
|
||||||
)
|
)
|
||||||
i <= 1 ? [[x, y], [x + 1, y + 1]] : [[x + 1, y], [x, y + 1]]
|
tile[2] <= 1 ? [[x, y], [x + 1, y + 1]] : [[x + 1, y], [x, y + 1]]
|
||||||
];
|
];
|
||||||
|
|
||||||
half_line_diameter = line_diameter / 2;
|
half_line_diameter = line_diameter / 2;
|
||||||
|
@@ -6,11 +6,10 @@ tile_width = 5;
|
|||||||
line_width = 1;
|
line_width = 1;
|
||||||
|
|
||||||
for(tile = tile_truchet(size)) {
|
for(tile = tile_truchet(size)) {
|
||||||
x = tile[0];
|
x = tile.x;
|
||||||
y = tile[1];
|
y = tile.y;
|
||||||
i = tile[2];
|
|
||||||
|
|
||||||
if(i <= 1) {
|
if(tile[2] <= 1) {
|
||||||
line2d([x, y] * tile_width , [x + 1, y + 1] * tile_width, width = line_width);
|
line2d([x, y] * tile_width , [x + 1, y + 1] * tile_width, width = line_width);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@@ -8,10 +8,9 @@ line_width = 1;
|
|||||||
$fn = 4; // 4, 8, 12 ....
|
$fn = 4; // 4, 8, 12 ....
|
||||||
|
|
||||||
for(tile = tile_truchet(size)) {
|
for(tile = tile_truchet(size)) {
|
||||||
x = tile[0];
|
x = tile.x;
|
||||||
y = tile[1];
|
y = tile.y;
|
||||||
i = tile[2];
|
if(tile[2] <= 1) {
|
||||||
if(i <= 1) {
|
|
||||||
translate([x, y] * tile_width)
|
translate([x, y] * tile_width)
|
||||||
arc(0.5 * tile_width, [0, 90], line_width);
|
arc(0.5 * tile_width, [0, 90], line_width);
|
||||||
translate([x + 1, y + 1] * tile_width)
|
translate([x + 1, y + 1] * tile_width)
|
||||||
|
@@ -32,11 +32,9 @@ draw_tubes(
|
|||||||
module draw_tubes(tiles, tileW) {
|
module draw_tubes(tiles, tileW) {
|
||||||
rows = len(tiles);
|
rows = len(tiles);
|
||||||
columns = len(tiles[0]);
|
columns = len(tiles[0]);
|
||||||
for(y = [0:rows - 1]) {
|
for(y = [0:rows - 1], x = [0:columns - 1]) {
|
||||||
for(x = [0:columns - 1]) {
|
translate([x, rows - y - 1] * tileW)
|
||||||
translate([x, rows - y - 1] * tileW)
|
|
||||||
tube_tile(tiles[y][x], tileW);
|
tube_tile(tiles[y][x], tileW);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,11 +15,8 @@ module tube_box(size, tile_width) {
|
|||||||
|
|
||||||
translate([eighth_w, eighth_w, eighth_w] + [tile_width, tile_width, 0] / 2)
|
translate([eighth_w, eighth_w, eighth_w] + [tile_width, tile_width, 0] / 2)
|
||||||
for(tile = tile_w2e(size)) {
|
for(tile = tile_w2e(size)) {
|
||||||
x = tile[0];
|
translate([tile.x, tile.y] * tile_width)
|
||||||
y = tile[1];
|
tube_tile(tile[2], tile_width);
|
||||||
i = tile[2];
|
|
||||||
translate([x, y] * tile_width)
|
|
||||||
tube_tile(i, tile_width);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
box_extrude(height = tile_width, shell_thickness = eighth_w)
|
box_extrude(height = tile_width, shell_thickness = eighth_w)
|
||||||
|
@@ -23,17 +23,16 @@ pts_angles = golden_spiral(
|
|||||||
|
|
||||||
a_step = 360 / spirals;
|
a_step = 360 / spirals;
|
||||||
cells = [
|
cells = [
|
||||||
for(i = [0:spirals - 1])
|
for(i = [0:spirals - 1], pt_angle = pts_angles)
|
||||||
for(pt_angle = pts_angles)
|
ptf_rotate(pt_angle[0], i * a_step)
|
||||||
ptf_rotate(pt_angle[0], i * a_step)
|
|
||||||
];
|
];
|
||||||
noised = [
|
noised = [
|
||||||
for(y = [-half_size[1]:pixel_step:half_size[1]])
|
for(y = [-half_size[1]:pixel_step:half_size[1]])
|
||||||
[
|
[
|
||||||
for(x = [-half_size[0]:pixel_step:half_size[0]])
|
for(x = [-half_size[0]:pixel_step:half_size[0]])
|
||||||
let(n = nz_cell(cells, [x, y] * height_factor) )
|
let(n = nz_cell(cells, [x, y] * height_factor) )
|
||||||
[x, y, n < half_pixel_step ? half_pixel_step : n]
|
[x, y, n < half_pixel_step ? half_pixel_step : n]
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
sf_thicken(noised, thickness);
|
sf_thicken(noised, thickness);
|
@@ -19,14 +19,12 @@ module voronoi_holder() {
|
|||||||
|
|
||||||
difference() {
|
difference() {
|
||||||
bend_extrude(size = size, thickness = thickness * 3, angle = 360, frags = frags)
|
bend_extrude(size = size, thickness = thickness * 3, angle = 360, frags = frags)
|
||||||
render()
|
|
||||||
difference() {
|
difference() {
|
||||||
square(size);
|
square(size);
|
||||||
render()
|
for(cell = cells) {
|
||||||
for(cell = cells) {
|
offset(-half_spacing)
|
||||||
offset(-half_spacing)
|
|
||||||
polygon(cell[1]);
|
polygon(cell[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
linear_extrude(size[1] - thickness)
|
linear_extrude(size[1] - thickness)
|
||||||
arc(radius = r, angle = 360, width = thickness, $fn = frags);
|
arc(radius = r, angle = 360, width = thickness, $fn = frags);
|
||||||
|
Reference in New Issue
Block a user