Files
MEngine/lovejoy.scad

51 lines
1.1 KiB
OpenSCAD
Raw Normal View History

use <PolyGear/PolyGear.scad>
use <PolyGear/PolyGearBasics.scad>
use <PolyGear/shortcuts.scad>
module spider_section(ir=6,or=13, l=6, lt=1, h, die=false) {
a = 360/l;
cx=or-ir+.2;
for (r=[0,a])
rotate([0,0,r])
translate([ir+cx/2-.2,0,0]) cube([cx, die ? lt+.2 : lt, h], center=true);
if (die) {
RiS(R=or, r=0, h=h, w1=0, w2=60);
Ri(R=ir+.4, r=0, h=h);
} else {
Ri(R=ir, r=ir-lt, h=h);
}
}
module spider(ir=6, sd=9, or=13, l=6, lt=1, h=3, die=false) {
difference() {
union() {
for (i=[0 : 1 : l-1])
if (i % 2) rotate([0,0,i*360/l]) spider_section(ir=ir,h=h,die=die);
}
}
}
module lovejoy(ph=5, jh=3) {
ir = ($children < 1) ? 4.2 : 0;
difference() {
translate([0,0,-(jh+ph)/2]) Ri(R=13-.1,r=ir,h=ph+jh);
translate([0,0,-jh/2+.01]) spider(ir=6, die=true, h=jh+.1);
if ($children > 0)
children();
}
}
if (! $preview) {
$fs= .1;
$fn= 60;
}
color("pink")
lovejoy() translate([0,0,-6]) cylinder(r=2, h=12, $fn=4, center=true);
color("green")
translate([0,0,0]) spider(ir=6, die=false, h=3);
color("blue")
rotate([180,0,0]) {
lovejoy();
}
//translate([tan(60),0,-2]) color("yellow") cube([.1,1,5]);