From c5bfc89c4a7240d6ee2a124a09cfebfda2ec0c9f Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Sun, 22 Sep 2019 13:39:08 +0800 Subject: [PATCH] add golden_taiwan --- examples/taiwan/golden_taiwan.scad | 57 ++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 examples/taiwan/golden_taiwan.scad diff --git a/examples/taiwan/golden_taiwan.scad b/examples/taiwan/golden_taiwan.scad new file mode 100644 index 00000000..1d4d0076 --- /dev/null +++ b/examples/taiwan/golden_taiwan.scad @@ -0,0 +1,57 @@ +include ; +include ; +include ; +include ; +include ; +include ; +include ; +include ; +include ; +include ; + +// smaller values are better +taiwan_fineness = 5; + +// smaller values are better +wave_fineness = 0.05; + +module golden_taiwan(taiwan_fineness, wave_fineness) { + + module taiwan() { + mirror_taiwan = [for(pt = shape_taiwan(15)) [pt[0] * -1, pt[1]]]; + + translate([127.5, 42.5, 83]) golden_spiral_extrude( + mirror_taiwan, + from = 1, + to = 10, + point_distance = taiwan_fineness, + scale = 10 + ); + } + + module wave() { + t_step = wave_fineness; + thickness = 100; + + ctrl_pts = [ + [[0, 0, 20], [60, 0, -35], [90, 0, 60], [200, 0, 5]], + [[0, 50, 30], [100, 60, -25], [120, 50, 120], [200, 50, 5]], + [[0, 100, 0], [60, 120, 35], [90, 100, 60], [200, 100, 45]], + [[0, 123, 0], [60, 123, -35], [90, 123, 60], [200, 123, 45]] + ]; + + g = bezier_surface(t_step, ctrl_pts); + + difference() { + function_grapher(g, thickness); + translate([-1, -1, -120]) cube([220, 130, 110]); + } + } + + taiwan(); + + render() wave(); + +} + +golden_taiwan(taiwan_fineness, wave_fineness); \ No newline at end of file