Created
February 15, 2014 20:36
Revisions
-
t-paul created this gist
Feb 15, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ #!/bin/bash CNT=0 WINID=$(xwininfo -name "OpenSCAD - test.scad" | grep "Window id:" | awk '{ print $4; }') NUM=${1-50} echo "Using ${NUM}x${NUM} cube area..." while true do echo "" > /tmp/test.scad for x in $(seq 0 $NUM) do for y in $(seq 0 $NUM) do echo -n "translate([$x, $y, 0]) { scale([0.8,0.8,0.8]) { " >> /tmp/test.scad echo -n "cube(1); " >> /tmp/test.scad echo -n "}" >> /tmp/test.scad echo "}" >> /tmp/test.scad done done #cp slow-render.scad /tmp/test.scad ; sleep 0.1; echo "translate([$RANDOM / 1000, 0, 0]) color(\"red\") cylinder(r = 2, h = 40);" >> /tmp/test.scad echo "translate([$RANDOM / 1000, 0, 0]) color(\"red\") cylinder(r = 2, h = 40);" >> /tmp/test.scad sleep 2 import -window 0x2e00003 img.png REDPIXEL=$(convert img.png -fuzz 20% -fill black +opaque red -fill white -opaque red -print "%[fx:w*h*mean]" null: | sed -e 's/\..*//') echo "$(date): $REDPIXEL" if [ $REDPIXEL -lt 100 ] then cp img.png $(printf "err_%04d.img" $CNT) CNT=$(expr $CNT + 1) fi done