progress
authorTomas Mudrunka <tomas.mudrunka@gmail.com>
Sat, 18 Jan 2025 18:16:27 +0000 (19:16 +0100)
committerTomas Mudrunka <tomas.mudrunka@gmail.com>
Sat, 18 Jan 2025 18:16:27 +0000 (19:16 +0100)
openscad/cam_turret.scad
openscad/camera_aliexpress.scad

index 9c5357c49a72a259a90df8f65cf9b93b307372c5..89b93975bfb57cfa4616bbd79079380224a0190c 100644 (file)
@@ -1,13 +1,14 @@
 $fn=100;
 dia=45;
+tol=0.3; //Worst case scenario for well maintained ender3 :-)
 
-module camball(d, cutout=0, lens=30) {
-       sphere(d=d);
+module camball(d, cutout=0, toler=0, lens=30) {
+       sphere(d=d+(toler*2));
        if(cutout) {
-               union() {
-                       sphere(d=d);
-                       translate([0,0,-d]) cylinder(d=d-4, h=d);
-               }
+               //Hole to insert the ball
+               translate([0,0,-d]) cylinder(d1=d+4, d2=d-4, h=d);
+               
+               //Range of ball rotation:
                hull() for ( i = [-10 : 20 : 90] ) {
                        rotate([i,0,0]) cylinder(d1=d/1.5, d2=d/1.3, h=d);
                }
@@ -15,46 +16,64 @@ module camball(d, cutout=0, lens=30) {
 }
 
 module screw() {
-       cylinder(d=5, h=100, center=true);
-       rotate([0,  0,0]) translate([0,0,5]) cylinder(d=10, h=100);
-       rotate([0,180,0]) translate([0,0,5]) cylinder(d=10, h=100);
+       rotate([0,0,30]) cylinder(d=5, h=100, center=true, $fn=6);
+       $fn=6;
+       rotate([0,  0,40]) translate([0,0,20]) cylinder(d=10, h=100);
+       rotate([180,0,40]) translate([0,0,20]) cylinder(d=10, h=100);
 }
 
 module ballholder(d) {
        difference() {
+               //Outer cone shape
                hull() {
                        sphere(d=d+4);
                        translate([0,0,-d/2-5]) cylinder(d=d+30, h=5);
                }
+               
+               //This makes everything more flexy
+               hull() {
+                       sphere(d=d+4);
+                       translate([0,d/2,-d/2-10]) cylinder(d=d/2, h=10);
+               }
+               
+               //Split to make it clamp
                translate([0,-500,0]) cube([1.5,1000,1000], center=true);
+               
+               //Clamp screw hole
                translate([0,-d/1.5,-d/2.1]) rotate([0,90,0]) screw();
        }
 }
 
-module baseplate(d) {
+module baseplate(d, toler=0) {
+       dt = toler*2;
        difference() {
+               //Flange
                union() {
-                       translate([0,0,-d/2-2]) cylinder(d1=d+3, d2=d, h=2);
-                       translate([0,0,-d/2-5]) cylinder(d1=d, d2=d+3, h=3);
-                       translate([0,0,-d/2-9.99]) cylinder(d=d+30, h=5);
+                       translate([0,0,-d/2-2]) cylinder(d1=d+3+dt, d2=d+dt, h=2);
+                       translate([0,0,-d/2-5]) cylinder(d1=d+dt, d2=d+3+dt, h=3);
+                       translate([0,0,-d/2-9.99]) cylinder(d1=d+30+dt, d2=d+30+dt, h=5+toler);
                }
+               
+               //Hole for cables
                cylinder(d=d-10, h=1000, center=true);
                
-               //Standart EU junction box mounting holes
-               for(i = [0 : 90 : 360]) {
-                       rotate([0,0,i]) translate([30,0,0])
-                       cylinder(d=4, h=1000, center=true);     
+               //Standart EU junction box mounting holes (60mm pitch)
+               if(!toler) for(i = [0 : 90 : 360]) {
+                       rotate([0,0,i]) translate([30,0,0]) {
+                               cylinder(d=4, h=1000, center=true);
+                               translate([0,0,-29]) cylinder(d1=7, d2=10, h=2.1);
+                       }
                }
        }
 }
 
 
 
-//camball(d=dia, cutout=0);
+camball(d=dia, cutout=0);
 %difference() {
        ballholder(dia);        
-       camball(d=dia, cutout=1);
-       baseplate(dia);
+       camball(d=dia, cutout=1, toler=tol);
+       baseplate(dia, toler=tol);
 }
 
 //camball(d=dia, cutout=1);
index 6ab485526791883df521a7c683254c501ec4e390..afd892656c7f2db51f40add86d4002379b9f942a 100644 (file)
@@ -1,21 +1,28 @@
-$fn=256;
-
-module camera(zclr=0) {
-       translate([0,0,-zclr/2]) cube([21.5,21.5,18+zclr], center=true);
-       cylinder(d=18, h=9+5+zclr);
+module camera(zclr=0) union() {
+       cylinder(d=19, h=9+5+zclr, $fn=24); //lens
+       cube([21.5,21.5,18], center=true); //body
+       if(zclr) hull() {
+               translate([0,0,-9]) cube([21.5,21.5,1], center=true);
+               translate([0,0,-67]) cylinder(d=31, h=45);
+       }
+       
 }
 
 module camera_ball() {
        difference() {
                intersection() {
-                       sphere(d=45);
+                       sphere(d=45, $fn=256);
                        translate([0,0,2]) cube([1000,1000,35], center=true);
                }
                translate([0,0,6.5]) {
                        camera(zclr=100);
                }
+               //translate([0,0,-45/1.5]) sphere(d=45);
        }
 }
 
-camera_ball();
-//translate([0,0,6.5]) camera();
\ No newline at end of file
+//sphere(d=45);
+rotate([180,0,0]) {
+       camera_ball();
+       //translate([0,0,6.5]) camera(zclr=100);
+}
\ No newline at end of file
This page took 0.216054 seconds and 4 git commands to generate.