Files
crystalballer/Baller.scad

160 lines
3.2 KiB
OpenSCAD
Raw Normal View History

2021-01-14 15:44:07 -05:00
use <inserts.scad>
use <threads.scad>
2021-01-15 09:40:59 -05:00
$fa = ($preview) ? 12 : 1;
$fs = ($preview) ? 2 : 1;
2021-01-14 15:44:07 -05:00
$incolor = false;
2021-01-15 09:40:59 -05:00
module ball(insert=true, top = true, bottom = true) {
2021-01-14 15:44:07 -05:00
bd=65;
difference() {
2021-01-15 09:40:59 -05:00
intersection() {
sphere(d=bd);
for (i = [-1, 1])
if ((i<0 && bottom) || (i>0 && top))
translate([0,0,i*bd/2])
cube([bd, bd, bd],center=true);
}
if (insert) for (iz = [-bd/2, bd/2]) {
rot = (iz < 0) ? 180 : 0;
//translate([0,0,bd/2])thread_insertM3($die=true);
translate([0,0,iz])
rotate([0,rot,0]) thread_insertM3($die=true);
}
2021-01-14 15:44:07 -05:00
}
}
module post() {
translate([0,0,0])cylinder(d=6, h=77, center=true);
}
module underball() {
translate([0,0,0]) intersection() {
cylinder(d=65, h=5, center=true);
translate([0,0,-48]) sphere(d=100, $fa=3);
}
2021-01-15 09:40:59 -05:00
translate([0,0,5])
cylinder(d=55, h=10, center=true);
translate([0,0,9])
rotate_extrude(angle=360)
translate([10+15/2,0,0])
circle(d=20);
2021-01-14 15:44:07 -05:00
}
module ring(d,id) {
rotate_extrude(angle=360) translate([(d+id)/2,0,0])circle(d=d);
}
//ball();
//underball();
BallD = 65;
2021-01-15 09:40:59 -05:00
module top(
bd,
c_base = $incolor ? "yellow" : undef,
c_seal = $incolor ? "red" : undef,
c_ins = $incolod ? "silver" : undef
) {
color(c_base) cylinder(d=95, h=4);
2021-01-14 15:44:07 -05:00
translate([0,0,4]) {
difference() {
2021-01-15 09:40:59 -05:00
color(c_base) sphere(d=bd);
2021-01-14 15:44:07 -05:00
translate([0,0,-70/2])cylinder(d=95, h=70/2);
}
cylinder(d=10, id=bd/2);
2021-01-15 09:40:59 -05:00
color(c_seal) ring(d=5, id=bd+5);
2021-01-14 15:44:07 -05:00
cylinder(d=8, h=bd/2+5);
}
2021-01-15 09:40:59 -05:00
cylinder(d=100, h=1+8);
translate([0,0,1+8-8])
metric_thread(diameter=95,length=8.01, internal=true);
2021-01-14 15:44:07 -05:00
2021-01-15 09:40:59 -05:00
cylinder(d=92, h=1+6);
2021-01-14 15:44:07 -05:00
}
2021-01-15 09:40:59 -05:00
module middle_top(
bd,
c_base = $incolor ? "yellow" : undef,
c_seal = $incolor ? "red" : undef,
c_ins = $incolod ? "silver" : undef
) {
2021-01-14 15:44:07 -05:00
difference() {
2021-01-15 09:40:59 -05:00
color(c_base) cylinder(d=95, h=4);
translate([0,0,4])
color(c_seal)
ring(d=5, id=bd+5);
2021-01-14 15:44:07 -05:00
}
translate([0,0,4]) {
difference() {
2021-01-15 09:40:59 -05:00
color(c_base) sphere(d=bd);
2021-01-14 15:44:07 -05:00
translate([0,0,-70/2])cylinder(d=95, h=70/2);
}
cylinder(d=10, id=bd/2);
cylinder(d=8, h=bd/2+4);
}
difference() {
2021-01-15 09:40:59 -05:00
cylinder(d=100, h=1+8);
translate([0,0,1+8-8])
metric_thread(diameter=95, length=8.01, internal=true);
2021-01-14 15:44:07 -05:00
cylinder(d=92, h=1+6);
}
}
2021-01-15 09:40:59 -05:00
module middle_bottom(
bd,
c_base = $incolor ? "yellow" : undef,
c_seal = $incolor ? "red" : undef,
c_ins = $incolod ? "silver" : undef
) {
2021-01-14 15:44:07 -05:00
difference() {
2021-01-15 09:40:59 -05:00
color(c_base) cylinder(d=95, h=4);
translate([0,0,4]) color(c_seal) ring(d=5, id=bd+5);
2021-01-14 15:44:07 -05:00
}
translate([0,0,4]) {
underball();
cylinder(d=10, id=bd/2);
cylinder(d=8, h=20);
}
difference() {
union() {
cylinder(d=100, h=1+8);
}
translate([0,0,1+8-8])metric_thread(diameter=95,length=8.01, internal=true);
cylinder(d=92, h=1+6);
}
}
// 20 + bd/2+4
module middle(bd, bh=20) {
tot = bd/2 + bh;
th = 2*8;
midl=tot-th;
difference() {
union() {
translate([0,0,8])cylinder(d=100, h=midl);
metric_thread(diameter=95,length=8.01);
translate([0,0,8+midl]) metric_thread(diameter=95,length=8.01);
}
translate([0,0,-.01]) cylinder(d=92, h=tot+1);
}
}
2021-01-15 09:40:59 -05:00
module plate_full() {
translate([100,100]) top(bd=BallD);
middle(bd=BallD);
translate([0,100]) middle_bottom(bd = BallD);
translate([100,0]) middle_top(bd = BallD);
}
//plate_full();
ball(bottom=false);