mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-09 08:16:50 +02:00
add differential_line_growth_bowl
This commit is contained in:
28
examples/differential_line_growth_bowl.scad
Normal file
28
examples/differential_line_growth_bowl.scad
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
use <shape_circle.scad>;
|
||||||
|
use <midpt_smooth.scad>;
|
||||||
|
use <polyline_join.scad>;
|
||||||
|
use <polyhedra/icosahedron.scad>;
|
||||||
|
use <experimental/differential_line_growth.scad>;
|
||||||
|
use <experimental/ptf_c2sphere.scad>;
|
||||||
|
|
||||||
|
$fn = 24;
|
||||||
|
r = 10;
|
||||||
|
times = 50;
|
||||||
|
line_r = 2;
|
||||||
|
smooth = true;
|
||||||
|
smooth_times = 2;
|
||||||
|
node_option = [
|
||||||
|
0.4, // maxForce
|
||||||
|
0.5, // maxSpeed
|
||||||
|
5, // separationDistance
|
||||||
|
1.2, // separationCohesionRatio
|
||||||
|
4 // maxEdgeLength
|
||||||
|
];
|
||||||
|
|
||||||
|
init_shape = shape_circle(r);
|
||||||
|
poly = differential_line_growth(init_shape, node_option, times);
|
||||||
|
smoothed = smooth ? midpt_smooth(poly, smooth_times, true) : poly;
|
||||||
|
|
||||||
|
sphere_r = max(max(smoothed));
|
||||||
|
polyline_join([for(p = [each smoothed, smoothed[0]]) ptf_c2sphere(p, sphere_r)])
|
||||||
|
icosahedron(line_r);
|
Reference in New Issue
Block a user