-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for variables, scripting support #2
Comments
@gingerbeardman yes, this is definitely something I'd like to support, and thanks so much for the example code - it will be very helpful in deciding what the feature set ought to be. |
@gingerbeardman can you explain a bit more about |
Oops, I had deleted some commented out lines. I have reinstated them at the top of the model description.
Only when in the OpenSCAD editor I uncomment those lines and the model will react when I am running animation (it will rotate, actually the camera will rotate around it) because I use When I am done, I comment out those top few lines and instead control the camera using a command line parameter, where I am in charge of the variable that sets the rotation amount, I pass it as an argument with each call. Recently OpenSCAD had the feature for animation on command line added. However after trying it I saw that the performance is limited by OpenSCAD's limitation of using only a single CPU core. So, instead, I run a bunch of instances at once from the command line (using Rendering all my cars takes ~16 minutes right now, but my Makefile is clever enough to only build things that have changed so turnaround is very quick (~25 seconds) |
For completeness, here's a snippet of a script I call from my Makefile I pass on the CLI variables to rock the body of the car:
and whether or not to render shadow (I render car and shadow separately):
and others including:
TOTAL=$(( 9*32 ))
for i in {0..31};
do
ANGLE=$(( 180-11.25*(i) ))
NUM=$(( ${TOTAL}-(($p-1)*32+$i+1) ))
printf -v NUMBER "%03d" $NUM
openscad \
-q \
-D rl=$RL \
-D rr=$RR \
-D rf=$RF \
-D rb=$RB \
-D shad=$SHAD \
--autocenter \
--camera 0,2,28,45,0,$ANGLE,500 \
--imgsize 320,320 \
-o $NUMBER-$CAR.png \
_$CAR.scad 2> /dev/null &
done
wait |
I'm an OpenSCAD user and make use of its command line interface to export automated variations of my models. I use:
$t
to change the camera (32 rotations)My issues with OpenSCAD are:
So, I was wondering if there are plans to add support for variables and scripting (CLI, AppleScript, internal, etc)
Cheers!
matt from Cornwall
--
Example final output from my
Makefile
(render, resize, stitch, convert to 1-bit):And the OpenSCAD model used:
The text was updated successfully, but these errors were encountered: