Efficient generation of many PNG images from command line?

classic Classic list List threaded Threaded
48 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Re: Efficient generation of many PNG images from command line?

MichaelAtOz'


> -----Original Message-----
> From: Discuss [mailto:[hidden email]] On Behalf Of Vigardo
> Sent: Sat, 23 Jan 2021 04:43
>
> I think that *tp3* already advised about this on a previous post:
>
> Me: "2) Will the persistent cache feature persist across multiple separate
> calls to OpenSCAD command-lined or just the GUI version?"
> tp3: "It's supposed to work with both (but command line will need explicit
> setup options, not using the config that is available in GUI)."
>
> What are these "explicit setup options"?
>

The persistent cache feature is a work-in-progress. Not in nightly builds yet.


--
This email has been checked for viruses by AVG.
https://www.avg.com


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Efficient generation of many PNG images from command line?

Vigardo
MichaelAtOz' wrote
> The persistent cache feature is a work-in-progress. Not in nightly builds
> yet.

Ok, I´ll wait. But, the cache behavior is going to be the exactly the same
in command-line and GUI, am I right? Thanks!


Whosawhatsis wrote
> Putting --camera in your command line will override $vpr, $vpt and $vpd.

This totally explains why the "Viewport rotation" method did not update the
view :-) Thanks!


JordanBrown wrote
> You probably want to stick with the latter.  It's doing what you want to
> do:  moving the camera.

Ok, I´ll do!


JordanBrown wrote
> But of course if your animation consists of flying your camera around,
> it will get really boring if you don't have the camera move when $t
> changes.

Sure, but this is how a turn table is expected to behave :-)


JordanBrown wrote
> I'm not sure exactly what problem you're seeing, but note that --camera is
> the same as setting $vpt, $vpr, and $vpd.
> Don't have $vpt/$vpr/$vpd depend on $t.  Or is there something more
> complicated that I'm missing?

Yes, I´ll try to explain it better here, sorry :-)

When I generate the snapshots from GUI there is no problem, the turntable
works as expected (both ways, rotating either the object itself or the
camera).

// Viewport rotation
$vpr=[90,0,-$t*180];
echo("vpr=",$vpr,"vpt=",$vpt,"vpd=",$vpd);
render() mymodel();

The problem arises when I run the same script from the command-line:

#> OpenSCAD-2021.01-RC6-x86_64.AppImage --animate 36 ViewRender.scad

Then, to obtain the same expected behavior I have to explicitly set the view
port distance ($vpd) to some manually adjusted distance, e.g. $vpd=5. If I
do not add this value to the code, then the views appear empty since the
$vpd seems to be set to some very high distance (i.e. 500) by default:

ECHO: "vpr=", [90, 0, 0], "vpt=", [0, 0, 0], "vpd=", 500

Conversely, the same $vpd-less script works perfect from GUI. It seems that
if the GUI is not used, then the $vpd is not appropriately set. May this be
a bug? Any workaround?

Note that for my turntable application the camera must be rotating while
maintaining a constant distance to the object. The $vpd must be maintained
from first to last frame of the animation, but at the same time must be set
automatically to fit the whole object. If the view is fitted to the object
for each frame, this will cause an annoying "zoom in & out" effect. This
latter effect happens if using the "Explicit rotation" approach form
command-line but not from GUI.







--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Efficient generation of many PNG images from command line?

MichaelAtOz'


> -----Original Message-----
> From: Discuss [mailto:[hidden email]] On Behalf Of Vigardo
> Sent: Sat, 23 Jan 2021 23:13
> To: [hidden email]
> Subject: Re: [OpenSCAD] Efficient generation of many PNG images from command line?
>
> MichaelAtOz' wrote
> > The persistent cache feature is a work-in-progress. Not in nightly builds
> > yet.
>
> Ok, I´ll wait. But, the cache behavior is going to be the exactly the same
> in command-line and GUI, am I right? Thanks!
>


The persistent cache feature is a work-in-progress.


