diff --git a/.gitignore b/.gitignore index 708052f..109336d 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ planning/ *.dxf *.svg *.png +!images/*.png *.echo *.ast *.term diff --git a/README.md b/README.md index aca943e..a85e4e2 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,12 @@ A library of parametric OpenSCAD calibration objects for 3D printers. Each file in `src/` is a reusable library module -- no geometry is generated on `include`, only on an explicit module call. Example entry points live in `examples/`. +![The five calibration towers](images/towers.png) + +![The eight bed level patterns, seen from above](images/bed-level-patterns.png) + +![The XYZ calibration cube and the torture test](images/cube-and-torture-test.png) + ## Modules | Module | File | Description | diff --git a/images/bed-level-patterns.png b/images/bed-level-patterns.png new file mode 100644 index 0000000..9d06bad Binary files /dev/null and b/images/bed-level-patterns.png differ diff --git a/images/cube-and-torture-test.png b/images/cube-and-torture-test.png new file mode 100644 index 0000000..894a197 Binary files /dev/null and b/images/cube-and-torture-test.png differ diff --git a/images/towers.png b/images/towers.png new file mode 100644 index 0000000..816ca92 Binary files /dev/null and b/images/towers.png differ diff --git a/justfile b/justfile index 8ad39e5..cc2ecd5 100644 --- a/justfile +++ b/justfile @@ -13,3 +13,44 @@ test: log=$(openscad --hardwarnings --export-format binstl -o /dev/null "$f" 2>&1) || { echo "$log"; exit 1; } done echo "rendered ${#files[@]} examples" + +# Render the README pictures into images/ (needs ImageMagick) +images: + #!/usr/bin/env bash + set -euo pipefail + tmp=$(mktemp -d) + trap 'rm -rf "$tmp"' EXIT + mkdir -p images + # shot FILE NAME [OPENSCAD ARGS...]: render one example, trimmed to the model + shot() { + local f=$1 n=$2; shift 2 + openscad --render --autocenter --viewall --imgsize=1600,1200 --colorscheme=Tomorrow "$@" -o "$tmp/$n.png" "$f" >/dev/null 2>&1 + magick "$tmp/$n.png" -trim +repage "$tmp/$n.png" + } + sheet() { # sheet OUT COLUMNS NAME=LABEL... + local out=$1 cols=$2; shift 2 + local args=() + for p in "$@"; do args+=(-label "${p#*=}" "$tmp/${p%%=*}.png"); done + magick montage "${args[@]}" -resize 600x600 -geometry +24+24 -tile "${cols}x" \ + -background '#f8f8f8' -pointsize 22 "$out" + # 128 colours, undithered: a third to a half the size, no visible banding + magick "$out" -dither None -colors 128 -define png:compression-level=9 "$out" + } + t=examples + shot $t/temptower_examples/temptower_example.scad temp + shot $t/temptower_examples/temptower_detailed_example.scad temp_detailed + shot $t/retracttower_examples/retracttower_example.scad retract + shot $t/flowtower_examples/flowtower_example.scad flow + shot $t/speedtower_examples/speedtower_example.scad speed + sheet images/towers.png 5 "temp=Temperature" "temp_detailed=Detailed temperature" \ + "retract=Retraction" "flow=Flow" "speed=Speed" + b=$t/bedlevelpattern_examples + for p in concentric_squares spiral_squares concentric_circles x_in_square circle_in_square grid padded_grid five_circles; do + shot $b/blp_${p}_example.scad $p --camera 0,0,0,0,0,0,0 --projection=ortho + done + sheet images/bed-level-patterns.png 4 "concentric_squares=Concentric squares" \ + "spiral_squares=Spiral squares" "concentric_circles=Concentric circles" "x_in_square=X in square" \ + "circle_in_square=Circle in square" "grid=Grid" "padded_grid=Padded grid" "five_circles=Five circles" + shot $t/xyzcalicube_examples/xyzcalicube_example.scad cube + shot $t/torture_test_examples/torture_test_example.scad torture + sheet images/cube-and-torture-test.png 2 "cube=XYZ calibration cube" "torture=Torture test"