discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

multiple command-line viewpoints with one render - is it possible?

JG
Jonathan Gilbert
Fri, Apr 1, 2022 2:38 AM

Can one have multiple invocations of openscad from the command-line produce
images from the same render?

I'm in the process of setting up a series of automatically generated
image-heavy documentation for a large number of OpenSCAD-native models
(slightly north of 1,000). Each document has five static images rendered
for it and placed inline in the respective document. Each image is the same
model, from a different camera viewpoint.  Model images and document data
are expected to be updated ... well, if not frequently, then at least
*irregularly, *and may need to be regenerated on demand, and not through
the GUI. For the simple models, the time to render the images (with
--preview) can be as little as 10 seconds apart (that includes the amount
of time spent launching openscad.exe as well as the render); the more
complex models are so far pushing around 5 minutes (for about 25 minutes
total for that one model) and we haven't really gotten into finalizing the
bad ones. I shudder to think about what'll happen with --render, but we're
estimating several hours to fully re-render all the models.

Ideally, https://github.com/openscad/openscad/issues/1645 would be
implemented and a persistent cache would save the subsequent re-renders,
but it looks like it's stalled and hasn't had progress on it in some time,
but I thought maybe someone had a strategy to produce multiple image
exports from the same running command-line invoked process, or some
undocumented CLI option existed that let one specify multiple camera
viewpoints.

So: is it possible to get more than one viewpoint image exported from the
same render activity via the command-line, without re-rendering the model?
Is there hope here?

--

Can one have multiple invocations of openscad from the command-line produce images from the same render? I'm in the process of setting up a series of automatically generated image-heavy documentation for a large number of OpenSCAD-native models (slightly north of 1,000). Each document has five static images rendered for it and placed inline in the respective document. Each image is the same model, from a different camera viewpoint. Model images and document data are expected to be updated ... well, if not *frequently*, then at least *irregularly, *and may need to be regenerated on demand, and not through the GUI. For the simple models, the time to render the images (with --preview) can be as little as 10 seconds apart (that includes the amount of time spent launching openscad.exe as well as the render); the more complex models are so far pushing around 5 minutes (for about 25 minutes total for that one model) and we haven't really gotten into finalizing the bad ones. I shudder to think about what'll happen with --render, but we're estimating several hours to fully re-render all the models. Ideally, https://github.com/openscad/openscad/issues/1645 would be implemented and a persistent cache would save the subsequent re-renders, but it looks like it's stalled and hasn't had progress on it in some time, but I thought maybe someone had a strategy to produce multiple image exports from the same running command-line invoked process, or some undocumented CLI option existed that let one specify multiple camera viewpoints. So: is it possible to get more than one viewpoint image exported from the same render activity via the command-line, without re-rendering the model? Is there hope here? -- - Jon Gilbert jong@jong.org / jgilbertsjc@gmail.com
RD
Revar Desmera
Fri, Apr 1, 2022 2:44 AM

From experience with openscad_docsgen, you CAN, by abusing the animation framework.  I make a script with a line that sets $vpr based on $t, then tell OpenSCAD to animate a number of frames via the —animate FRAMES command-line arguments.

  • Revar

On Mar 31, 2022, at 7:38 PM, Jonathan Gilbert jong@jong.org wrote:

Can one have multiple invocations of openscad from the command-line produce images from the same render?

I'm in the process of setting up a series of automatically generated image-heavy documentation for a large number of OpenSCAD-native models (slightly north of 1,000). Each document has five static images rendered for it and placed inline in the respective document. Each image is the same model, from a different camera viewpoint.  Model images and document data are expected to be updated ... well, if not frequently, then at least irregularly, and may need to be regenerated on demand, and not through the GUI. For the simple models, the time to render the images (with --preview) can be as little as 10 seconds apart (that includes the amount of time spent launching openscad.exe as well as the render); the more complex models are so far pushing around 5 minutes (for about 25 minutes total for that one model) and we haven't really gotten into finalizing the bad ones. I shudder to think about what'll happen with --render, but we're estimating several hours to fully re-render all the models.

Ideally, https://github.com/openscad/openscad/issues/1645 https://github.com/openscad/openscad/issues/1645 would be implemented and a persistent cache would save the subsequent re-renders, but it looks like it's stalled and hasn't had progress on it in some time, but I thought maybe someone had a strategy to produce multiple image exports from the same running command-line invoked process, or some undocumented CLI option existed that let one specify multiple camera viewpoints.

So: is it possible to get more than one viewpoint image exported from the same render activity via the command-line, without re-rendering the model?  Is there hope here?

--

From experience with openscad_docsgen, you CAN, by abusing the animation framework. I make a script with a line that sets $vpr based on $t, then tell OpenSCAD to animate a number of frames via the —animate FRAMES command-line arguments. - Revar > On Mar 31, 2022, at 7:38 PM, Jonathan Gilbert <jong@jong.org> wrote: > > Can one have multiple invocations of openscad from the command-line produce images from the same render? > > I'm in the process of setting up a series of automatically generated image-heavy documentation for a large number of OpenSCAD-native models (slightly north of 1,000). Each document has five static images rendered for it and placed inline in the respective document. Each image is the same model, from a different camera viewpoint. Model images and document data are expected to be updated ... well, if not frequently, then at least irregularly, and may need to be regenerated on demand, and not through the GUI. For the simple models, the time to render the images (with --preview) can be as little as 10 seconds apart (that includes the amount of time spent launching openscad.exe as well as the render); the more complex models are so far pushing around 5 minutes (for about 25 minutes total for that one model) and we haven't really gotten into finalizing the bad ones. I shudder to think about what'll happen with --render, but we're estimating several hours to fully re-render all the models. > > Ideally, https://github.com/openscad/openscad/issues/1645 <https://github.com/openscad/openscad/issues/1645> would be implemented and a persistent cache would save the subsequent re-renders, but it looks like it's stalled and hasn't had progress on it in some time, but I thought maybe someone had a strategy to produce multiple image exports from the same running command-line invoked process, or some undocumented CLI option existed that let one specify multiple camera viewpoints. > > So: is it possible to get more than one viewpoint image exported from the same render activity via the command-line, without re-rendering the model? Is there hope here? > > -- > - Jon Gilbert > jong@jong.org <mailto:jong@jong.org> / jgilbertsjc@gmail.com <mailto:jgilbertsjc@gmail.com>_______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
RD
Revar Desmera
Fri, Apr 1, 2022 2:50 AM

To clarify more, you can do something like: -o foo.png —animate 4 -D’$vpr=[[55,0,120], [90,0,0], [55,0,240], [75,0,90]][floor($t*4)]and it will output four png files named likefoo_XX.png`, where XX are consecutive frame numbers.

  • Revar

On Mar 31, 2022, at 7:44 PM, Revar Desmera revarbat@gmail.com wrote:

From experience with openscad_docsgen, you CAN, by abusing the animation framework.  I make a script with a line that sets $vpr based on $t, then tell OpenSCAD to animate a number of frames via the —animate FRAMES command-line arguments.

  • Revar

On Mar 31, 2022, at 7:38 PM, Jonathan Gilbert <jong@jong.org mailto:jong@jong.org> wrote:

Can one have multiple invocations of openscad from the command-line produce images from the same render?

I'm in the process of setting up a series of automatically generated image-heavy documentation for a large number of OpenSCAD-native models (slightly north of 1,000). Each document has five static images rendered for it and placed inline in the respective document. Each image is the same model, from a different camera viewpoint.  Model images and document data are expected to be updated ... well, if not frequently, then at least irregularly, and may need to be regenerated on demand, and not through the GUI. For the simple models, the time to render the images (with --preview) can be as little as 10 seconds apart (that includes the amount of time spent launching openscad.exe as well as the render); the more complex models are so far pushing around 5 minutes (for about 25 minutes total for that one model) and we haven't really gotten into finalizing the bad ones. I shudder to think about what'll happen with --render, but we're estimating several hours to fully re-render all the models.

Ideally, https://github.com/openscad/openscad/issues/1645 https://github.com/openscad/openscad/issues/1645 would be implemented and a persistent cache would save the subsequent re-renders, but it looks like it's stalled and hasn't had progress on it in some time, but I thought maybe someone had a strategy to produce multiple image exports from the same running command-line invoked process, or some undocumented CLI option existed that let one specify multiple camera viewpoints.

So: is it possible to get more than one viewpoint image exported from the same render activity via the command-line, without re-rendering the model?  Is there hope here?

--

To clarify more, you can do something like: -o foo.png —animate 4 -D’$vpr=[[55,0,120], [90,0,0], [55,0,240], [75,0,90]][floor($t*4)]` and it will output four png files named like `foo_XX.png`, where XX are consecutive frame numbers. - Revar > On Mar 31, 2022, at 7:44 PM, Revar Desmera <revarbat@gmail.com> wrote: > > From experience with openscad_docsgen, you CAN, by abusing the animation framework. I make a script with a line that sets $vpr based on $t, then tell OpenSCAD to animate a number of frames via the —animate FRAMES command-line arguments. > > - Revar > > >> On Mar 31, 2022, at 7:38 PM, Jonathan Gilbert <jong@jong.org <mailto:jong@jong.org>> wrote: >> >> Can one have multiple invocations of openscad from the command-line produce images from the same render? >> >> I'm in the process of setting up a series of automatically generated image-heavy documentation for a large number of OpenSCAD-native models (slightly north of 1,000). Each document has five static images rendered for it and placed inline in the respective document. Each image is the same model, from a different camera viewpoint. Model images and document data are expected to be updated ... well, if not frequently, then at least irregularly, and may need to be regenerated on demand, and not through the GUI. For the simple models, the time to render the images (with --preview) can be as little as 10 seconds apart (that includes the amount of time spent launching openscad.exe as well as the render); the more complex models are so far pushing around 5 minutes (for about 25 minutes total for that one model) and we haven't really gotten into finalizing the bad ones. I shudder to think about what'll happen with --render, but we're estimating several hours to fully re-render all the models. >> >> Ideally, https://github.com/openscad/openscad/issues/1645 <https://github.com/openscad/openscad/issues/1645> would be implemented and a persistent cache would save the subsequent re-renders, but it looks like it's stalled and hasn't had progress on it in some time, but I thought maybe someone had a strategy to produce multiple image exports from the same running command-line invoked process, or some undocumented CLI option existed that let one specify multiple camera viewpoints. >> >> So: is it possible to get more than one viewpoint image exported from the same render activity via the command-line, without re-rendering the model? Is there hope here? >> >> -- >> - Jon Gilbert >> jong@jong.org <mailto:jong@jong.org> / jgilbertsjc@gmail.com <mailto:jgilbertsjc@gmail.com>_______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org <mailto:discuss-leave@lists.openscad.org> >
RD
Revar Desmera
Fri, Apr 1, 2022 3:16 AM

Speaking of animating to PNGs from the command-line, has there been any consideration of allowing OpenSCAD to generate APNGs (Animated PNGs) or animated GIFs?

  • Revar

On Mar 31, 2022, at 7:50 PM, Revar Desmera revarbat@gmail.com wrote:

To clarify more, you can do something like: -o foo.png —animate 4 -D’$vpr=[[55,0,120], [90,0,0], [55,0,240], [75,0,90]][floor($t*4)]and it will output four png files named likefoo_XX.png`, where XX are consecutive frame numbers.

  • Revar

On Mar 31, 2022, at 7:44 PM, Revar Desmera <revarbat@gmail.com mailto:revarbat@gmail.com> wrote:

From experience with openscad_docsgen, you CAN, by abusing the animation framework.  I make a script with a line that sets $vpr based on $t, then tell OpenSCAD to animate a number of frames via the —animate FRAMES command-line arguments.

  • Revar

On Mar 31, 2022, at 7:38 PM, Jonathan Gilbert <jong@jong.org mailto:jong@jong.org> wrote:

Can one have multiple invocations of openscad from the command-line produce images from the same render?

I'm in the process of setting up a series of automatically generated image-heavy documentation for a large number of OpenSCAD-native models (slightly north of 1,000). Each document has five static images rendered for it and placed inline in the respective document. Each image is the same model, from a different camera viewpoint.  Model images and document data are expected to be updated ... well, if not frequently, then at least irregularly, and may need to be regenerated on demand, and not through the GUI. For the simple models, the time to render the images (with --preview) can be as little as 10 seconds apart (that includes the amount of time spent launching openscad.exe as well as the render); the more complex models are so far pushing around 5 minutes (for about 25 minutes total for that one model) and we haven't really gotten into finalizing the bad ones. I shudder to think about what'll happen with --render, but we're estimating several hours to fully re-render all the models.

Ideally, https://github.com/openscad/openscad/issues/1645 https://github.com/openscad/openscad/issues/1645 would be implemented and a persistent cache would save the subsequent re-renders, but it looks like it's stalled and hasn't had progress on it in some time, but I thought maybe someone had a strategy to produce multiple image exports from the same running command-line invoked process, or some undocumented CLI option existed that let one specify multiple camera viewpoints.

So: is it possible to get more than one viewpoint image exported from the same render activity via the command-line, without re-rendering the model?  Is there hope here?

--

Speaking of animating to PNGs from the command-line, has there been any consideration of allowing OpenSCAD to generate APNGs (Animated PNGs) or animated GIFs? - Revar > On Mar 31, 2022, at 7:50 PM, Revar Desmera <revarbat@gmail.com> wrote: > > To clarify more, you can do something like: -o foo.png —animate 4 -D’$vpr=[[55,0,120], [90,0,0], [55,0,240], [75,0,90]][floor($t*4)]` and it will output four png files named like `foo_XX.png`, where XX are consecutive frame numbers. > > - Revar > > >> On Mar 31, 2022, at 7:44 PM, Revar Desmera <revarbat@gmail.com <mailto:revarbat@gmail.com>> wrote: >> >> From experience with openscad_docsgen, you CAN, by abusing the animation framework. I make a script with a line that sets $vpr based on $t, then tell OpenSCAD to animate a number of frames via the —animate FRAMES command-line arguments. >> >> - Revar >> >> >>> On Mar 31, 2022, at 7:38 PM, Jonathan Gilbert <jong@jong.org <mailto:jong@jong.org>> wrote: >>> >>> Can one have multiple invocations of openscad from the command-line produce images from the same render? >>> >>> I'm in the process of setting up a series of automatically generated image-heavy documentation for a large number of OpenSCAD-native models (slightly north of 1,000). Each document has five static images rendered for it and placed inline in the respective document. Each image is the same model, from a different camera viewpoint. Model images and document data are expected to be updated ... well, if not frequently, then at least irregularly, and may need to be regenerated on demand, and not through the GUI. For the simple models, the time to render the images (with --preview) can be as little as 10 seconds apart (that includes the amount of time spent launching openscad.exe as well as the render); the more complex models are so far pushing around 5 minutes (for about 25 minutes total for that one model) and we haven't really gotten into finalizing the bad ones. I shudder to think about what'll happen with --render, but we're estimating several hours to fully re-render all the models. >>> >>> Ideally, https://github.com/openscad/openscad/issues/1645 <https://github.com/openscad/openscad/issues/1645> would be implemented and a persistent cache would save the subsequent re-renders, but it looks like it's stalled and hasn't had progress on it in some time, but I thought maybe someone had a strategy to produce multiple image exports from the same running command-line invoked process, or some undocumented CLI option existed that let one specify multiple camera viewpoints. >>> >>> So: is it possible to get more than one viewpoint image exported from the same render activity via the command-line, without re-rendering the model? Is there hope here? >>> >>> -- >>> - Jon Gilbert >>> jong@jong.org <mailto:jong@jong.org> / jgilbertsjc@gmail.com <mailto:jgilbertsjc@gmail.com>_______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org <mailto:discuss-leave@lists.openscad.org> >> >
JG
Jonathan Gilbert
Fri, Apr 1, 2022 4:20 AM

It honestly had not occurred that --animate would produce individual
frames, and it makes sense to try that. I'll have to read up more on what
$vpr and --animate is meant to do, since it's ... not really working the
way I'dve expected. Currently, I've got the following occurring:

jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$ cat dumb.scad

module h() {
cube(20);
}
h();
jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$ openscad
-D '$vpr=[[55,0,120],[90,0,0],[55,0,240],[75,0,90]][floor($t4)]' -o
baz.png --view axes --animate 4 dumb.scad
Exporting dumb.scad...
WARNING: Viewall and autocenter disabled in favor of $vp

Compiling design (CSG Products normalization)...
Normalized CSG tree has 1 elements
Geometries in cache: 1
Geometry cache size in bytes: 728
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Total rendering time: 0:00:00.078
Exporting dumb.scad...
Compiling design (CSG Products normalization)...
Normalized CSG tree has 1 elements
MS GDI - RegisterClass failed
last-error code: 5
Can't create OpenGL OffscreenView. Code: -1.
Geometries in cache: 1
Geometry cache size in bytes: 728
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Total rendering time: 0:00:00.000
jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$ ls -al baz*
-rw-r--r-- 1 jong jong 5937 Mar 31 21:16 baz00000.png
-rw-r--r-- 1 jong jong    0 Mar 31 21:16 baz00001.png
jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$

(This is Ubuntu 20.04 running under WSL, using OpenSCAD 2021.01.)

On Thu, Mar 31, 2022 at 7:51 PM Revar Desmera revarbat@gmail.com wrote:

To clarify more, you can do something like: -o foo.png —animate 4
-D’$vpr=[[55,0,120], [90,0,0], [55,0,240], [75,0,90]][floor($t*4)]and it will output four png files named likefoo_XX.png`, where XX are
consecutive frame numbers.

  • Revar

On Mar 31, 2022, at 7:44 PM, Revar Desmera revarbat@gmail.com wrote:

From experience with openscad_docsgen, you CAN, by abusing the animation
framework.  I make a script with a line that sets $vpr based on $t, then
tell OpenSCAD to animate a number of frames via the —animate FRAMES
command-line arguments.

  • Revar

On Mar 31, 2022, at 7:38 PM, Jonathan Gilbert jong@jong.org wrote:

Can one have multiple invocations of openscad from the command-line
produce images from the same render?

I'm in the process of setting up a series of automatically generated
image-heavy documentation for a large number of OpenSCAD-native models
(slightly north of 1,000). Each document has five static images rendered
for it and placed inline in the respective document. Each image is the same
model, from a different camera viewpoint.  Model images and document data
are expected to be updated ... well, if not frequently, then at least
*irregularly, *and may need to be regenerated on demand, and not through
the GUI. For the simple models, the time to render the images (with
--preview) can be as little as 10 seconds apart (that includes the amount
of time spent launching openscad.exe as well as the render); the more
complex models are so far pushing around 5 minutes (for about 25 minutes
total for that one model) and we haven't really gotten into finalizing the
bad ones. I shudder to think about what'll happen with --render, but we're
estimating several hours to fully re-render all the models.

Ideally, https://github.com/openscad/openscad/issues/1645 would be
implemented and a persistent cache would save the subsequent re-renders,
but it looks like it's stalled and hasn't had progress on it in some time,
but I thought maybe someone had a strategy to produce multiple image
exports from the same running command-line invoked process, or some
undocumented CLI option existed that let one specify multiple camera
viewpoints.

So: is it possible to get more than one viewpoint image exported from the
same render activity via the command-line, without re-rendering the model?
Is there hope here?

--


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

It honestly had not occurred that --animate would produce individual frames, and it makes sense to try that. I'll have to read up more on what $vpr and --animate is meant to do, since it's ... not really working the way I'dve expected. Currently, I've got the following occurring: jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$ cat dumb.scad > module h() { > cube(20); > } > h(); > jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$ openscad > -D '$vpr=[[55,0,120],[90,0,0],[55,0,240],[75,0,90]][floor($t*4)]' -o > baz.png --view axes --animate 4 dumb.scad > Exporting dumb.scad... > WARNING: Viewall and autocenter disabled in favor of $vp* > Compiling design (CSG Products normalization)... > Normalized CSG tree has 1 elements > Geometries in cache: 1 > Geometry cache size in bytes: 728 > CGAL Polyhedrons in cache: 0 > CGAL cache size in bytes: 0 > Total rendering time: 0:00:00.078 > Exporting dumb.scad... > Compiling design (CSG Products normalization)... > Normalized CSG tree has 1 elements > MS GDI - RegisterClass failed > last-error code: 5 > Can't create OpenGL OffscreenView. Code: -1. > Geometries in cache: 1 > Geometry cache size in bytes: 728 > CGAL Polyhedrons in cache: 0 > CGAL cache size in bytes: 0 > Total rendering time: 0:00:00.000 > jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$ ls -al baz* > -rw-r--r-- 1 jong jong 5937 Mar 31 21:16 baz00000.png > -rw-r--r-- 1 jong jong 0 Mar 31 21:16 baz00001.png > jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$ > (This is Ubuntu 20.04 running under WSL, using OpenSCAD 2021.01.) On Thu, Mar 31, 2022 at 7:51 PM Revar Desmera <revarbat@gmail.com> wrote: > To clarify more, you can do something like: -o foo.png —animate 4 > -D’$vpr=[[55,0,120], [90,0,0], [55,0,240], [75,0,90]][floor($t*4)]` and it > will output four png files named like `foo_XX.png`, where XX are > consecutive frame numbers. > > - Revar > > > On Mar 31, 2022, at 7:44 PM, Revar Desmera <revarbat@gmail.com> wrote: > > From experience with openscad_docsgen, you CAN, by abusing the animation > framework. I make a script with a line that sets $vpr based on $t, then > tell OpenSCAD to animate a number of frames via the —animate FRAMES > command-line arguments. > > - Revar > > > On Mar 31, 2022, at 7:38 PM, Jonathan Gilbert <jong@jong.org> wrote: > > Can one have multiple invocations of openscad from the command-line > produce images from the same render? > > I'm in the process of setting up a series of automatically generated > image-heavy documentation for a large number of OpenSCAD-native models > (slightly north of 1,000). Each document has five static images rendered > for it and placed inline in the respective document. Each image is the same > model, from a different camera viewpoint. Model images and document data > are expected to be updated ... well, if not *frequently*, then at least > *irregularly, *and may need to be regenerated on demand, and not through > the GUI. For the simple models, the time to render the images (with > --preview) can be as little as 10 seconds apart (that includes the amount > of time spent launching openscad.exe as well as the render); the more > complex models are so far pushing around 5 minutes (for about 25 minutes > total for that one model) and we haven't really gotten into finalizing the > bad ones. I shudder to think about what'll happen with --render, but we're > estimating several hours to fully re-render all the models. > > Ideally, https://github.com/openscad/openscad/issues/1645 would be > implemented and a persistent cache would save the subsequent re-renders, > but it looks like it's stalled and hasn't had progress on it in some time, > but I thought maybe someone had a strategy to produce multiple image > exports from the same running command-line invoked process, or some > undocumented CLI option existed that let one specify multiple camera > viewpoints. > > So: is it possible to get more than one viewpoint image exported from the > same render activity via the command-line, without re-rendering the model? > Is there hope here? > > -- > - Jon Gilbert > jong@jong.org / jgilbertsjc@gmail.com > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > -- - Jon Gilbert jong@jong.org / jgilbertsjc@gmail.com
RD
Revar Desmera
Fri, Apr 1, 2022 4:46 AM

Interestingly, with your quoted scad file and my OpenSCAD.app 2021.03.08 (on MacOS), it generates all four images using the same quoted command-line.

  • Revar

On Mar 31, 2022, at 9:20 PM, Jonathan Gilbert jong@jong.org wrote:

It honestly had not occurred that --animate would produce individual frames, and it makes sense to try that. I'll have to read up more on what $vpr and --animate is meant to do, since it's ... not really working the way I'dve expected. Currently, I've got the following occurring:

jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$ cat dumb.scad
module h() {
cube(20);
}
h();
jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$ openscad -D '$vpr=[[55,0,120],[90,0,0],[55,0,240],[75,0,90]][floor($t4)]' -o baz.png --view axes --animate 4 dumb.scad
Exporting dumb.scad...
WARNING: Viewall and autocenter disabled in favor of $vp

Compiling design (CSG Products normalization)...
Normalized CSG tree has 1 elements
Geometries in cache: 1
Geometry cache size in bytes: 728
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Total rendering time: 0:00:00.078
Exporting dumb.scad...
Compiling design (CSG Products normalization)...
Normalized CSG tree has 1 elements
MS GDI - RegisterClass failed
last-error code: 5
Can't create OpenGL OffscreenView. Code: -1.
Geometries in cache: 1
Geometry cache size in bytes: 728
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Total rendering time: 0:00:00.000
jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$ ls -al baz*
-rw-r--r-- 1 jong jong 5937 Mar 31 21:16 baz00000.png
-rw-r--r-- 1 jong jong    0 Mar 31 21:16 baz00001.png
jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$

(This is Ubuntu 20.04 running under WSL, using OpenSCAD 2021.01.)

On Thu, Mar 31, 2022 at 7:51 PM Revar Desmera <revarbat@gmail.com mailto:revarbat@gmail.com> wrote:
To clarify more, you can do something like: -o foo.png —animate 4 -D’$vpr=[[55,0,120], [90,0,0], [55,0,240], [75,0,90]][floor($t*4)]and it will output four png files named likefoo_XX.png`, where XX are consecutive frame numbers.

  • Revar

On Mar 31, 2022, at 7:44 PM, Revar Desmera <revarbat@gmail.com mailto:revarbat@gmail.com> wrote:

From experience with openscad_docsgen, you CAN, by abusing the animation framework.  I make a script with a line that sets $vpr based on $t, then tell OpenSCAD to animate a number of frames via the —animate FRAMES command-line arguments.

  • Revar

On Mar 31, 2022, at 7:38 PM, Jonathan Gilbert <jong@jong.org mailto:jong@jong.org> wrote:

Can one have multiple invocations of openscad from the command-line produce images from the same render?

I'm in the process of setting up a series of automatically generated image-heavy documentation for a large number of OpenSCAD-native models (slightly north of 1,000). Each document has five static images rendered for it and placed inline in the respective document. Each image is the same model, from a different camera viewpoint.  Model images and document data are expected to be updated ... well, if not frequently, then at least irregularly, and may need to be regenerated on demand, and not through the GUI. For the simple models, the time to render the images (with --preview) can be as little as 10 seconds apart (that includes the amount of time spent launching openscad.exe as well as the render); the more complex models are so far pushing around 5 minutes (for about 25 minutes total for that one model) and we haven't really gotten into finalizing the bad ones. I shudder to think about what'll happen with --render, but we're estimating several hours to fully re-render all the models.

Ideally, https://github.com/openscad/openscad/issues/1645 https://github.com/openscad/openscad/issues/1645 would be implemented and a persistent cache would save the subsequent re-renders, but it looks like it's stalled and hasn't had progress on it in some time, but I thought maybe someone had a strategy to produce multiple image exports from the same running command-line invoked process, or some undocumented CLI option existed that let one specify multiple camera viewpoints.

So: is it possible to get more than one viewpoint image exported from the same render activity via the command-line, without re-rendering the model?  Is there hope here?

--


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org mailto:discuss-leave@lists.openscad.org

--

Interestingly, with your quoted scad file and my OpenSCAD.app 2021.03.08 (on MacOS), it generates all four images using the same quoted command-line. - Revar > On Mar 31, 2022, at 9:20 PM, Jonathan Gilbert <jong@jong.org> wrote: > > It honestly had not occurred that --animate would produce individual frames, and it makes sense to try that. I'll have to read up more on what $vpr and --animate is meant to do, since it's ... not really working the way I'dve expected. Currently, I've got the following occurring: > > jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$ cat dumb.scad > module h() { > cube(20); > } > h(); > jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$ openscad -D '$vpr=[[55,0,120],[90,0,0],[55,0,240],[75,0,90]][floor($t*4)]' -o baz.png --view axes --animate 4 dumb.scad > Exporting dumb.scad... > WARNING: Viewall and autocenter disabled in favor of $vp* > Compiling design (CSG Products normalization)... > Normalized CSG tree has 1 elements > Geometries in cache: 1 > Geometry cache size in bytes: 728 > CGAL Polyhedrons in cache: 0 > CGAL cache size in bytes: 0 > Total rendering time: 0:00:00.078 > Exporting dumb.scad... > Compiling design (CSG Products normalization)... > Normalized CSG tree has 1 elements > MS GDI - RegisterClass failed > last-error code: 5 > Can't create OpenGL OffscreenView. Code: -1. > Geometries in cache: 1 > Geometry cache size in bytes: 728 > CGAL Polyhedrons in cache: 0 > CGAL cache size in bytes: 0 > Total rendering time: 0:00:00.000 > jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$ ls -al baz* > -rw-r--r-- 1 jong jong 5937 Mar 31 21:16 baz00000.png > -rw-r--r-- 1 jong jong 0 Mar 31 21:16 baz00001.png > jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$ > > (This is Ubuntu 20.04 running under WSL, using OpenSCAD 2021.01.) > > > > On Thu, Mar 31, 2022 at 7:51 PM Revar Desmera <revarbat@gmail.com <mailto:revarbat@gmail.com>> wrote: > To clarify more, you can do something like: -o foo.png —animate 4 -D’$vpr=[[55,0,120], [90,0,0], [55,0,240], [75,0,90]][floor($t*4)]` and it will output four png files named like `foo_XX.png`, where XX are consecutive frame numbers. > > - Revar > > >> On Mar 31, 2022, at 7:44 PM, Revar Desmera <revarbat@gmail.com <mailto:revarbat@gmail.com>> wrote: >> >> From experience with openscad_docsgen, you CAN, by abusing the animation framework. I make a script with a line that sets $vpr based on $t, then tell OpenSCAD to animate a number of frames via the —animate FRAMES command-line arguments. >> >> - Revar >> >> >>> On Mar 31, 2022, at 7:38 PM, Jonathan Gilbert <jong@jong.org <mailto:jong@jong.org>> wrote: >>> >>> Can one have multiple invocations of openscad from the command-line produce images from the same render? >>> >>> I'm in the process of setting up a series of automatically generated image-heavy documentation for a large number of OpenSCAD-native models (slightly north of 1,000). Each document has five static images rendered for it and placed inline in the respective document. Each image is the same model, from a different camera viewpoint. Model images and document data are expected to be updated ... well, if not frequently, then at least irregularly, and may need to be regenerated on demand, and not through the GUI. For the simple models, the time to render the images (with --preview) can be as little as 10 seconds apart (that includes the amount of time spent launching openscad.exe as well as the render); the more complex models are so far pushing around 5 minutes (for about 25 minutes total for that one model) and we haven't really gotten into finalizing the bad ones. I shudder to think about what'll happen with --render, but we're estimating several hours to fully re-render all the models. >>> >>> Ideally, https://github.com/openscad/openscad/issues/1645 <https://github.com/openscad/openscad/issues/1645> would be implemented and a persistent cache would save the subsequent re-renders, but it looks like it's stalled and hasn't had progress on it in some time, but I thought maybe someone had a strategy to produce multiple image exports from the same running command-line invoked process, or some undocumented CLI option existed that let one specify multiple camera viewpoints. >>> >>> So: is it possible to get more than one viewpoint image exported from the same render activity via the command-line, without re-rendering the model? Is there hope here? >>> >>> -- >>> - Jon Gilbert >>> jong@jong.org <mailto:jong@jong.org> / jgilbertsjc@gmail.com <mailto:jgilbertsjc@gmail.com>_______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org <mailto:discuss-leave@lists.openscad.org> >> > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org <mailto:discuss-leave@lists.openscad.org> > > > -- > - Jon Gilbert > jong@jong.org <mailto:jong@jong.org> / jgilbertsjc@gmail.com <mailto:jgilbertsjc@gmail.com>_______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
LM
Leonard Martin Struttmann
Fri, Apr 1, 2022 2:29 PM

Running the command with dumb.scad on Win10 using OpenSCAD 2021.01, I get
the same results as Jonathon.  baz00000.png gets created fine.
bax00001.png is empty.

On Thu, Mar 31, 2022 at 11:47 PM Revar Desmera revarbat@gmail.com wrote:

Interestingly, with your quoted scad file and my OpenSCAD.app
2021.03.08 (on MacOS), it generates all four images using the same quoted
command-line.

  • Revar

On Mar 31, 2022, at 9:20 PM, Jonathan Gilbert jong@jong.org wrote:

It honestly had not occurred that --animate would produce individual
frames, and it makes sense to try that. I'll have to read up more on what
$vpr and --animate is meant to do, since it's ... not really working the
way I'dve expected. Currently, I've got the following occurring:

jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$ cat dumb.scad

module h() {
cube(20);
}
h();
jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$ openscad
-D '$vpr=[[55,0,120],[90,0,0],[55,0,240],[75,0,90]][floor($t4)]' -o
baz.png --view axes --animate 4 dumb.scad
Exporting dumb.scad...
WARNING: Viewall and autocenter disabled in favor of $vp

Compiling design (CSG Products normalization)...
Normalized CSG tree has 1 elements
Geometries in cache: 1
Geometry cache size in bytes: 728
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Total rendering time: 0:00:00.078
Exporting dumb.scad...
Compiling design (CSG Products normalization)...
Normalized CSG tree has 1 elements
MS GDI - RegisterClass failed
last-error code: 5
Can't create OpenGL OffscreenView. Code: -1.
Geometries in cache: 1
Geometry cache size in bytes: 728
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Total rendering time: 0:00:00.000
jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$ ls -al baz*
-rw-r--r-- 1 jong jong 5937 Mar 31 21:16 baz00000.png
-rw-r--r-- 1 jong jong    0 Mar 31 21:16 baz00001.png
jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$

(This is Ubuntu 20.04 running under WSL, using OpenSCAD 2021.01.)

On Thu, Mar 31, 2022 at 7:51 PM Revar Desmera revarbat@gmail.com wrote:

To clarify more, you can do something like: -o foo.png —animate 4
-D’$vpr=[[55,0,120], [90,0,0], [55,0,240], [75,0,90]][floor($t*4)]and it will output four png files named likefoo_XX.png`, where XX are
consecutive frame numbers.

  • Revar

On Mar 31, 2022, at 7:44 PM, Revar Desmera revarbat@gmail.com wrote:

From experience with openscad_docsgen, you CAN, by abusing the animation
framework.  I make a script with a line that sets $vpr based on $t, then
tell OpenSCAD to animate a number of frames via the —animate FRAMES
command-line arguments.

  • Revar

On Mar 31, 2022, at 7:38 PM, Jonathan Gilbert jong@jong.org wrote:

Can one have multiple invocations of openscad from the command-line
produce images from the same render?

I'm in the process of setting up a series of automatically generated
image-heavy documentation for a large number of OpenSCAD-native models
(slightly north of 1,000). Each document has five static images rendered
for it and placed inline in the respective document. Each image is the same
model, from a different camera viewpoint.  Model images and document data
are expected to be updated ... well, if not frequently, then at least
*irregularly, *and may need to be regenerated on demand, and not through
the GUI. For the simple models, the time to render the images (with
--preview) can be as little as 10 seconds apart (that includes the amount
of time spent launching openscad.exe as well as the render); the more
complex models are so far pushing around 5 minutes (for about 25 minutes
total for that one model) and we haven't really gotten into finalizing the
bad ones. I shudder to think about what'll happen with --render, but we're
estimating several hours to fully re-render all the models.

Ideally, https://github.com/openscad/openscad/issues/1645 would be
implemented and a persistent cache would save the subsequent re-renders,
but it looks like it's stalled and hasn't had progress on it in some time,
but I thought maybe someone had a strategy to produce multiple image
exports from the same running command-line invoked process, or some
undocumented CLI option existed that let one specify multiple camera
viewpoints.

So: is it possible to get more than one viewpoint image exported from the
same render activity via the command-line, without re-rendering the model?
Is there hope here?

--


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

--


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Running the command with dumb.scad on Win10 using OpenSCAD 2021.01, I get the same results as Jonathon. baz00000.png gets created fine. bax00001.png is empty. On Thu, Mar 31, 2022 at 11:47 PM Revar Desmera <revarbat@gmail.com> wrote: > Interestingly, with your quoted scad file and my OpenSCAD.app > 2021.03.08 (on MacOS), it generates all four images using the same quoted > command-line. > > - Revar > > > On Mar 31, 2022, at 9:20 PM, Jonathan Gilbert <jong@jong.org> wrote: > > It honestly had not occurred that --animate would produce individual > frames, and it makes sense to try that. I'll have to read up more on what > $vpr and --animate is meant to do, since it's ... not really working the > way I'dve expected. Currently, I've got the following occurring: > > jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$ cat dumb.scad >> module h() { >> cube(20); >> } >> h(); >> jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$ openscad >> -D '$vpr=[[55,0,120],[90,0,0],[55,0,240],[75,0,90]][floor($t*4)]' -o >> baz.png --view axes --animate 4 dumb.scad >> Exporting dumb.scad... >> WARNING: Viewall and autocenter disabled in favor of $vp* >> Compiling design (CSG Products normalization)... >> Normalized CSG tree has 1 elements >> Geometries in cache: 1 >> Geometry cache size in bytes: 728 >> CGAL Polyhedrons in cache: 0 >> CGAL cache size in bytes: 0 >> Total rendering time: 0:00:00.078 >> Exporting dumb.scad... >> Compiling design (CSG Products normalization)... >> Normalized CSG tree has 1 elements >> MS GDI - RegisterClass failed >> last-error code: 5 >> Can't create OpenGL OffscreenView. Code: -1. >> Geometries in cache: 1 >> Geometry cache size in bytes: 728 >> CGAL Polyhedrons in cache: 0 >> CGAL cache size in bytes: 0 >> Total rendering time: 0:00:00.000 >> jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$ ls -al baz* >> -rw-r--r-- 1 jong jong 5937 Mar 31 21:16 baz00000.png >> -rw-r--r-- 1 jong jong 0 Mar 31 21:16 baz00001.png >> jong@GILBERT-SAYS-WINDOWS-IS-THE-WORST:~/507$ >> > > (This is Ubuntu 20.04 running under WSL, using OpenSCAD 2021.01.) > > > > On Thu, Mar 31, 2022 at 7:51 PM Revar Desmera <revarbat@gmail.com> wrote: > >> To clarify more, you can do something like: -o foo.png —animate 4 >> -D’$vpr=[[55,0,120], [90,0,0], [55,0,240], [75,0,90]][floor($t*4)]` and it >> will output four png files named like `foo_XX.png`, where XX are >> consecutive frame numbers. >> >> - Revar >> >> >> On Mar 31, 2022, at 7:44 PM, Revar Desmera <revarbat@gmail.com> wrote: >> >> From experience with openscad_docsgen, you CAN, by abusing the animation >> framework. I make a script with a line that sets $vpr based on $t, then >> tell OpenSCAD to animate a number of frames via the —animate FRAMES >> command-line arguments. >> >> - Revar >> >> >> On Mar 31, 2022, at 7:38 PM, Jonathan Gilbert <jong@jong.org> wrote: >> >> Can one have multiple invocations of openscad from the command-line >> produce images from the same render? >> >> I'm in the process of setting up a series of automatically generated >> image-heavy documentation for a large number of OpenSCAD-native models >> (slightly north of 1,000). Each document has five static images rendered >> for it and placed inline in the respective document. Each image is the same >> model, from a different camera viewpoint. Model images and document data >> are expected to be updated ... well, if not *frequently*, then at least >> *irregularly, *and may need to be regenerated on demand, and not through >> the GUI. For the simple models, the time to render the images (with >> --preview) can be as little as 10 seconds apart (that includes the amount >> of time spent launching openscad.exe as well as the render); the more >> complex models are so far pushing around 5 minutes (for about 25 minutes >> total for that one model) and we haven't really gotten into finalizing the >> bad ones. I shudder to think about what'll happen with --render, but we're >> estimating several hours to fully re-render all the models. >> >> Ideally, https://github.com/openscad/openscad/issues/1645 would be >> implemented and a persistent cache would save the subsequent re-renders, >> but it looks like it's stalled and hasn't had progress on it in some time, >> but I thought maybe someone had a strategy to produce multiple image >> exports from the same running command-line invoked process, or some >> undocumented CLI option existed that let one specify multiple camera >> viewpoints. >> >> So: is it possible to get more than one viewpoint image exported from the >> same render activity via the command-line, without re-rendering the model? >> Is there hope here? >> >> -- >> - Jon Gilbert >> jong@jong.org / jgilbertsjc@gmail.com >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> >> >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > > > -- > - Jon Gilbert > jong@jong.org / jgilbertsjc@gmail.com > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
TP
Torsten Paul
Fri, Apr 1, 2022 2:36 PM