--
This email has been checked for viruses by AVG.
https://www.avg.com


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Efficient generation of many PNG images from command line?

nophead
> $vpd seems to be set to some very high distance (i.e. 500) by default:

Yes that is the default for the GUI as well. You have to click on ViewAll to set it appropriately for your object. On the command line --viewall does the same.

On Sat, 23 Jan 2021 at 12:34, Michael Marx <[hidden email]> wrote:


> -----Original Message-----
> From: Discuss [mailto:[hidden email]] On Behalf Of Vigardo
> Sent: Sat, 23 Jan 2021 23:13
> To: [hidden email]
> Subject: Re: [OpenSCAD] Efficient generation of many PNG images from command line?
>
> MichaelAtOz' wrote
> > The persistent cache feature is a work-in-progress. Not in nightly builds
> > yet.
>
> Ok, I´ll wait. But, the cache behavior is going to be the exactly the same
> in command-line and GUI, am I right? Thanks!
>


The persistent cache feature is a work-in-progress.


--
This email has been checked for viruses by AVG.
https://www.avg.com


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Efficient generation of many PNG images from command line?

Vigardo
nophead wrote
> Yes that is the default for the GUI as well. You have to click on ViewAll
> to set it appropriately for your object. On the command line --viewall
> does
> the same.

That is what I though. I tried --viewall option in some of my past tests but
since it did not work I removed it from the command line options (to avoid
adding noise to the discussion :-)... but I was wrong...this may be the key
point.

The --viewall option does not work from command line, at least not for
OpenSCAD-2021.01-RC5-x86_64 and OpenSCAD-2021.01-RC6-x86_64 versions:

#> OpenSCAD-2021.01-RC6-x86_64.AppImage --viewall --animate 36
ViewRender.scad

As you can check, the $vpd remains 500, with or without --viewall option.

SCRIPT CODE:
$vpr=[90,0,-$t*180];
echo("vpr=",$vpr,"vpt=",$vpt,"vpd=",$vpd);
render() mymodel();

OUTPUT:
ECHO: "vpr=", [90, 0, 0], "vpt=", [0, 0, 0], "vpd=", 500

Would this be a bug related to --viewall behavior in command-line tool or am
I doing something wrong?





--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
tp3
Reply | Threaded
Open this post in threaded view
|

Re: Efficient generation of many PNG images from command line?

tp3
> As you can check, the $vpd remains 500, with or
> without --viewall option.

And generates this warning with --viewall which explains
what's happening:

WARNING: Viewall and autocenter disabled in favor of $vp*

ciao,
  Torsten.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Efficient generation of many PNG images from command line?

JordanBrown
In reply to this post by Vigardo
On 1/23/2021 4:13 AM, Vigardo wrote:
JordanBrown wrote
But of course if your animation consists of flying your camera around,
it will get really boring if you don't have the camera move when $t
changes.
Sure, but this is how a turn table is expected to behave :-)

So, as you noted, you can either rotate the model, or move the camera.

If you want to simulate a turntable, you'd rotate the model while keeping the camera in the same place.  Note that the axes stay fixed.
rotate($t*360) cube(10, center=true);

From the CLI, you could have --camera set whatever viewpoint you wanted.  You probably don't want --viewall, because for a non-trivial model it'll probably zoom in and out to make the various views of the model fit into the viewport.  (Or, alternatively, you could have the model set $vpr/$vpt/$vpd and lock the viewpoint in place.)

If you want to simulate flying the camera around the model, you'd move the camera while leaving the model in the same place.  Note that the axes move, because the camera is moving relative to them.

$vpr=[80,0,360*$t];
$vpd=140;
$vpt=[0,0,0];
cube(10, center=true);

Here you would not want to use --camera or --viewall from the CLI, because the model file is completely controlling the camera.

What values would you want for $vpt/$vpr/$vpd or, alternatively, for --camera?  Probably simplest is to first *not* set up the camera, use the interactive controls to put the camera where you want it, and then read the values off the "Viewport" line at the bottom of the window.  You can also use the "Copy viewport ..." options from the Edit menu.



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Efficient generation of many PNG images from command line?

