Skip to content

Commit

Permalink
Update openscad_build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
masuidrive authored Sep 8, 2023
1 parent 5b121d9 commit 89f9adc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/openscad_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ jobs:
find . -name "*.scad" | grep -v "^./lib/" | while read scad; do
stl_path="${scad%.scad}.stl"
openscad -o $stl_path $scad
for angle in 0 90 180 270; do
png_path="${scad%.scad}_${angle}.png"
openscad --camera=0,0,0,0,0,$angle --render --imgsize=256,256 -o $png_path $scad
angles=("0,0,0" "70,330,0" "140,0,0" "210,330,0")
for angle in "${angles[@]}"; do
png_path="${scad%.scad}_$(echo $angle | tr ',' '-').png"
openscad --camera=$angle --colorscheme="Tomorrow" --render --imgsize=512,512 -o $png_path $scad
done
done
'
- name: Convert PNG thumbnails to WebP
run: |
for png in $(find . -name "*.png"); do
Expand Down Expand Up @@ -63,4 +65,4 @@ jobs:
git checkout -b gh-pages
git add ./*.stl **/*.stl ./*.webp **/*.webp index.html
git commit -m "Update STL files and WebP thumbnails generated by GitHub Actions"
git push -f origin gh-pages
git push -f origin gh-pages

0 comments on commit 89f9adc

Please sign in to comment.