1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-14 02:34:12 +02:00

use polyline_join

This commit is contained in:
Justin Lin
2021-10-08 09:36:01 +08:00
parent e9440e55d6
commit a14c5676d4
36 changed files with 158 additions and 136 deletions

View File

@@ -1,4 +1,4 @@
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
use <hollow_out.scad>;
use <util/dedup.scad>;
use <turtle/lsystem2.scad>;
@@ -43,11 +43,8 @@ module fidget_ball_fern_leaf(radius, thickness, spacing, drill_angle, support_th
for(i = [0:n - 1]) {
rotate(i * a_step)
for(line = fern) {
hull_polyline3d(
line,
thickness * thickness_scale,
$fn = 5
);
polyline_join(line)
sphere(thickness * thickness_scale / 2, $fn = 5);
}
}
}

View File

@@ -1,5 +1,5 @@
use <hull_polyline3d.scad>;
use <experimental/tri_delaunay.scad>;
use <polyline_join.scad>;
use <triangle/tri_delaunay.scad>;
use <experimental/tri_bisectors.scad>;
use <ptf/ptf_bend.scad>;
@@ -33,9 +33,6 @@ bisectors = [
for(line = bisectors) {
pts = [for(p = line) ptf_bend(size, p, radius, 360)];
hull_polyline3d(
concat(pts, [pts[0]]),
line_diameter = line_diameter,
$fn = 4
);
polyline_join(concat(pts, [pts[0]]))
sphere(d = line_diameter, $fn = 4);
}

View File

@@ -1,4 +1,4 @@
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
use <ptf/ptf_bend.scad>;
use <hollow_out_square.scad>;
@@ -18,7 +18,8 @@ lines = concat(
for(line = lines) {
transformed = [for(pt = line) ptf_bend([columns * width, rows * width], pt, radius, angle)];
hull_polyline3d(transformed, diameter, $fn = 4);
polyline_join(transformed)
sphere(d = diameter, $fn = 4);
}
translate([0, 0, -diameter / 2])

View File

@@ -1,5 +1,5 @@
use <shape_starburst.scad>;
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
use <experimental/tri_bisectors.scad>;
r1 = 30;
@@ -19,9 +19,11 @@ module hollow_out_starburst(r1, r2, h, n, line_diameter, half = false) {
module half_star() {
for(tri = tris) {
hull_polyline3d(concat(tri, [tri[0]]), line_diameter = line_diameter);
polyline_join(concat(tri, [tri[0]]))
sphere(d = line_diameter);
for(line = tri_bisectors(tri)) {
hull_polyline3d(concat(line, [line[0]]), line_diameter = line_diameter);
polyline_join(concat(line, [line[0]]))
sphere(d = line_diameter);
}
}
}

View File

@@ -1,4 +1,4 @@
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
use <ptf/ptf_torus.scad>;
use <hollow_out_square.scad>;
@@ -13,7 +13,8 @@ lines = hollow_out_square([columns, rows], width);
for(line = lines) {
transformed = [for(pt = line) ptf_torus([columns * width, rows * width], pt, [radius, radius / 2], twist = twist)];
hull_polyline3d(transformed, line_diameter, $fn = 4);
polyline_join(transformed)
sphere(d = line_diameter, $fn = 4);
}
color("black")

View File

@@ -1,4 +1,4 @@
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
use <bezier_curve.scad>;
use <ptf/ptf_rotate.scad>;
use <rails2sections.scad>;
@@ -19,6 +19,7 @@ p4 = [35, 0, 130];
hollow_out_vase([p0, p1, p2, p3, p4], t_step, line_diameter, fn, line_style);
module hollow_out_vase(ctrl_pts, t_step, line_diameter, fn, line_style) {
line_r = line_diameter / 2;
bezier = bezier_curve(t_step,
ctrl_pts
);
@@ -45,9 +46,11 @@ module hollow_out_vase(ctrl_pts, t_step, line_diameter, fn, line_style) {
for(tri = fst_tris) {
lines = tri_bisectors(tri);
for(line = lines) {
hull_polyline3d(line, diameter = line_diameter, $fn = 4);
polyline_join(line)
sphere(line_r, $fn = 4);
}
hull_polyline3d([lines[2][1], [0, 0, 0]], diameter = line_diameter, $fn = 4);
polyline_join([lines[2][1], [0, 0, 0]])
sphere(line_r, $fn = 4);
}
// mouth
@@ -59,7 +62,10 @@ module hollow_out_vase(ctrl_pts, t_step, line_diameter, fn, line_style) {
dangling_pts = [for(tri = lst_tris) tri_bisectors(tri)[1][1]];
offset_z = [0, 0, line_diameter];
for(i = [0: leng_sect - 1]) {
hull_polyline3d([lst_sect[i] + offset_z, dangling_pts[i]], diameter = line_diameter, $fn = 4);
hull_polyline3d([lst_sect[(i + 1) % leng_sect] + offset_z, dangling_pts[i]], diameter = line_diameter, $fn = 4);
polyline_join([lst_sect[i] + offset_z, dangling_pts[i]])
sphere(line_r, $fn = 4);
polyline_join([lst_sect[(i + 1) % leng_sect] + offset_z, dangling_pts[i]])
sphere(line_r, $fn = 4);
}
}

View File

@@ -1,4 +1,3 @@
use <hull_polyline2d.scad>;
use <contours.scad>;
level_step = 51;

View File

@@ -2,7 +2,7 @@ use <arc_path.scad>;
use <shape_circle.scad>;
use <path_extrude.scad>;
use <bezier_curve.scad>;
use <hull_polyline2d.scad>;
use <polyline_join.scad>;
use <bspline_curve.scad>;
radius1 = 10;
@@ -31,10 +31,8 @@ module klein_bottle(radius1, radius2, bottom_height, thickness, t_step, fn) {
path = concat([for(p = ph1) p + [radius1 + radius2, 0, 0]], ph2);
hull_polyline2d(
path,
thickness
);
polyline_join(path)
circle(half_thickness);
}
}

View File

@@ -1,4 +1,4 @@
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
use <maze/mz_square_cells.scad>;
use <maze/mz_square_walls.scad>;
use <ptf/ptf_ring.scad>;
@@ -24,5 +24,6 @@ walls = mz_square_walls(cells, rows, columns, cell_width, bottom_border = false)
size = [columns * cell_width, rows * cell_width];
for(wall_pts = walls) {
transformed = [for(pt = wall_pts) ptf_ring(size, pt, radius, 360, angle)];
hull_polyline3d(transformed, line_diameter);
polyline_join(transformed)
sphere(d = line_diameter);
}

View File

@@ -1,4 +1,4 @@
use <hull_polyline2d.scad>;
use <polyline_join.scad>;
use <util/rand.scad>;
use <maze/mz_square_cells.scad>;
use <maze/mz_square_walls.scad>;
@@ -18,7 +18,7 @@ module noisy_circle_maze(r_cells, cell_width, wall_thickness, origin_offset, noi
rect_size = is_undef(origin_offset) ? [width, width] : [width, width] - origin_offset * 2;
noisy_f = is_undef(noisy_factor) ? 1 : noisy_factor;
half_wall_thickness = wall_thickness / 2;
seed = rand(0, 256);
for(wall = walls) {
for(i = [0:len(wall) - 2]) {
@@ -28,7 +28,8 @@ module noisy_circle_maze(r_cells, cell_width, wall_thickness, origin_offset, noi
pn01 = nz_perlin2(p0[0] + seed, p0[1] + seed, seed) * noisy_f;
pn10 = nz_perlin2(p1[0], p1[1], seed) * noisy_f;
pn11 = nz_perlin2(p1[0] + seed, p1[1] + seed, seed) * noisy_f;
hull_polyline2d([p0 + [pn00, pn01], p1 + [pn10, pn11]], width = wall_thickness);
polyline_join([p0 + [pn00, pn01], p1 + [pn10, pn11]])
circle(half_wall_thickness);
}
}
}

View File

@@ -1,6 +1,5 @@
use <archimedean_spiral.scad>;
use <hull_polyline3d.scad>;
use <hull_polyline2d.scad>;
use <polyline_join.scad>;
use <maze/mz_square_cells.scad>;
use <maze/mz_square_walls.scad>;
@@ -29,8 +28,10 @@ module spiral_maze() {
rows, columns, cell_width
);
half_thickness = wall_thickness / 2;
for(wall = walls) {
hull_polyline3d([
polyline_join([
for(p = wall)
let(
x = p[0],
@@ -38,14 +39,12 @@ module spiral_maze() {
cp = (pts3d[x] + pts3d[x + 1]) / 2
)
cp + [0, y, 0]
],
wall_thickness,
$fn = 5
);
]) sphere(half_thickness, $fn = 5);
}
translate([0, rows, 0])
rotate([90, 0, 0])
linear_extrude(rows)
hull_polyline2d([for(i = [1:len(pts2d) - 2]) pts2d[i]], wall_thickness / 2);
polyline_join([for(i = [1:len(pts2d) - 2]) pts2d[i]])
circle(wall_thickness / 4);
}

View File

@@ -1,6 +1,6 @@
use <maze/mz_theta_cells.scad>;
use <maze/mz_theta_get.scad>;
use <hull_polyline2d.scad>;
use <polyline_join.scad>;
rows = 5;
beginning_number = 8;
@@ -16,6 +16,7 @@ module theta_maze(rows, beginning_number, cell_width, wall_thickness, wall_heigh
maze = mz_theta_cells(rows, beginning_number);
half_wall_thickness = wall_thickness / 2;
linear_extrude(wall_height) {
for(rows = maze) {
for(cell = rows) {
@@ -33,11 +34,13 @@ module theta_maze(rows, beginning_number, cell_width, wall_thickness, wall_heigh
outerVt2 = vt_from_angle(theta2, outerR);
if(wallType == "INWARD_WALL" || wallType == "INWARD_CCW_WALL") {
hull_polyline2d([innerVt1, innerVt2], width = wall_thickness);
polyline_join([innerVt1, innerVt2])
circle(half_wall_thickness);
}
if(wallType == "CCW_WALL" || wallType == "INWARD_CCW_WALL") {
hull_polyline2d([innerVt2, outerVt2], width = wall_thickness);
polyline_join([innerVt2, outerVt2])
circle(half_wall_thickness);
}
}
}
@@ -47,7 +50,8 @@ module theta_maze(rows, beginning_number, cell_width, wall_thickness, wall_heigh
for(theta = [0:thetaStep:360 - thetaStep]) {
vt1 = vt_from_angle(theta, r);
vt2 = vt_from_angle(theta + thetaStep, r);
hull_polyline2d([vt1, vt2], width = wall_thickness);
polyline_join([vt1, vt2])
circle(half_wall_thickness);
}
}
}

View File

@@ -1,4 +1,4 @@
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
use <maze/mz_square_cells.scad>;
use <maze/mz_square_walls.scad>;
use <path_extrude.scad>;
@@ -42,25 +42,22 @@ module torus_knot_maze() {
);
half_row = rows / 2;
r = wall_thickness / 2;
for(wall = walls) {
hull_polyline3d([
for(p = wall)
let(
x = p[0],
y = p[1]
)
path[x] + ptf_rotate(
ptf_rotate(
[-y + half_row, 0, 0],
[0, 0, -90]
),
[0, angle_yz[x][0], angle_yz[x][1]]
)
],
wall_thickness,
$fn = 4
);
polyline_join([
for(p = wall)
let(
x = p[0],
y = p[1]
)
path[x] + ptf_rotate(
ptf_rotate(
[-y + half_row, 0, 0],
[0, 0, -90]
),
[0, angle_yz[x][0], angle_yz[x][1]]
)
]) sphere(r, $fn = 4);
}
if(filled) {

View File

@@ -1,4 +1,4 @@
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
use <ptf/ptf_torus.scad>;
use <maze/mz_square_cells.scad>;
use <maze/mz_square_walls.scad>;
@@ -24,7 +24,8 @@ walls = mz_square_walls(cells, rows, columns, cell_width, left_border = false, b
size = [columns * cell_width, rows * cell_width];
for(wall_pts = walls) {
transformed = [for(pt = wall_pts) ptf_torus(size, pt, [radius, radius / 2], twist = twist)];
hull_polyline3d(transformed, line_diameter, $fn = 4);
polyline_join(transformed)
sphere(d = line_diameter, $fn = 4);
}
color("black")

View File

@@ -1,4 +1,4 @@
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
use <maze/mz_square_cells.scad>;
use <maze/mz_square_walls.scad>;
use <ptf/ptf_x_twist.scad>;
@@ -21,5 +21,6 @@ walls = mz_square_walls(cells, rows, columns, cell_width);
size = [columns * cell_width, rows * cell_width];
for(wall_pts = walls) {
transformed = [for(pt = wall_pts) axis == "X_AXIS" ? ptf_x_twist(size, pt, angle) : ptf_y_twist(size, pt, angle)];
hull_polyline3d(transformed, line_diameter);
polyline_join(transformed)
sphere(d = line_diameter);
}

View File

@@ -1,6 +1,6 @@
use <daruma.scad>;
use <arc.scad>;
use <hull_polyline2d.scad>;
use <polyline_join.scad>;
text = "順暢";
font = "思源黑體 Medium";
@@ -48,7 +48,8 @@ module helmet() {
rotate(-30)
rotate_extrude(angle = 240, $fn = 12)
hull_polyline2d([[40.65, 1], [45, -10], [50, -30], [60, -45]], 3.25, $fn = 4);
polyline_join([[40.65, 1], [45, -10], [50, -30], [60, -45]])
circle(1.625, $fn = 4);
translate([0, 0, 1])
linear_extrude(2)

View File

@@ -1,6 +1,5 @@
use <ptf/ptf_rotate.scad>;
use <hull_polyline2d.scad>;
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
use <shape_superformula.scad>;
function shape2wire(shape, r) =
@@ -28,9 +27,11 @@ rotate([90, 0, 0])
linear_extrude(1, center = true)
difference() {
square(120, center = true);
hull_polyline2d(concat(shape, [shape[0]]), width = 5);
polyline_join(concat(shape, [shape[0]]))
circle(2.5);
}
wire = shape2wire(shape, 150);
rotate(-$t * 360)
hull_polyline3d(concat(wire, [wire[0]]), 3);
polyline_join(concat(wire, [wire[0]]))
sphere(1.5);

View File

@@ -1,4 +1,4 @@
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
side_leng = 100;
min_leng = 5;
@@ -29,11 +29,15 @@ module pyramid_frame(side_leng, diameter) {
tri_pts = [[0, 0, h], [half_leng, half_leng, 0], [half_leng, -half_leng, 0], [0, 0, h]];
line_pts = [[half_leng, half_leng, 0], [-half_leng, half_leng, 0]];
hull_polyline3d(tri_pts, diameter);
polyline_join(tri_pts)
sphere(d = diameter);
mirror([1, 0, 0])
hull_polyline3d(tri_pts, diameter);
polyline_join(tri_pts)
sphere(d = diameter);
hull_polyline3d(line_pts, diameter);
polyline_join(line_pts)
sphere(d = diameter);
mirror([0, 1, 0])
hull_polyline3d(line_pts, diameter);
polyline_join(line_pts)
sphere(d = diameter);
}

View File

@@ -1,5 +1,5 @@
use <ptf/ptf_rotate.scad>;
use <hull_polyline2d.scad>;
use <polyline_join.scad>;
use <bezier_curve.scad>;
use <ellipse_extrude.scad>;
@@ -19,8 +19,10 @@ module nautilus_shell(chambered_section_max_angle, steps, thickness) {
ptf_rotate([r(a), 0], a)
];
half_thickness = thickness / 2;
render() {
hull_polyline2d(spiral, thickness);
polyline_join(spiral)
circle(half_thickness);
for(a = [a_step:a_step * 2:chambered_section_max_angle]) {
a2 = a + 360;
@@ -29,9 +31,8 @@ module nautilus_shell(chambered_section_max_angle, steps, thickness) {
p2 = ptf_rotate((p1 + ptf_rotate([r(a2), 0], a2)) * .6, -5);
p3 = ptf_rotate([r(a3), 0], a3);
hull_polyline2d(bezier_curve(0.1,
[p1, p2, p3]
), thickness);
polyline_join(bezier_curve(0.1, [p1, p2, p3]))
circle(half_thickness);
}
}

View File

@@ -1,5 +1,5 @@
use <fibonacci_lattice.scad>;
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
use <polyhedron_hull.scad>;
n = 150;
@@ -51,6 +51,7 @@ module spiral_math_constants(n, radius, constants, font_name, font_size, txt_ext
}
for(i = [0:2:6]) {
hull_polyline3d(spirals[i] * 0.9, 1, $fn = 4);
polyline_join(spirals[i] * 0.9)
sphere(.5, $fn = 4);
}
}

View File

@@ -1,4 +1,4 @@
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
leng = 50;
diameter = 5;
@@ -20,8 +20,10 @@ module string_tetrahedron(leng, diameter, segs_per_side, line_fn) {
pts1 = pts(side1[0], side1[1], segs);
pts2 = pts(side2[0], side2[1], segs);
r = diameter / 2;
for(i = [0:len(pts1) - 1]) {
hull_polyline3d(points = [pts1[i], pts2[i]], diameter = diameter);
polyline_join([pts1[i], pts2[i]])
sphere(r);
}
}

View File

@@ -1,4 +1,4 @@
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
level = 1;
leng = 50;
@@ -20,12 +20,16 @@ module string_tetrahedron(leng, diameter, segs_per_side, line_fn) {
pts2 = pts(side2[0], side2[1], segs);
leng = len(pts1);
hull_polyline3d(points = [pts1[0], pts2[0]], diameter = diameter);
r = diameter / 2;
polyline_join(points = [pts1[0], pts2[0]])
sphere(r);
for(i = [1:leng - 2]) {
hull_polyline3d(points = [pts1[i], pts2[i]], diameter = diameter);
polyline_join([pts1[i], pts2[i]])
sphere(r);
}
end = leng - 1;
hull_polyline3d(points = [pts1[end], pts2[end]], diameter = diameter);
polyline_join([pts1[end], pts2[end]])
sphere(r);
}
function height(leng) =

View File

@@ -1,4 +1,4 @@
use <hull_polyline2d.scad>;
use <polyline_join.scad>;
use <voxel/vx_ascii.scad>;
tx = "3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172";
@@ -20,7 +20,8 @@ linear_extrude(1) {
translate(pts[i])
square(7, center = true);
}
hull_polyline2d([for(i = [0:len(tx) - 1]) pts[i]], width = 2);
polyline_join([for(i = [0:len(tx) - 1]) pts[i]])
circle(1);
}
function _px_spiral_forward(pt, leng, dir, clockwise) =

View File

@@ -1,5 +1,5 @@
use <shape_circle.scad>;
use <hull_polyline2d.scad>;
use <polyline_join.scad>;
use <util/sum.scad>;
beginning_radius = 10;
@@ -18,11 +18,14 @@ module spiral_polygons(beginning_radius, line_width, fn, n) {
dr = y / cos(theta);
pw = pow((beginning_radius + dr) * sin(theta), 2);
half_line_width = line_width / 2;
function a(ri, ro, i) = acos((pow(ro, 2) + pow(ri, 2) - pw * pow(0.985, i)) / (2 * ro * ri));
module drawPolygon(r) {
pts = shape_circle(radius = r, $fn = fn);
hull_polyline2d(concat(pts, [pts[0]]), width = line_width, $fn = 12);
polyline_join(concat(pts, [pts[0]]))
circle(half_line_width, $fn = 12);
}
rs = [for(i = [0: n - 1]) beginning_radius + i * dr];

View File

@@ -1,4 +1,4 @@
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
length = 100;
diff_scale = 0.125;
@@ -22,7 +22,8 @@ module square_pursuit_3d(length, diff_scale, diameter, n) {
npts = [for(i = [0:3]) inter_p(pts[i], pts[(i + 1) % 4], leng, d)];
hull_polyline3d(concat(npts, [npts[3], npts[0]]), diameter);
polyline_join(concat(npts, [npts[3], npts[0]]))
sphere(d = diameter);
_square_pursuit_3d(npts, diff_scale, diameter, n - 1);
}
@@ -36,7 +37,8 @@ module square_pursuit_3d(length, diff_scale, diameter, n) {
[0, length, 0]
];
hull_polyline3d(concat(pts, [pts[3], pts[0]]), diameter);
polyline_join(concat(pts, [pts[3], pts[0]]))
sphere(d = diameter);
_square_pursuit_3d(pts, diff_scale, diameter, n - 1);
}

View File

@@ -1,5 +1,4 @@
use <triangle/tri_delaunay.scad>;
use <hull_polyline2d.scad>;
use <shape_taiwan.scad>;
use <in_shape.scad>;

View File

@@ -1,5 +1,4 @@
use <pie.scad>;
use <hull_polyline2d.scad>;
use <ptf/ptf_rotate.scad>;
use <experimental/tile_penrose3.scad>;

View File

@@ -1,7 +1,7 @@
use <experimental/tile_penrose3.scad>;
use <experimental/ptf_c2sphere.scad>;
use <ptf/ptf_rotate.scad>;
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
use <surface/sf_thickenT.scad>;
use <polyhedron_hull.scad>;
use <util/every.scad>;
@@ -19,6 +19,7 @@ $fn = 4;
penrose_basket(basket_radius, radius_in_plane, n, line_diameter, bottom_radius, bottom_height, shell_random_threshold);
module penrose_basket(basket_radius, radius_in_plane, n, line_diameter, bottom_radius, bottom_height, shell_random_threshold) {
line_r = line_diameter / 2;
tris = [for(t = tile_penrose3(n)) t[1] * radius_in_plane];
for(t = tris) {
if(every(t, function(p) norm(p) < radius_in_plane * 1.25)) {
@@ -30,10 +31,8 @@ module penrose_basket(basket_radius, radius_in_plane, n, line_diameter, bottom_r
cp
];
hull_polyline3d(
pts,
line_diameter
);
polyline_join(pts)
sphere(line_r);
if(rands(0, 1, 1)[0] < shell_random_threshold) {
inward_ratio = (basket_radius - 0.25 * line_diameter) / basket_radius;

View File

@@ -1,5 +1,5 @@
use <experimental/tile_truchet.scad>;
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
use <ptf/ptf_ring.scad>;
size = [20, 100];
@@ -28,9 +28,10 @@ module tiled_line_mobius(size, twist, line_diameter = 1) {
]
);
half_line_diameter = line_diameter / 2;
for(line = lines) {
pts = [for(p = line) ptf_ring(size, p, size[0], twist = twist)];
hull_polyline3d(pts, diameter = line_diameter);
polyline_join(pts) sphere(half_line_diameter);
}
}

View File

@@ -1,5 +1,5 @@
use <experimental/tile_truchet.scad>;
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
use <ptf/ptf_torus.scad>;
size = [20, 50];
@@ -18,9 +18,11 @@ module tiled_line_torus(size, twist, line_diameter = 1) {
i <= 1 ? [[x, y], [x + 1, y + 1]] : [[x + 1, y], [x, y + 1]]
];
half_line_diameter = line_diameter / 2;
for(line = lines) {
pts = [for(p = line) ptf_torus(size, p, [size[0], size[0] / 2], twist = twist)];
hull_polyline3d(pts, diameter = line_diameter);
polyline_join(pts)
sphere(half_line_diameter);
}
}

View File

@@ -3,7 +3,7 @@ use <shape_circle.scad>;
use <path_extrude.scad>;
use <bezier_curve.scad>;
use <bspline_curve.scad>;
use <hull_polyline2d.scad>;
use <polyline_join.scad>;
thickness = 4.5;
t_step = 0.05;
@@ -28,10 +28,8 @@ module dis_connected_klein_bottle(radius1, radius2, bottom_height, thickness, t_
path = concat([for(p = ph1) p + [radius1 + radius2, 0, 0]], ph2);
hull_polyline2d(
path,
thickness
);
polyline_join(path)
circle(half_thickness);
}
}

View File

@@ -1,4 +1,4 @@
use <hull_polyline2d.scad>;
use <polyline_join.scad>;
use <hollow_out.scad>;
use <turtle/t2d.scad>;
@@ -13,7 +13,8 @@ k2 = 0.3;
module fern_leaf(t, leng, min_leng, k1, k2, width) {
t1 = t2d(t, "forward", leng = leng);
hull_polyline2d([t2d(t, "point"), t2d(t1, "point")], width);
polyline_join([t2d(t, "point"), t2d(t1, "point")])
circle(width / 2);
if(leng > min_leng) {
fern_leaf(
@@ -22,7 +23,8 @@ module fern_leaf(t, leng, min_leng, k1, k2, width) {
);
t2 = t2d(t1, "forward", leng = k1 * leng);
hull_polyline2d([t2d(t1, "point"), t2d(t2, "point")], width);
polyline_join([t2d(t1, "point"), t2d(t2, "point")])
circle(width / 2);
t3 = t2d(t2, "turn", angle = -69.0);
fern_leaf(

View File

@@ -1,5 +1,5 @@
use <bezier_smooth.scad>;
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
use <util/dedup.scad>;
use <turtle/lsystem3.scad>;
@@ -14,7 +14,8 @@ hilbert_path = dedup(
);
smoothed_hilbert_path = bezier_smooth(hilbert_path, corner_r);
hull_polyline3d(smoothed_hilbert_path, diameter = diameter);
polyline_join(smoothed_hilbert_path)
sphere(d = diameter);
function hilbert_curve() =
let(

View File

@@ -1,13 +1,10 @@
use <turtle/lsystem3.scad>;
use <util/dedup.scad>;
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
for(line = dedup(hilbert_curve())) {
hull_polyline3d(
[line[0], line[1]],
diameter = 0.5,
$fn = 4
);
polyline_join([line[0], line[1]])
sphere(.25, $fn = 4);
}
function tree1(n = 4, angle = 22.5, leng = 1, heading = 0, start = [0, 0, 0]) =

View File

@@ -1,4 +1,4 @@
use <hull_polyline2d.scad>;
use <polyline_join.scad>;
use <turtle/t2d.scad>;
side_leng = 100;
@@ -17,10 +17,8 @@ module triangle(t, side_leng, thickness) {
["forward", side_leng]
]);
hull_polyline2d(
[for(turtle = [t, t2, t3, t]) t2d(turtle, "point")],
thickness
);
polyline_join([for(turtle = [t, t2, t3, t]) t2d(turtle, "point")])
circle(thickness / 2);
}
module sierpinski_triangle(t, side_leng, min_leng, thickness) {

View File

@@ -1,5 +1,5 @@
use <voronoi/vrn2_cells_space.scad>;
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
use <ptf/ptf_torus.scad>;
size = [40, 80];
@@ -11,5 +11,6 @@ $fn = 4;
for(cell = cells) {
cell_poly = [for(p = cell[1]) ptf_torus(size, p, [10, 5], [360, 360])];
hull_polyline3d(cell_poly, diameter = 1);
polyline_join(cell_poly)
sphere(d = 1);
}