Vigardo
In reply to this post by tp3
tp3 wrote
> And generates this warning with --viewall which explains what's happening:
> WARNING: Viewall and autocenter disabled in favor of $vp*

You´re absolutely right. I miss that warning, I´m sorry!


JordanBrown wrote
> From the CLI, you could have --camera set whatever viewpoint you
> wanted.  You probably don't want --viewall, because for a non-trivial
> model it'll probably zoom in and out to make the various views of the
> model fit into the viewport.  (Or, alternatively, you could have the
> model set $vpr/$vpt/$vpd and lock the viewpoint in place.)

This is exactly what I´m trying to. However, if I keep the camera fix and
rotate the model, the zoom in and out issue happens. Both using or not
--viewall option. Conversely, if I keep the model fix but rotate the camera
around it, then I have to manually set the $vpd variable... which is not
possible (see next)


JordanBrown wrote
> What values would you want for $vpt/$vpr/$vpd or, alternatively, for
> --camera?  Probably simplest is to first *not* set up the camera, use
> the interactive controls to put the camera where you want it, and then
> read the values off the "Viewport" line at the bottom of the window. 
> You can also use the "Copy viewport ..." options from the Edit menu.

Unfortunately, your approach is not possible for my application. Let me tell
you more. I´m developing some web server that is intended to run OpenSCAD
(server side), so automation and CLI are mandatory. Sorry, perhaps I should
have told this before.

I already figured out a quite dirty workaround to create the turntable... I
used an awk script that parsed the an OpenSCAD generated STL file to dump
its boundary box and from it I can roughly estimate $vpd... But I don´t like
this solution since it slows down even more my workflow. The way OpenSCAD
defines the appropriate camera zoom using the "View All" seems much better.

How would I tell OpenSCAD (from CLI) to use and keep fixed the camera "View
All" parameters?

Perhaps adding a "--viewall_zero" option to initialize all view parameters
at $t=0 (i.e. for the first frame), and then let the user choose which $vp*
parameters to update via code?

Any better alternative?



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Efficient generation of many PNG images from command line?

JordanBrown
Sorry, we've exceeded my understanding.  Somebody who understands the camera settings, and in particular how they relate to "view all", will need to chime in.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Efficient generation of many PNG images from command line?

nophead
I always use --autocenter with --viewall on the command line to get the camera looking at the object and scaling it to fit. I haven't tried the command line animation yet. If it recomputes the camera setting per frame I could that would be a problem. In the GUI you do it first and then start the animation. It needs to match that.

On Sat, 23 Jan 2021 at 17:32, Jordan Brown <[hidden email]> wrote:
Sorry, we've exceeded my understanding.  Somebody who understands the camera settings, and in particular how they relate to "view all", will need to chime in.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Efficient generation of many PNG images from command line?

Vigardo
I agree, both behaviors should match.

I some previous post, Torsen said that Viewall and autocenter are
automatically disabled in favor of $vp*:

Vigardo: As you can check, the $vpd remains 500, with or without --viewall
option.
tp3: And generates this warning with --viewall which explains what's
happening:
tp3: WARNING: Viewall and autocenter disabled in favor of $vp*

It seems that --viewall and/or --autocenter cannot be used at the same time
as $vp* for some reason.

Should I wait for the fix or is there any workaround to create a turntable
where the camera remains at the same distance to the target without having
to manually customize $vpd for each model? Thank you all!





--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Efficient generation of many PNG images from command line?

nophead
I think the problem is --viewall and --autocenter can only operate after the model has been generated because they need to inspect its bounding sphere.

$vp* need to be evaluated before the model can be generated, because it might depend on them. So you can't really use both.

On Sun, 24 Jan 2021 at 21:50, Vigardo <[hidden email]> wrote:
I agree, both behaviors should match.

I some previous post, Torsen said that Viewall and autocenter are
automatically disabled in favor of $vp*:

Vigardo: As you can check, the $vpd remains 500, with or without --viewall
option.
tp3: And generates this warning with --viewall which explains what's
happening:
tp3: WARNING: Viewall and autocenter disabled in favor of $vp*

It seems that --viewall and/or --autocenter cannot be used at the same time
as $vp* for some reason.

Should I wait for the fix or is there any workaround to create a turntable
where the camera remains at the same distance to the target without having
to manually customize $vpd for each model? Thank you all!





--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Efficient generation of many PNG images from command line?

RevarBat
In reply to this post by Vigardo
So, with the disabling of --viewall and --autocenter, and the fact that there is no way in OpenSCAD to determine the actual size of geometry to set $vpr from, I take it it’s now not possible to actually do the equivalent of those options?

-Revar

> On Jan 24, 2021, at 1:50 PM, Vigardo <[hidden email]> wrote:
>
> I agree, both behaviors should match.
>
> I some previous post, Torsen said that Viewall and autocenter are
> automatically disabled in favor of $vp*:
>
> Vigardo: As you can check, the $vpd remains 500, with or without --viewall
> option.
> tp3: And generates this warning with --viewall which explains what's
> happening:
> tp3: WARNING: Viewall and autocenter disabled in favor of $vp*
>
> It seems that --viewall and/or --autocenter cannot be used at the same time
> as $vp* for some reason.
>
> Should I wait for the fix or is there any workaround to create a turntable
> where the camera remains at the same distance to the target without having
> to manually customize $vpd for each model? Thank you all!
>
>
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Efficient generation of many PNG images from command line?

nophead
For a rotating turntable can you just rotate the model with $t and use  --viewall and --autocenter?

On Sun, 24 Jan 2021 at 22:49, Revar Desmera <[hidden email]> wrote:
So, with the disabling of --viewall and --autocenter, and the fact that there is no way in OpenSCAD to determine the actual size of geometry to set $vpr from, I take it it’s now not possible to actually do the equivalent of those options?

-Revar

> On Jan 24, 2021, at 1:50 PM, Vigardo <[hidden email]> wrote:
>
> I agree, both behaviors should match.
>
> I some previous post, Torsen said that Viewall and autocenter are
> automatically disabled in favor of $vp*:
>
> Vigardo: As you can check, the $vpd remains 500, with or without --viewall
> option.
> tp3: And generates this warning with --viewall which explains what's
> happening:
> tp3: WARNING: Viewall and autocenter disabled in favor of $vp*
>
> It seems that --viewall and/or --autocenter cannot be used at the same time
> as $vp* for some reason.
>
> Should I wait for the fix or is there any workaround to create a turntable
> where the camera remains at the same distance to the target without having
> to manually customize $vpd for each model? Thank you all!
>
>
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Efficient generation of many PNG images from command line?

RevarBat
Well, if I knew the size of the object first, that’d be fine.  But I’m generating hundreds of images for arbitrary OpenSCAD code.  Imagine having examples that vary in size from 1mm to 500mm.  I really don’t want to have to go through and standardize the sizes or add $vpr specs for literally hundreds of examples.

- Revar


On Jan 24, 2021, at 3:19 PM, nop head <[hidden email]> wrote:

For a rotating turntable can you just rotate the model with $t and use  --viewall and --autocenter?

On Sun, 24 Jan 2021 at 22:49, Revar Desmera <[hidden email]> wrote:
So, with the disabling of --viewall and --autocenter, and the fact that there is no way in OpenSCAD to determine the actual size of geometry to set $vpr from, I take it it’s now not possible to actually do the equivalent of those options?

-Revar

> On Jan 24, 2021, at 1:50 PM, Vigardo <[hidden email]> wrote:
>
> I agree, both behaviors should match.
>
> I some previous post, Torsen said that Viewall and autocenter are
> automatically disabled in favor of $vp*:
>
> Vigardo: As you can check, the $vpd remains 500, with or without --viewall
> option.
> tp3: And generates this warning with --viewall which explains what's
> happening:
> tp3: WARNING: Viewall and autocenter disabled in favor of $vp*
>
> It seems that --viewall and/or --autocenter cannot be used at the same time
> as $vp* for some reason.
>
> Should I wait for the fix or is there any workaround to create a turntable
> where the camera remains at the same distance to the target without having
> to manually customize $vpd for each model? Thank you all!
>
>
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Efficient generation of many PNG images from command line?

nophead
You don't. --viewall and --autocenter still work from the command line as long as you don't use $vp* in the code.

Previously $vp? were ignored on the command line, so there is no loss of functionality. You can now use them but not at the same time as  --viewall and --autocenter.

On Mon, 25 Jan 2021 at 07:36, Revar Desmera <[hidden email]> wrote:
Well, if I knew the size of the object first, that’d be fine.  But I’m generating hundreds of images for arbitrary OpenSCAD code.  Imagine having examples that vary in size from 1mm to 500mm.  I really don’t want to have to go through and standardize the sizes or add $vpr specs for literally hundreds of examples.

- Revar


On Jan 24, 2021, at 3:19 PM, nop head <[hidden email]> wrote:

For a rotating turntable can you just rotate the model with $t and use  --viewall and --autocenter?

On Sun, 24 Jan 2021 at 22:49, Revar Desmera <[hidden email]> wrote:
So, with the disabling of --viewall and --autocenter, and the fact that there is no way in OpenSCAD to determine the actual size of geometry to set $vpr from, I take it it’s now not possible to actually do the equivalent of those options?

-Revar

> On Jan 24, 2021, at 1:50 PM, Vigardo <[hidden email]> wrote:
>
> I agree, both behaviors should match.
>
> I some previous post, Torsen said that Viewall and autocenter are
> automatically disabled in favor of $vp*:
>
> Vigardo: As you can check, the $vpd remains 500, with or without --viewall
> option.
> tp3: And generates this warning with --viewall which explains what's
> happening:
> tp3: WARNING: Viewall and autocenter disabled in favor of $vp*
>
> It seems that --viewall and/or --autocenter cannot be used at the same time
> as $vp* for some reason.
>
> Should I wait for the fix or is there any workaround to create a turntable
> where the camera remains at the same distance to the target without having
> to manually customize $vpd for each model? Thank you all!
>
>
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Efficient generation of many PNG images from command line?

Vigardo
In reply to this post by nophead
nophead wrote
> For a rotating turntable can you just rotate the model with $t and use
> --viewall and --autocenter?

No, I can´t. If I use the following script and command the annoying zoom in
and out issue arises...

// Explicit rotation
echo("a=",$t*180);
rotate(a=$t*180,v=[0,0,1])
    render()
        mymodel();

#> OpenSCAD-2021.01-RC5-x86_64.AppImage --viewall --autocenter --animate 36
ViewRender.scad


RevarBat wrote
> Well, if I knew the size of the object first, that’d be fine.  But I’m
> generating hundreds of images for arbitrary OpenSCAD code.  Imagine having
> examples that vary in size from 1mm to 500mm.  I really don’t want to have
> to go through and standardize the sizes or add $vpr specs for literally
> hundreds of examples.

As I tried to explain in previous posts, this is exactly why using the $vp*
or camera controls is not a good workaround since I would have to have an
specific $vpd value for each (different size) model.




--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Efficient generation of many PNG images from command line?

nophead
Well I would say it is a bug if the --animate applies  --viewall --autocenter  per frame. That doesn't make sense. It should do it once at the start, like you would do the GUI.

On Mon, 25 Jan 2021 at 19:56, Vigardo <[hidden email]> wrote:
nophead wrote
> For a rotating turntable can you just rotate the model with $t and use
> --viewall and --autocenter?

No, I can´t. If I use the following script and command the annoying zoom in
and out issue arises...

// Explicit rotation
echo("a=",$t*180);
rotate(a=$t*180,v=[0,0,1])
    render()
        mymodel();

