1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00
dotSCAD/examples/differential_line_growth.scad

26 lines
554 B
OpenSCAD
Raw Normal View History

2022-06-06 13:11:46 +08:00
use <shape_circle.scad>
use <experimental/differential_line_growth.scad>
use <midpt_smooth.scad>
2022-05-27 09:10:35 +08:00
2022-05-26 18:19:56 +08:00
$fn = 24;
2022-05-27 09:10:35 +08:00
r = 10;
times = 80;
2022-05-26 18:19:56 +08:00
thickness = 2;
2022-05-27 09:10:35 +08:00
smooth = true;
smooth_times = 2;
2022-05-26 18:19:56 +08:00
node_option = [
2022-05-27 09:10:35 +08:00
0.4, // maxForce
0.5, // maxSpeed
5, // separationDistance
1.2, // separationCohesionRatio
4 // maxEdgeLength
2022-05-26 18:19:56 +08:00
];
init_shape = shape_circle(r);
2022-05-27 09:10:35 +08:00
poly = differential_line_growth(init_shape, node_option, times);
2022-05-26 18:19:56 +08:00
linear_extrude(thickness)
2022-05-27 09:10:35 +08:00
polygon(
smooth ? midpt_smooth(poly, smooth_times, true) : poly
);