Merge pull request #349 from revarbat/revarbat_dev

orig sphere matching to builtin.
This commit is contained in:
Revar Desmera 2020-12-28 03:37:34 -08:00 committed by GitHub
commit 0dac4510a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -1211,13 +1211,13 @@ module spheroid(r, d, circum=false, style="aligned", anchor=CENTER, spin=0, orie
vsides = ceil(sides/2);
attachable(anchor,spin,orient, r=r) {
if (style=="orig") {
merids = [ for (i=[0:1:vsides]) 90-(i+0.5)*180/(vsides+1) ];
merids = [ for (i=[0:1:vsides-1]) 90-(i+0.5)*180/vsides ];
path = [
let(a = merids[0]) [0, r*sin(a)],
for (a=merids) r * [cos(a), sin(a)],
let(a = select(merids,-1)) [0, r*sin(a)]
let(a = merids[0]) [0, sin(a)],
for (a=merids) [cos(a), sin(a)],
let(a = select(merids,-1)) [0, sin(a)]
];
rotate_extrude(convexity=2,$fn=sides) polygon(path);
scale(r) rotate(180) rotate_extrude(convexity=2,$fn=sides) polygon(path);
} else {
vnf = spheroid(r=r, circum=circum, style=style);
vnf_polyhedron(vnf, convexity=2);

View File

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