Add a build system.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 28 Oct 2022 00:35:18 +0000 (01:35 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 28 Oct 2022 00:35:18 +0000 (01:35 +0100)
.gitignore [new file with mode: 0644]
.skelrc [new file with mode: 0644]
Makefile [new file with mode: 0644]
discpick-collar.scad

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..8d5f2ba
--- /dev/null
@@ -0,0 +1,2 @@
+*.dep
+*.stl
diff --git a/.skelrc b/.skelrc
new file mode 100644 (file)
index 0000000..1b7dea4
--- /dev/null
+++ b/.skelrc
@@ -0,0 +1,8 @@
+;;; -*-emacs-lisp-*-
+
+(setq skel-alist
+      (append
+       '((author . "Mark Wooding")
+        (licence-text . "[[gpl-3]]"))
+       skel-alist))
+
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..2e4f2f1
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,53 @@
+### -*-makefile-gmake-*-
+###
+### Build OpenSCAD models
+###
+### (c) 2022 Mark Wooding
+###
+
+###----- Licensing notice ---------------------------------------------------
+###
+### This program is free software: you can redistribute it and/or modify
+### it under the terms of the GNU General Public License as published by
+### the Free Software Foundation; either version 3 of the License, or (at
+### your option) any later version.
+###
+### This program is distributed in the hope that it will be useful, but
+### WITHOUT ANY WARRANTY; without even the implied warranty of
+### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+### General Public License for more details.
+###
+### You should have received a copy of the GNU General Public License
+### along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+all:
+
+## `Silent-rules' machinery.
+V                       = 0
+V_AT                    = $(V_AT).$V
+V_AT.0                  = @
+v-tag                   = $(call v-tag.$V,$1)
+v-tag.0                         = @printf "  %-8s %s\n" "$1" "$@";
+
+## Other configuration.
+OPENSCAD                = openscad
+
+## Main list of models.
+MODELS                 += discpick-collar.scad
+
+## Building models.
+CLEANFILES             += *.stl
+%.stl: %.scad
+       $(call v-tag,SCAD)$(OPENSCAD) -o$@ -d$*.dep $<
+STLS                    = $(MODELS:.scad=.stl)
+all: $(STLS)
+
+## Dependency file management.
+CLEANFILES             += *.dep
+DEPS                   += $(MODELS:.scad=.dep)
+-include $(DEPS)
+
+## Cleaning up.
+clean:; rm -f $(CLEANFILES)
+
+###----- That's all, folks --------------------------------------------------
index 87d3c46..0497b63 100644 (file)
@@ -1,31 +1,80 @@
-MM = 1;
+/* -*-c-*-
+ *
+ * A spacer for the Sparrows disc-detainer picking tool
+ *
+ * (c) 2022 Mark Wooding
+ */
 
-CUT_WD = 10*MM;
-BORE_DIAM = 6*MM;
-SPACER_HT = 7.25*MM;
-HEIGHT = SPACER_HT + 3*MM;
-THICK = 16*MM;
-WIDTH = 18*MM;
+/*----- Licensing notice --------------------------------------------------*
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
 
-BIG = 20*MM;
+/*----- Configuration -----------------------------------------------------*/
+
+/* Overall scaling. */
+MM = 1;
 
+/* Curvature quality. */
 $fa = 0.1;
 $fs = 0.2*MM;
 
+/* A `large enough' length; effectively infinite. */
+BIG = 20*MM;
+
+/* Dimensions. */
+CUT_WD = 10*MM;                                /* width of the cut in the top */
+BORE_DIAM = 6*MM;                      /* diameter of hole down the mid */
+SPACER_HT = 7.25*MM;                   /* height of the offset */
+HEIGHT = SPACER_HT + 3*MM;             /* overall ht, including shelves */
+THICK = 16*MM;                         /* thickness */
+WIDTH = 18*MM;                         /* width */
+
+/*----- The main object ---------------------------------------------------*/
 
 difference() {
   intersection() {
+
+    /* Start with a bounding parallelepiped.  We're going to shave pieces of
+     * this to make the actual object.
+     */
     translate([-WIDTH/2, -THICK/2, 0])
       cube([WIDTH, THICK, HEIGHT]);
+
+    /* Round off the vertical edges. */
     cylinder(h = HEIGHT, r = norm([CUT_WD/2, WIDTH/2]));
+
+    /* Round off the shelves that sit around the pick body. */
     rotate([0, 90, 0])
       translate([0, 0, -BIG/2])
       cylinder(h = BIG, r = norm([HEIGHT, CUT_WD/2]));
   }
+
   union() {
+
+    /* Cut out the channel in which the pick body sits, leaving the shelves
+     * on either side.
+     */
     translate([-BIG/2, -CUT_WD/2, SPACER_HT])
       cube([BIG, CUT_WD, BIG]);
+
+    /* Bore the hole down the middle through which the tensioning prongs and
+     * pick fit.
+     */
     translate([0, 0, -BIG/3])
       cylinder(h = BIG, r = BORE_DIAM/2);
   }
 }
+
+/*----- That's all, folks -------------------------------------------------*/