On 01.04.22 16:29, Leonard Martin Struttmann wrote:

Running the command with dumb.scad on Win10 using OpenSCAD 2021.01,
I get the same results as Jonathon.  baz00000.png gets created fine.
bax00001.png is empty.

Yes, it's a Windows specific issue and I think that was fixed 12 days
ago via:

https://github.com/openscad/openscad/pull/4185

ciao,
Torsten.

On 01.04.22 16:29, Leonard Martin Struttmann wrote: > Running the command with dumb.scad on Win10 using OpenSCAD 2021.01, > I get the same results as Jonathon.  baz00000.png gets created fine. > bax00001.png is empty. Yes, it's a Windows specific issue and I think that was fixed 12 days ago via: https://github.com/openscad/openscad/pull/4185 ciao, Torsten.
JG
Jonathan Gilbert
Fri, Apr 1, 2022 2:42 PM

Wow, timely. :D  Great to know that it's known and fixed, thanks for the
pointer.  I'll shelve this idea and come back to it when the fix is GA.
Thanks!

On Fri, Apr 1, 2022 at 7:36 AM Torsten Paul Torsten.Paul@gmx.de wrote:

On 01.04.22 16:29, Leonard Martin Struttmann wrote:

Running the command with dumb.scad on Win10 using OpenSCAD 2021.01,
I get the same results as Jonathon.  baz00000.png gets created fine.
bax00001.png is empty.

Yes, it's a Windows specific issue and I think that was fixed 12 days
ago via:

https://github.com/openscad/openscad/pull/4185

ciao,
Torsten.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Wow, timely. :D Great to know that it's known and fixed, thanks for the pointer. I'll shelve this idea and come back to it when the fix is GA. Thanks! On Fri, Apr 1, 2022 at 7:36 AM Torsten Paul <Torsten.Paul@gmx.de> wrote: > On 01.04.22 16:29, Leonard Martin Struttmann wrote: > > Running the command with dumb.scad on Win10 using OpenSCAD 2021.01, > > I get the same results as Jonathon. baz00000.png gets created fine. > > bax00001.png is empty. > > Yes, it's a Windows specific issue and I think that was fixed 12 days > ago via: > > https://github.com/openscad/openscad/pull/4185 > > ciao, > Torsten. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > -- - Jon Gilbert jong@jong.org / jgilbertsjc@gmail.com
MF
Michael Frey
Fri, Apr 1, 2022 4:16 PM

On 01.04.22 05:16, Revar Desmera wrote:

Speaking of animating to PNGs from the command-line, has there been
any consideration of allowing OpenSCAD to generate APNGs (Animated
PNGs) or animated GIFs?

  • Revar

Never say never, but highly unlikely.

It is easy to find command line tools that converts a bunch of pngs to
Animated GIF, APNG or video. So, for those that want/need to create
animations with OpenSCAD, there is already a way. That limits demand.

Adding such a feature would require adding third party dependencies.

Adding third party dependencies is tricky and has implications like
compatibility, cross platform, compile time... a lot of work that
requires a highly skilled developer.

Features are implemented based on what code contributors/developers want
to add/want to do.

For a developer, it much easier to just use a command line tool, then to
just even think about how to integrate such a feature. So, people that
could work on such a feature have the least need for it.

Even for a commercial project: Adding in a third party command line tool
is much less hazzle then integrating source code into the project.

/Note that as an Open Source project, OpenSCAD will needlessly add
thirdparty binaries./

In that sense, I recommend you to look for a command line tool and to
write/look for a short script that automates the conversion.

/(this is how I handle creating animated GIFs and WebM Videos)/

With kind regards,

Michael

On 01.04.22 05:16, Revar Desmera wrote: > Speaking of animating to PNGs from the command-line, has there been > any consideration of allowing OpenSCAD to generate APNGs (Animated > PNGs) or animated GIFs? > > - Revar Never say never, but highly unlikely. It is easy to find command line tools that converts a bunch of pngs to Animated GIF, APNG or video. So, for those that want/need to create animations with OpenSCAD, there is already a way. That limits demand. Adding such a feature would require adding third party dependencies. Adding third party dependencies is tricky and has implications like compatibility, cross platform, compile time... a lot of work that requires a highly skilled developer. Features are implemented based on what code contributors/developers want to add/want to do. For a developer, it much easier to just use a command line tool, then to just even think about how to integrate such a feature. So, people that could work on such a feature have the least need for it. Even for a commercial project: Adding in a third party command line tool is much less hazzle then integrating source code into the project. /Note that as an Open Source project, OpenSCAD will needlessly add thirdparty binaries./ In that sense, I recommend you to look for a command line tool and to write/look for a short script that automates the conversion. /(this is how I handle creating animated GIFs and WebM Videos)/ With kind regards, Michael