From 720d25a90ad8d306f3b1bc3413281ac5282c13eb Mon Sep 17 00:00:00 2001
From: Matthew Baggett <matthew@baggett.me>
Date: Tue, 11 Feb 2025 14:17:45 +0100
Subject: [PATCH] Initial andon bits

---
 .gitmodules          |  3 ++
 andon.scad           | 40 ++++++++++++++++++++
 andon_enclosure.scad | 89 ++++++++++++++++++++++++++++++++++++++++++++
 mattscad             |  1 +
 4 files changed, 133 insertions(+)
 create mode 100644 .gitmodules
 create mode 100644 andon.scad
 create mode 100644 andon_enclosure.scad
 create mode 160000 mattscad

diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..892867b
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "mattscad"]
+	path = mattscad
+	url = git@code.techinc.nl:grey/MattSCAD.git
diff --git a/andon.scad b/andon.scad
new file mode 100644
index 0000000..5f4b924
--- /dev/null
+++ b/andon.scad
@@ -0,0 +1,40 @@
+module andon_snout(){
+    translate([0,0,3]){
+        translate([0,0,20-7])cylinder(d=14.7, h=7);
+        cylinder(d=17.5,h=20-7);
+    }
+}
+module andon_interior_hollow(){
+    translate([0,0,3])cylinder(h=20, d=40-6.6);
+}
+module andon_shell(){
+    difference(){
+        hull(){
+            translate([0,0,16-(1/2)])cylinder(h=1,d=40);
+            color("red")translate([0,0,3])rotate_extrude()translate([20-3, 0, 0])circle(r=3);
+        }
+        andon_interior_hollow();
+    }
+}
+
+//color("pink",0.5)translate([0,-50,0])cube([2,100,16.5]);
+//color("pink",0.2)translate([0,-50,0])cube([2,100,23]);
+
+
+module andon_shaft(){
+    color("red"){
+        translate([0,0,20])cylinder(h=3.1,d1=10,d2=11.5);
+        translate([0,0,-5])cylinder(h=23+10,d=7.2);
+        translate([0,0,-1])cylinder(h=7+1,d=10*1.15,$fn=6);
+    }
+}
+
+module andon_reciever(){
+    translate([0,0,-16.5])difference(){
+        union(){
+            andon_snout();
+            andon_shell();
+        }
+        andon_shaft();
+    }
+}
\ No newline at end of file
diff --git a/andon_enclosure.scad b/andon_enclosure.scad
new file mode 100644
index 0000000..f3aed36
--- /dev/null
+++ b/andon_enclosure.scad
@@ -0,0 +1,89 @@
+use <mattscad/mirrorcopy.scad>
+use <andon.scad>
+$fn=$preview?60:240;
+$fn=10;
+radius = 8;
+wall_thickness=3;
+magnet_dia=8;
+magnet_depth=2;
+
+module turret(){
+    translate([0,0,-1])difference(){
+        union(){
+            translate([0,0,20+50])rotate([0,90,0])andon_reciever();
+            // Andon neck
+            difference(){
+                translate([0,0,50-1.5])cylinder(d=30,h=9); 
+                translate([0,0,20+50])rotate([0,90,0])translate([0,0,-16.5])andon_interior_hollow();
+            }
+        }
+        // Hole in andon neck
+        translate([0,0,50-1.5-.5])cylinder(h=10, d=17);
+        // Clearance for other half
+        translate([0,0,50+20])rotate([0,90,0]){
+            difference(){
+                cylinder(d=40,h=20);
+                translate([0,0,-0.5])cylinder(d=25,h=21);
+            }
+        }
+    }
+}
+
+color("white",0.3)turret();
+
+module outer_shell(){
+    hull(){
+        // Lower corners
+        translate([0,-10,0.5])
+            mirrorCopy([0,1,0],[1,0,0])
+                translate([30-radius,50-radius,0])
+                    cylinder(h=1,r=radius,center=true);
+
+        // Upper spheres
+        mirrorCopy([0,1,0],[1,0,0])
+            translate([30-radius-2, 40-radius-2,40])
+                sphere(r=radius);
+    }
+}
+module inner_shell(){
+    hull(){
+        // Lower corners
+        translate([0,-10+2,0+wall_thickness])
+            mirrorCopy([0,1,0],[1,0,0])
+                translate([30-radius-wall_thickness,50-radius-wall_thickness-2,0])
+                    cylinder(h=1,r=radius,center=true);
+
+        // Upper spheres
+        mirrorCopy([0,1,0],[1,0,0])
+            translate([30-radius-2-wall_thickness, 40-radius-2-wall_thickness,40-wall_thickness])
+                sphere(r=radius);
+    }
+}
+module bottom_cover(){
+    difference(){
+        hull(){
+            translate([0,-10+2,0.5-0.01])
+                mirrorCopy([0,1,0],[1,0,0])
+                    translate([30-radius-wall_thickness,50-radius-wall_thickness-2,0])
+                        cylinder(h=1,r=radius,center=true);
+            translate([0,-10+2,0+wall_thickness])
+                mirrorCopy([0,1,0],[1,0,0])
+                    translate([30-radius-wall_thickness,50-radius-wall_thickness-2,0])
+                        cylinder(h=1,r=radius,center=true);
+        }
+        translate([0,-10/1.5,0])
+            mirrorCopy([0,1,0],[1,0,0])
+                translate([30-(wall_thickness*2)-(magnet_dia/2),50-(wall_thickness*2)-(magnet_dia),(magnet_depth/2)-0.02])
+                    cylinder(h=magnet_depth,d=magnet_dia, center=true);
+    }
+}
+
+translate([80,0,0])bottom_cover();
+color("white", 0.3)difference(){
+    outer_shell();
+    inner_shell();
+    hull()bottom_cover();
+    //translate([50,0,50-5])cube([100,200,100], center=true);
+}
+//inner_shell();
+//color("red")bottom_cover();
\ No newline at end of file
diff --git a/mattscad b/mattscad
new file mode 160000
index 0000000..a407f8f
--- /dev/null
+++ b/mattscad
@@ -0,0 +1 @@
+Subproject commit a407f8fc9f3b91593d2aefee4ae77c8d15e1f2d7