1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-21 05:52:16 +02:00
This commit is contained in:
Justin Lin
2022-05-29 12:09:50 +08:00
parent f1d5d6e472
commit 4d611bb0b5

View File

@@ -1,13 +1,17 @@
use <shape_circle.scad>; use <shape_circle.scad>;
use <midpt_smooth.scad>; use <midpt_smooth.scad>;
use <polyline_join.scad>; use <polyline_join.scad>;
use <in_shape.scad>;
use <polyhedra/icosahedron.scad>; use <polyhedra/icosahedron.scad>;
use <triangle/tri_delaunay.scad>;
use <triangle/tri_incenter.scad>;
use <surface/sf_thickenT.scad>;
use <experimental/differential_line_growth.scad>; use <experimental/differential_line_growth.scad>;
use <experimental/ptf_c2sphere.scad>; use <experimental/ptf_c2sphere.scad>;
$fn = 24; $fn = 24;
r = 10; r = 10;
times = 50; times = 80;
line_r = 2; line_r = 2;
smooth = true; smooth = true;
smooth_times = 2; smooth_times = 2;
@@ -24,5 +28,15 @@ poly = differential_line_growth(init_shape, node_option, times);
smoothed = smooth ? midpt_smooth(poly, smooth_times, true) : poly; smoothed = smooth ? midpt_smooth(poly, smooth_times, true) : poly;
sphere_r = norm(max(smoothed)); sphere_r = norm(max(smoothed));
polyline_join([for(p = [each smoothed, smoothed[0]]) ptf_c2sphere(p, sphere_r)]) sphere_path = [for(p = smoothed) ptf_c2sphere(p, sphere_r)];
triangles = [
for(t = tri_delaunay(smoothed))
let(tri = [for(i = t) smoothed[i]])
if(in_shape(smoothed, tri_incenter(tri))) t
];
sf_thickenT(sphere_path, line_r, triangles);
polyline_join([each sphere_path, sphere_path[0]])
icosahedron(line_r); icosahedron(line_r);