You can override variables on the command line with -D, so for example,
-Dinside_diameter=2. Pass --preview if you want colours.
On Tue, 26 Apr 2022 at 10:36, Jeremy Ardley via Discuss <
discuss@lists.openscad.org> wrote:
---------- Forwarded message ----------
From: Jeremy Ardley jeremy@ardley.org
To: OpenSCAD general discussion discuss@lists.openscad.org
Cc:
Bcc:
Date: Tue, 26 Apr 2022 17:36:18 +0800
Subject: [OpenSCAD] Scripted image generation?
In my case I want to generate many images of O-Rings of varying sizes.
I can do this with a very simple stanza of code with parameters for
thickness and internal diameter
inside_diameter= 1.07;
oring_width=1.27;
$fn=200;
color("#505050"){
rotate_extrude(){
translate([(inside_diameter+oring_width), 0]){
circle(oring_width);
}
}
}
I then export the image each time I run it with different parameters
I would like to automate this process so I can feed in a list of diameters
and thicknesses and get multiple PNG files as output.
Is there any way to do this?
As a secondary issue, I set the color to be used in my script and it works
in preview, but in render I only get one of a few possible variants
selected via the menu,
I would like to be able to force render to use the color value of my
script. Is this possible?
Finally, the lighting used is diffuse. It would be good to be able to
specify an origin and distance of the light source, and perhaps further,
specify a color or spectrum to use
Jeremy
---------- Forwarded message ----------
From: Jeremy Ardley via Discuss discuss@lists.openscad.org
To: OpenSCAD general discussion discuss@lists.openscad.org
Cc: Jeremy Ardley jeremy@ardley.org
Bcc:
Date: Tue, 26 Apr 2022 17:36:18 +0800
Subject: [OpenSCAD] Scripted image generation?
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
You can override variables on the command line with -D, so for example,
-Dinside_diameter=2. Pass --preview if you want colours.
On Tue, 26 Apr 2022 at 10:36, Jeremy Ardley via Discuss <
discuss@lists.openscad.org> wrote:
>
>
>
> ---------- Forwarded message ----------
> From: Jeremy Ardley <jeremy@ardley.org>
> To: OpenSCAD general discussion <discuss@lists.openscad.org>
> Cc:
> Bcc:
> Date: Tue, 26 Apr 2022 17:36:18 +0800
> Subject: [OpenSCAD] Scripted image generation?
>
> In my case I want to generate many images of O-Rings of varying sizes.
>
> I can do this with a very simple stanza of code with parameters for
> thickness and internal diameter
>
> inside_diameter= 1.07;
> oring_width=1.27;
> $fn=200;
> color("#505050"){
> rotate_extrude(){
> translate([(inside_diameter+oring_width), 0]){
> circle(oring_width);
> }
> }
> }
>
> I then export the image each time I run it with different parameters
>
> I would like to automate this process so I can feed in a list of diameters
> and thicknesses and get multiple PNG files as output.
>
> Is there any way to do this?
>
> As a secondary issue, I set the color to be used in my script and it works
> in preview, but in render I only get one of a few possible variants
> selected via the menu,
>
> I would like to be able to force render to use the color value of my
> script. Is this possible?
>
> Finally, the lighting used is diffuse. It would be good to be able to
> specify an origin and distance of the light source, and perhaps further,
> specify a color or spectrum to use
> --
> Jeremy
>
>
>
> ---------- Forwarded message ----------
> From: Jeremy Ardley via Discuss <discuss@lists.openscad.org>
> To: OpenSCAD general discussion <discuss@lists.openscad.org>
> Cc: Jeremy Ardley <jeremy@ardley.org>
> Bcc:
> Date: Tue, 26 Apr 2022 17:36:18 +0800
> Subject: [OpenSCAD] Scripted image generation?
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>