From 618d0557cac1cf8e605a7fd370a4426924e28ee2 Mon Sep 17 00:00:00 2001 From: Revar Desmera Date: Sat, 28 Mar 2020 20:51:06 -0700 Subject: [PATCH] Added a few demos. --- examples/cubic_sphere_packing.scad | 14 ++++++++++++++ examples/hex_sphere_packing.scad | 16 ++++++++++++++++ examples/spherical_patch.scad | 20 ++++++++++++++++++++ version.scad | 2 +- 4 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 examples/cubic_sphere_packing.scad create mode 100644 examples/hex_sphere_packing.scad create mode 100644 examples/spherical_patch.scad diff --git a/examples/cubic_sphere_packing.scad b/examples/cubic_sphere_packing.scad new file mode 100644 index 0000000..41221b3 --- /dev/null +++ b/examples/cubic_sphere_packing.scad @@ -0,0 +1,14 @@ +include +include + +//$fa=2; +//$fs=2; + +s = 20; +s2 = s * sin(45); +zcopies(s2,n=8) union() + grid2d([s2,s2],n=8,stagger=($idx%2)? true : "alt") + sphere(d=s); + + +// vim: noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap diff --git a/examples/hex_sphere_packing.scad b/examples/hex_sphere_packing.scad new file mode 100644 index 0000000..23182b5 --- /dev/null +++ b/examples/hex_sphere_packing.scad @@ -0,0 +1,16 @@ +include +include + +//$fa=2; +//$fs=2; + +s = 20; +xyr = adj_ang_to_hyp(s/2,30); +h = hyp_adj_to_opp(s,xyr); +zcopies(h,n=8) union() + back(($idx%2)*xyr*cos(60)) + grid2d(s,n=[12,7],stagger=($idx%2)? "alt" : true) + sphere(d=s); + + +// vim: noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap diff --git a/examples/spherical_patch.scad b/examples/spherical_patch.scad new file mode 100644 index 0000000..364b41d --- /dev/null +++ b/examples/spherical_patch.scad @@ -0,0 +1,20 @@ +include +include + +// Makes a pseudo-sphere from a rectangular patch and its mirror. +s = 50/sqrt(2); +d = [[1,1,0],[-1,1,0],[-1,-1,0],[1,-1,0]]; +p = s * d; +q = s * 0.55 * d; +u = s * 2.5 * UP; +patch1 = [ + [p[1], p[1]+q[0], p[0]+q[1], p[0] ], + [p[1]+q[2], p[1]+q[1]+u, p[0]+q[0]+u, p[0]+q[3]], + [p[2]+q[1], p[2]+q[2]+u, p[3]+q[3]+u, p[3]+q[0]], + [p[2], p[2]+q[3], p[3]+q[2], p[3] ], +]; +patch2 = patch_reverse(zflip(p=patch1)); +trace_bezier_patches([patch1, patch2], splinesteps=16, style="quincunx"); + + +// vim: noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap diff --git a/version.scad b/version.scad index 8807d1f..5b980b2 100644 --- a/version.scad +++ b/version.scad @@ -8,7 +8,7 @@ ////////////////////////////////////////////////////////////////////// -BOSL_VERSION = [2,0,239]; +BOSL_VERSION = [2,0,240]; // Section: BOSL Library Version Functions