#> OpenSCAD-2021.01-RC5-x86_64.AppImage --viewall --autocenter --animate 36
ViewRender.scad


RevarBat wrote
> Well, if I knew the size of the object first, that’d be fine.  But I’m
> generating hundreds of images for arbitrary OpenSCAD code.  Imagine having
> examples that vary in size from 1mm to 500mm.  I really don’t want to have
> to go through and standardize the sizes or add $vpr specs for literally
> hundreds of examples.

As I tried to explain in previous posts, this is exactly why using the $vp*
or camera controls is not a good workaround since I would have to have an
specific $vpd value for each (different size) model.




--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Efficient generation of many PNG images from command line?

Whosawhatsis
I'm currently running OpenSCAD from the command line with the --animate option for the first time. I really like the feature, and it's presumably faster/more efficient than my old method of using a bash script with a loop, since it's a single instance and benefits from caching.

The one thing that's missing is the ability to parallelize it. With my script, I was able to run multiple instances, each generating every fourth frame, with offsets so that I could take advantage of multiple processor cores. I could probably add a variable that would alter $t to create the same offset, but it would be better if OpenSCAD could natively parallelize this process, rendering an arbitrary number of frames concurrently to take better advantage of the processor.

Of course, if the core of OpenSCAD could be made to work in a multi-threaded way, rendering one frame at a time would be able to take advantage of the cores, and it would speed up everything in OpenSCAD while making concurrent frame processing unnecessary, but I assume there are lots of good reasons that hasn't been done, and just allowing concurrent frame rendering should be a lot easier.
On Jan 25, 2021, 14:28 -0800, nop head <[hidden email]>, wrote:
Well I would say it is a bug if the --animate applies  --viewall --autocenter  per frame. That doesn't make sense. It should do it once at the start, like you would do the GUI.

On Mon, 25 Jan 2021 at 19:56, Vigardo <[hidden email]> wrote:
nophead wrote
> For a rotating turntable can you just rotate the model with $t and use
> --viewall and --autocenter?

No, I can´t. If I use the following script and command the annoying zoom in
and out issue arises...

// Explicit rotation
echo("a=",$t*180);
rotate(a=$t*180,v=[0,0,1])
    render()
        mymodel();

#> OpenSCAD-2021.01-RC5-x86_64.AppImage --viewall --autocenter --animate 36
ViewRender.scad


RevarBat wrote
> Well, if I knew the size of the object first, that’d be fine.  But I’m
> generating hundreds of images for arbitrary OpenSCAD code.  Imagine having
> examples that vary in size from 1mm to 500mm.  I really don’t want to have
> to go through and standardize the sizes or add $vpr specs for literally
> hundreds of examples.

As I tried to explain in previous posts, this is exactly why using the $vp*
or camera controls is not a good workaround since I would have to have an
specific $vpd value for each (different size) model.




--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Problem with SVG import

boxcarmib
Here’s a screen cap of path I manually constructed in inkscape…



It’s supposed to be filled in with no outline and after lots of pulling my hair out I finally discovered that the ‘problem’ is that i created the points in the ‘wrong’ order and the ‘solution' was to “reverse” the direction of the path (Menu: Path/Reverse). That gave me what I was looking for…



However when I import the SVG file into OpenSCAD (RC6) all I’m able to get is the outline and not the filled object. I’ve tried a variety of solutions (importing the original non-reversed path), saving in another format, loading that format, then saving in svg, etc. etc. But no luck, OpenSCAD still gives me this:





Anyone have any ideas, suggestions, thoughts on how to get OpenSCAD to preview/render this properly?

I’ve attached the SVG file as well.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Screen Shot 2021-02-05 at 2.50.23 PM.png (56K) Download Attachment
Screen Shot 2021-02-05 at 2.49.09 PM.png (52K) Download Attachment
Screen Shot 2021-02-05 at 2.57.51 PM.png (22K) Download Attachment
hairDryerBlade.reveng.svg (5K) Download Attachment
123