Quellcode durchsuchen

remove STLs and add workflow to generate them

Thomas Buck vor 8 Monaten
Ursprung
Commit
f2c91ff507

+ 46
- 0
.github/workflows/scad.yml Datei anzeigen

@@ -0,0 +1,46 @@
1
+name: STLs
2
+
3
+# build for each push and pull request
4
+on: [push, pull_request]
5
+
6
+jobs:
7
+  render:
8
+    runs-on: ubuntu-latest
9
+
10
+    permissions:
11
+      contents: write
12
+
13
+    steps:
14
+      - name: Checkout repo
15
+        uses: actions/checkout@v4
16
+        with:
17
+          fetch-depth: 0
18
+
19
+      - name: Checkout repo submodules
20
+        run: git submodule update --init
21
+
22
+      - name: Install dependencies
23
+        run: sudo apt-get install -y openscad zip
24
+
25
+      - name: Render STLs
26
+        run: |
27
+          ./3dprint/generate_stls.sh
28
+
29
+      - name: Upload part files
30
+        uses: actions/upload-artifact@v4.0.0
31
+        with:
32
+          name: drumkit-stl
33
+          path: 3dprint/stl
34
+          if-no-files-found: error
35
+
36
+      - name: Archive release files
37
+        if: startsWith(github.ref, 'refs/tags/')
38
+        run: |
39
+          cd 3dprint
40
+          zip -r drumkit-stl stl
41
+
42
+      - name: Upload release files
43
+        if: startsWith(github.ref, 'refs/tags/')
44
+        uses: softprops/action-gh-release@v1
45
+        with:
46
+          files: 3dprint/drumkit-stl.zip

+ 2
- 0
.gitignore Datei anzeigen

@@ -11,3 +11,5 @@ pcb/fab.zip
11 11
 docs/book
12 12
 docs/src/plot
13 13
 docs/src/inc_*.md
14
+
15
+3dprint/stl

BIN
3dprint/beam.stl Datei anzeigen


+ 53
- 0
3dprint/generate_stls.sh Datei anzeigen

@@ -0,0 +1,53 @@
1
+#!/bin/bash
2
+
3
+# ----------------------------------------------------------------------------
4
+# Copyright (c) 2023 Kauzerei (openautolab@kauzerei.de)
5
+# Copyright (c) 2023 Thomas Buck (thomas@xythobuz.de)
6
+#
7
+# This program is free software: you can redistribute it and/or modify
8
+# it under the terms of the GNU General Public License as published by
9
+# the Free Software Foundation, either version 3 of the License, or
10
+# (at your option) any later version.
11
+#
12
+# This program is distributed in the hope that it will be useful,
13
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
+# GNU General Public License for more details.
16
+#
17
+# See <http://www.gnu.org/licenses/>.
18
+# ----------------------------------------------------------------------------
19
+
20
+# space separated list of scad files (without extension)
21
+MODULES="actuator beam enclosure tamb_mount"
22
+OUTDIR="stl"
23
+
24
+# enter directory of script (case)
25
+cd "$(dirname "$0")"
26
+
27
+# Detect OS
28
+if [[ "$OSTYPE" == "darwin"* ]]; then
29
+    echo "Mac OS X detected"
30
+    SCAD="open -n -a OpenSCAD --args"
31
+else
32
+    echo "Linux detected"
33
+    SCAD="openscad"
34
+fi
35
+
36
+echo "deleting previous build output"
37
+rm -rf $OUTDIR
38
+mkdir -p $OUTDIR
39
+
40
+for MODULE in $MODULES
41
+do
42
+    PARTS=$(grep -o "part.*//.*\[.*]" ${MODULE}.scad | sed 's/,/ /g' | sed 's/.*\[\([^]]*\)\].*/\1/g')
43
+    echo "generating from ${MODULE}"
44
+
45
+    for PART in ${PARTS}
46
+    do
47
+        if [[ "${PART}" != "OPT_"* ]]; then
48
+            echo ${PART}
49
+            FILENAME=$(echo $OUTDIR/${MODULE}_${PART}.stl | tr '[:upper:]' '[:lower:]')
50
+            $SCAD $(pwd)/${MODULE}.scad --D part=\"${PART}\" --o $(pwd)/${FILENAME}
51
+        fi
52
+    done
53
+done

BIN
3dprint/tamb_mount_inner.stl Datei anzeigen


BIN
3dprint/tamb_mount_outer.stl Datei anzeigen


+ 1
- 0
README.md Datei anzeigen

@@ -2,6 +2,7 @@
2 2
 
3 3
 ![PCB](https://github.com/xythobuz/lars/actions/workflows/kicad.yml/badge.svg)
4 4
 ![Docs](https://github.com/xythobuz/lars/actions/workflows/docs.yml/badge.svg)
5
+![STLs](https://github.com/xythobuz/lars/actions/workflows/scad.yml/badge.svg)
5 6
 
6 7
 This is a simple drum machine / loopstation.
7 8
 It's made for three hand-wound solenoids mounted to a tambourine.

+ 5
- 0
docs/src/3dprint.md Datei anzeigen

@@ -0,0 +1,5 @@
1
+# Mounting Hardware
2
+
3
+**TODO** work in progress
4
+
5
+

+ 1
- 0
docs/src/SUMMARY.md Datei anzeigen

@@ -6,6 +6,7 @@
6 6
 
7 7
 # Hardware
8 8
 
9
+- [Mounting Hardware](./3dprint.md)
9 10
 - [Prototype](./pcb1.md)
10 11
   - [Schematics](./pcb1_sch.md)
11 12
   - [PCB Layout](./pcb1_pcb.md)

Laden…
Abbrechen
Speichern