2022-11-19 12:13:00 -05:00
|
|
|
use <PolyGear/PolyGear.scad>
|
|
|
|
|
use <PolyGear/PolyGearBasics.scad>
|
|
|
|
|
use <PolyGear/shortcuts.scad>
|
|
|
|
|
|
2022-11-22 10:55:05 -05:00
|
|
|
render_fn = 180;
|
|
|
|
|
render_fa = .5;
|
|
|
|
|
render_fs = .2;
|
|
|
|
|
|
|
|
|
|
$fn= ($preview) ? 30 : render_fn;
|
|
|
|
|
$fa= ($preview) ? $fa : render_fa;
|
|
|
|
|
$fs= ($preview) ? $fs : render_fs;
|
2022-11-19 12:13:00 -05:00
|
|
|
|
|
|
|
|
module spider_section(ir=6,or=13, l=6, lt=1, h, die=false) {
|
2022-11-22 10:55:05 -05:00
|
|
|
//a = 360/l;
|
2022-11-19 12:13:00 -05:00
|
|
|
a = 360/l;
|
2022-11-22 10:55:05 -05:00
|
|
|
cx=or-ir;
|
2022-11-19 12:13:00 -05:00
|
|
|
if (die) {
|
2022-11-22 10:55:05 -05:00
|
|
|
RiS(R=or+.01, r=0, h=h+.01, w1=0, w2=60);
|
|
|
|
|
Ri(R=ir+.2, r=0, h=h+.01);
|
|
|
|
|
spider_section(ir=ir,or=or,l=l,lt=lt+.2,h=h+.01,die=false);
|
2022-11-19 12:13:00 -05:00
|
|
|
} else {
|
2022-11-22 10:55:05 -05:00
|
|
|
for (r= [0,a])
|
|
|
|
|
rotate([0,0,r])
|
|
|
|
|
translate([ir+lt/2,0,0])
|
|
|
|
|
cube([or-ir+lt, lt, h], center=true);
|
2022-11-19 12:13:00 -05:00
|
|
|
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])
|
2022-11-22 10:55:05 -05:00
|
|
|
if (i % 2) rotate([0,0,i*360/l]) spider_section(ir=ir,or=or,h=h,die=die);
|
2022-11-19 12:13:00 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-22 10:55:05 -05:00
|
|
|
module lovejoy(
|
|
|
|
|
ph=5, // Plate Height
|
|
|
|
|
r=13, // Diameter
|
|
|
|
|
jh=3, // Jaw Height
|
|
|
|
|
align = true,
|
|
|
|
|
bc=undef, // base color
|
|
|
|
|
cc=undef // cut color
|
|
|
|
|
) {
|
|
|
|
|
//ir = ($children < 1) ? 4.2 : 0;
|
|
|
|
|
dz = align ? -ph : 0;
|
|
|
|
|
translate([0,0,dz]) difference() {
|
2022-11-19 12:13:00 -05:00
|
|
|
// Body
|
2022-11-22 10:55:05 -05:00
|
|
|
assert($children<3, "Lovejoy only supports up to 2 children.");
|
|
|
|
|
union() {
|
|
|
|
|
// Base Plate.
|
|
|
|
|
color(bc)
|
|
|
|
|
cylinder(r=r, h=ph+jh); //Ri(R=d,r=ir,h=ph+jh);
|
|
|
|
|
// Child 0 adds to base
|
|
|
|
|
if ($children > 0) children(0);
|
|
|
|
|
}
|
2022-11-19 12:13:00 -05:00
|
|
|
// Cuts
|
2022-11-22 10:55:05 -05:00
|
|
|
translate([0,0,ph+jh/2])
|
|
|
|
|
color(cc) spider(ir=2, or=r, die=true, h=jh);
|
2022-11-19 12:13:00 -05:00
|
|
|
// Center Cuts
|
2022-11-22 10:55:05 -05:00
|
|
|
if ($children > 1) translate([0,0,-.01]) children(1);
|
2022-11-19 12:13:00 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
color("pink")
|
2022-11-22 10:55:05 -05:00
|
|
|
lovejoy(r=4, ph=5, jh=3, align=false) {
|
|
|
|
|
union();
|
|
|
|
|
cylinder(h=8,d=4);
|
|
|
|
|
}
|