1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-13 10:14:41 +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_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) {