mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
Added a few demos.
This commit is contained in:
parent
5769ef1036
commit
618d0557ca
4 changed files with 51 additions and 1 deletions
14
examples/cubic_sphere_packing.scad
Normal file
14
examples/cubic_sphere_packing.scad
Normal 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
|
16
examples/hex_sphere_packing.scad
Normal file
16
examples/hex_sphere_packing.scad
Normal 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
|
20
examples/spherical_patch.scad
Normal file
20
examples/spherical_patch.scad
Normal 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
|
|
@ -8,7 +8,7 @@
|
|||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
BOSL_VERSION = [2,0,239];
|
||||
BOSL_VERSION = [2,0,240];
|
||||
|
||||
|
||||
// Section: BOSL Library Version Functions
|
||||
|
|
Loading…
Reference in a new issue