1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-07 23:37:13 +02:00
This commit is contained in:
Justin Lin
2022-04-06 17:02:32 +08:00
parent 0b23e5666a
commit adf07c5da8
8 changed files with 25 additions and 36 deletions

View File

@@ -16,8 +16,8 @@ module tiled_line_ring(radius, height, line_diameter) {
lines = [
for(tile = tile_truchet(size))
let(
x = tile[0],
y = tile[1],
x = tile.x,
y = tile.y,
i = tile[2]
)
if(i <= 1) [

View File

@@ -11,11 +11,10 @@ module tiled_line_torus(size, twist, line_diameter = 1) {
lines = [
for(tile = tile_truchet(size))
let(
x = tile[0],
y = tile[1],
i = tile[2]
x = tile.x,
y = tile.y
)
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;

View File

@@ -6,11 +6,10 @@ tile_width = 5;
line_width = 1;
for(tile = tile_truchet(size)) {
x = tile[0];
y = tile[1];
i = tile[2];
x = tile.x;
y = tile.y;
if(i <= 1) {
if(tile[2] <= 1) {
line2d([x, y] * tile_width , [x + 1, y + 1] * tile_width, width = line_width);
}
else {

View File

@@ -8,10 +8,9 @@ line_width = 1;
$fn = 4; // 4, 8, 12 ....
for(tile = tile_truchet(size)) {
x = tile[0];
y = tile[1];
i = tile[2];
if(i <= 1) {
x = tile.x;
y = tile.y;
if(tile[2] <= 1) {
translate([x, y] * tile_width)
arc(0.5 * tile_width, [0, 90], line_width);
translate([x + 1, y + 1] * tile_width)

View File

@@ -32,11 +32,9 @@ draw_tubes(
module draw_tubes(tiles, tileW) {
rows = len(tiles);
columns = len(tiles[0]);
for(y = [0:rows - 1]) {
for(x = [0:columns - 1]) {
translate([x, rows - y - 1] * tileW)
for(y = [0:rows - 1], x = [0:columns - 1]) {
translate([x, rows - y - 1] * tileW)
tube_tile(tiles[y][x], tileW);
}
}
}

View File

@@ -15,11 +15,8 @@ module tube_box(size, tile_width) {
translate([eighth_w, eighth_w, eighth_w] + [tile_width, tile_width, 0] / 2)
for(tile = tile_w2e(size)) {
x = tile[0];
y = tile[1];
i = tile[2];
translate([x, y] * tile_width)
tube_tile(i, tile_width);
translate([tile.x, tile.y] * tile_width)
tube_tile(tile[2], tile_width);
}
box_extrude(height = tile_width, shell_thickness = eighth_w)

View File

@@ -23,17 +23,16 @@ pts_angles = golden_spiral(
a_step = 360 / spirals;
cells = [
for(i = [0:spirals - 1])
for(pt_angle = pts_angles)
ptf_rotate(pt_angle[0], i * a_step)
for(i = [0:spirals - 1], pt_angle = pts_angles)
ptf_rotate(pt_angle[0], i * a_step)
];
noised = [
for(y = [-half_size[1]:pixel_step:half_size[1]])
[
for(x = [-half_size[0]:pixel_step:half_size[0]])
let(n = nz_cell(cells, [x, y] * height_factor) )
[x, y, n < half_pixel_step ? half_pixel_step : n]
]
[
for(x = [-half_size[0]:pixel_step:half_size[0]])
let(n = nz_cell(cells, [x, y] * height_factor) )
[x, y, n < half_pixel_step ? half_pixel_step : n]
]
];
sf_thicken(noised, thickness);

View File

@@ -19,14 +19,12 @@ module voronoi_holder() {
difference() {
bend_extrude(size = size, thickness = thickness * 3, angle = 360, frags = frags)
render()
difference() {
square(size);
render()
for(cell = cells) {
offset(-half_spacing)
for(cell = cells) {
offset(-half_spacing)
polygon(cell[1]);
}
}
}
linear_extrude(size[1] - thickness)
arc(radius = r, angle = 360, width = thickness, $fn = frags);