1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-21 05:52:16 +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,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) =