2009-06-20 16:10:55 +04:00
|
|
|
|
2009-06-21 15:41:11 +04:00
|
|
|
module test001()
|
|
|
|
{
|
|
|
|
function r_from_dia(d) = d / 2;
|
2009-06-21 12:59:53 +04:00
|
|
|
|
2009-06-21 15:41:11 +04:00
|
|
|
module rotcy(rot, r, h) {
|
2009-06-27 11:31:40 +04:00
|
|
|
rotate(90, rot) cylinder(r = r, h = h, center = true);
|
2009-06-21 15:41:11 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
difference() {
|
|
|
|
sphere(r = r_from_dia(size));
|
2009-06-27 11:31:40 +04:00
|
|
|
rotcy([0 0 0], cy_r, cy_h);
|
|
|
|
rotcy([1 0 0], cy_r, cy_h);
|
|
|
|
rotcy([ 0 1 0], cy_r, cy_h);
|
2009-06-21 15:41:11 +04:00
|
|
|
}
|
2009-06-21 12:59:53 +04:00
|
|
|
|
2009-06-27 11:31:40 +04:00
|
|
|
size = 50;
|
|
|
|
hole = 25;
|
2009-06-21 15:41:11 +04:00
|
|
|
|
|
|
|
cy_r = r_from_dia(hole);
|
2009-06-27 11:31:40 +04:00
|
|
|
cy_h = r_from_dia(size * 2.5);
|
2009-06-20 16:10:55 +04:00
|
|
|
}
|
|
|
|
|
2009-06-21 15:41:11 +04:00
|
|
|
module test002()
|
2009-06-23 15:28:35 +04:00
|
|
|
{
|
2009-06-24 02:32:08 +04:00
|
|
|
intersection() {
|
|
|
|
difference() {
|
2009-06-24 19:39:08 +04:00
|
|
|
union() {
|
2009-06-27 11:31:40 +04:00
|
|
|
cube([30 30 30], center = true);
|
|
|
|
translate([0 0 -25])
|
|
|
|
cube([15 15 50], center = true);
|
2009-06-24 19:39:08 +04:00
|
|
|
}
|
|
|
|
union() {
|
2009-06-27 11:31:40 +04:00
|
|
|
cube([50 10 10], center = true);
|
|
|
|
cube([10 50 10], center = true);
|
|
|
|
cube([10 10 50], center = true);
|
2009-06-24 19:39:08 +04:00
|
|
|
}
|
2009-06-24 02:32:08 +04:00
|
|
|
}
|
2009-06-27 11:31:40 +04:00
|
|
|
translate([0 0 5])
|
|
|
|
cylinder(h = 50, r1 = 20, r2 = 5, center = true);
|
2009-06-24 02:32:08 +04:00
|
|
|
}
|
2009-06-23 15:28:35 +04:00
|
|
|
}
|
|
|
|
|
2009-06-27 11:31:40 +04:00
|
|
|
module test003()
|
2009-06-25 13:49:28 +04:00
|
|
|
{
|
|
|
|
difference() {
|
|
|
|
union() {
|
2009-06-27 11:31:40 +04:00
|
|
|
cube([30 30 30], center = true);
|
|
|
|
cube([40 15 15], center = true);
|
|
|
|
cube([15 40 15], center = true);
|
|
|
|
cube([15 15 40], center = true);
|
2009-06-25 13:49:28 +04:00
|
|
|
}
|
|
|
|
union() {
|
2009-06-27 11:31:40 +04:00
|
|
|
cube([50 10 10], center = true);
|
|
|
|
cube([10 50 10], center = true);
|
|
|
|
cube([10 10 50], center = true);
|
2009-06-25 13:49:28 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-06-27 11:31:40 +04:00
|
|
|
module test004()
|
2009-06-26 21:27:05 +04:00
|
|
|
{
|
|
|
|
difference() {
|
2009-06-27 11:31:40 +04:00
|
|
|
cube(30, center = true);
|
|
|
|
sphere(20);
|
2009-06-26 21:27:05 +04:00
|
|
|
}
|
2009-06-26 14:56:50 +04:00
|
|
|
}
|
2009-06-26 21:27:05 +04:00
|
|
|
|
2009-06-30 22:05:10 +04:00
|
|
|
module test005()
|
|
|
|
{
|
|
|
|
translate([0 0 -120]) {
|
|
|
|
difference() {
|
|
|
|
cylinder(h = 50, r = 100);
|
|
|
|
translate([0 0 10]) cylinder(h = 50, r = 80);
|
|
|
|
translate([100 0 35]) cube(50, center = true);
|
|
|
|
}
|
|
|
|
for (i = [0:5]) {
|
|
|
|
echo(360*i/6, sin(360*i/6)*80, cos(360*i/6)*80);
|
|
|
|
translate([sin(360*i/6)*80, cos(360*i/6)*80, 0 ])
|
|
|
|
cylinder(h = 200, r=10);
|
|
|
|
}
|
|
|
|
translate([0 0 200])
|
|
|
|
cylinder(h = 80, r1 = 120, r2 = 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-06-27 11:31:40 +04:00
|
|
|
test001();
|
2009-06-30 22:05:10 +04:00
|
|
|
|