Added a few demos.

This commit is contained in:
Revar Desmera 2020-03-28 20:51:06 -07:00
parent 5769ef1036
commit 618d0557ca
4 changed files with 51 additions and 1 deletions

View file

@ -0,0 +1,14 @@
include <BOSL2/std.scad>
include <BOSL2/beziers.scad>
//$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

View file

@ -0,0 +1,16 @@
include <BOSL2/std.scad>
include <BOSL2/beziers.scad>
//$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

View file

@ -0,0 +1,20 @@
include <BOSL2/std.scad>
include <BOSL2/beziers.scad>
// 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

View file

@ -8,7 +8,7 @@
//////////////////////////////////////////////////////////////////////
BOSL_VERSION = [2,0,239];
BOSL_VERSION = [2,0,240];
// Section: BOSL Library Version Functions