123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- conductive = false;
- crossSection = true;
- fillLater = true;
- sizeScreen=4.0;
- sizeFinger=4.0;
- module baseBlock() {
- translate([0,0,3.5])
- cylinder(r=17,h=51, $fa=1, $fs=0.5, center=true);
- }
- module outerRingCutOut() {
- color("blue")
- translate([0,0,-1])
- cylinder(r=14,h=30, $fa=1, $fs=0.5, center=true);
- }
- module fillInHole() {
- color("blue")
- translate([0,0,23])
- cylinder(r=1,h=14, $fa=1, $fs=0.5, center=true);
- }
- module partingWallInner() {
- color("blue")
- cylinder(r=6.5,h=30, $fa=1, $fs=0.5, center=true);
- }
- module partingWallOuter() {
- cylinder(r=8,h=30, $fa=1, $fs=0.5, center=true);
- }
- module partingWall() {
- translate([0,0,-1])
- difference() {
- partingWallOuter();
- partingWallInner();
- }
- }
- module partingWallCeiling() {
- color("blue")
- translate([0,0,14])
- difference() {
- sphere(r=8, center=true);
- sphere(r=6.5, center=true);
- translate([0,0,-5])
- cube([20,20,10], center=true);
- translate([0,0,7])
- rotate([0,0,90])
- cylinder(r=3.5,h=4, $fa=1, $fs=0.5, center=true);
- }
- }
- module ball() {
- color("blue")
- sphere(r=14, center=true);
- }
- module cutCube() {
- translate([0,0,-7.5])
- cube([30,30,15],center=true);
- }
- module ceiling() {
- translate([0,0,14])
- difference() {
- ball();
- cutCube();
- if (fillLater)
- fillInHole();
- }
- }
- module slope() {
- difference() {
- translate([5,0,-16])
- rotate([0,-30,0])
- cylinder(r=16.5, h=20, $fa=1, $fs=0.5, center=true);
-
- partingWallInner();
- }
- }
- module condConnectionHorizontal() {
- color("red")
- translate([-4.5,0,-19])
- cube([12,4,2], center=true);
- }
- module condTouchscreen() {
- color("red")
- translate([0,0,-21])
- cylinder(r=2, h=2, $fa=1, $fs=0.5, center=true);
- }
- module condConnectionVertical() {
- color("red")
- translate([-9.5,0,-16])
- cube([2,4,4], center=true);
- }
- module condFloor() {
- intersection() {
- color("red")
- translate([-9.5,0,-13])
- cube([2,16,2], center=true);
-
- slope();
- }
- }
- module condFinger() {
- difference() {
- intersection() {
- color("red")
- translate([-15.5,0,-8])
- rotate([0,90,0])
- cylinder(r=2, h=4, $fa=1, $fs=0.5, center=true);
-
- baseBlock();
- }
- outerRingCutOut();
- }
- }
- module conductive() {
- union() {
- condConnectionHorizontal();
- condTouchscreen();
- condConnectionVertical();
- condFloor();
- condFinger();
- }
- }
- module completeObject() {
- union() {
- difference() {
- baseBlock();
- union() {
- outerRingCutOut();
- if (fillLater)
- fillInHole();
- ceiling();
- conductive();
-
- }
- }
- partingWall();
- partingWallCeiling();
- difference() {
- intersection() {
- slope();
- baseBlock();
- }
- conductive();
- }
- }
- }
- if (crossSection) {
- difference() {
- if (conductive) {
- conductive();
- }
- else {
- completeObject();
- }
- translate([-30,-60,-30])
- cube([60,60,60]);
- }
- }
- else {
- if (conductive) {
- conductive();
- }
- else {
- completeObject();
- }
- }
|