Auto reload and preview behaviour?

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

Auto reload and preview behaviour?

MichaelAtOz
Administrator
I haven't used this much lately.
Having turned it on for testing I noticed what I think is strange behaviour.

File/New, paste some code [in this case issue #3527 - crashing code],
File/Save-as, type name, Enter, CRASH!

Save-as was followed by auto reload and preview.

2019.05 same.
2015.03 does not reload/preview.

I don't think it should reload on Save-as.

Bug or Feature?



-----
OpenSCAD Admin - email* me if you need anything,  or if I've done something stupid...

* on the Forum, click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
* on the Forum, click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain;
to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.
Reply | Threaded
Open this post in threaded view
|

Re: Auto reload and preview behaviour?

MichaelAtOz
Administrator
If nobody screams I'll report this as a bug.

> -----Original Message-----
> From: Discuss [mailto:[hidden email]] On Behalf Of MichaelAtOz
> Sent: Fri, 11 Dec 2020 13:21
> To: [hidden email]
> Subject: [OpenSCAD] Auto reload and preview behaviour?
>
> I haven't used this much lately.
> Having turned it on for testing I noticed what I think is strange behaviour.
>
> File/New, paste some code [in this case issue #3527 - crashing code],
> File/Save-as, type name, Enter, CRASH!
>
> Save-as was followed by auto reload and preview.
>
> 2019.05 same.
> 2015.03 does not reload/preview.
>
> I don't think it should reload on Save-as.
>
> Bug or Feature?
>
>
>
> -----
> OpenSCAD Admin - email* me if you need anything,  or if I've done something stupid...
>
> * on the Forum, click on my MichaelAtOz label, there is a link to email me.
>
> Unless specifically shown otherwise above, my contribution is in the Public Domain; to the
> extent possible under law, I have waived all copyright and related or neighbouring rights
> to this work. Obviously inclusion of works of previous authors is not included in the
> above.
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


--
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 Admin - email* me if you need anything, or if I've done something stupid...
* on the Forum, click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain;
to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.
Reply | Threaded
Open this post in threaded view
|

Re: Auto reload and preview behaviour?

Troberg
I agree.

Also, it would be nice if it detected a previous crash, and offered to open
the backup file, without trying to rendering it, on the next start.

Now, I'll have to open it in another editor, fix the error, open an empty
project, paste the edited version and save as over the original. Not that
hard, but a chain of steps that can be effed up badly if you don't pay
attention.



--
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: Auto reload and preview behaviour?

Tim Hawkins
Can the whole rendering process not be run in a try/catch block and have a message box show a suitable error message if an exception is thrown. That way if rendering fails it does not blow out the app. 

On Sun, Dec 13, 2020, 16:22 Troberg <[hidden email]> wrote:
I agree.

Also, it would be nice if it detected a previous crash, and offered to open
the backup file, without trying to rendering it, on the next start.

Now, I'll have to open it in another editor, fix the error, open an empty
project, paste the edited version and save as over the original. Not that
hard, but a chain of steps that can be effed up badly if you don't pay
attention.



--
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: Auto reload and preview behaviour?

thehans
It already does if i remember correctly.  Try/catch just doesn't help for a null pointer dereference.

Anyways I feel like crashes are fairly rare(particularly once a stable release is finalized), and usually very promptly fixed once identified.  The crash above was fixed within a day.  
So I'm not sure it's worth the effort to add special handling of crashes as a new feature.

On Sun, Dec 13, 2020 at 3:06 AM Tim Hawkins <[hidden email]> wrote:
Can the whole rendering process not be run in a try/catch block and have a message box show a suitable error message if an exception is thrown. That way if rendering fails it does not blow out the app. 

On Sun, Dec 13, 2020, 16:22 Troberg <[hidden email]> wrote:
I agree.

Also, it would be nice if it detected a previous crash, and offered to open
the backup file, without trying to rendering it, on the next start.

Now, I'll have to open it in another editor, fix the error, open an empty
project, paste the edited version and save as over the original. Not that
hard, but a chain of steps that can be effed up badly if you don't pay
attention.



--
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: Auto reload and preview behaviour?

Troberg
thehans wrote
> Anyways I feel like crashes are fairly rare(particularly once a stable
> release is finalized), and usually very promptly fixed once identified.
> The crash above was fixed within a day.
> So I'm not sure it's worth the effort to add special handling of crashes
> as
> a new feature.

I don't get crashes that often, but it's not uncommon to do something stupid
so that it locks up in a "forever-render" which can't be cancelled, so I
have to kill the process.

This brings another issue to mind: A cancel button that's actually
responsive all the time, and which can always cancel a render.



--
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: Auto reload and preview behaviour?

MichaelAtOz
Administrator
Troberg wrote
> it's not uncommon to do something stupid
> so that it locks up in a "forever-render" which can't be cancelled, so I
> have to kill the process.
>
> This brings another issue to mind: A cancel button that's actually
> responsive all the time, and which can always cancel a render.

There is an issue on GitHub, asking to do Preview/F5 in a separate thread,
so it can be cancelled, like Render/F6.

ATM there is a 'X' button at the progress bar for Render/F6, but it is CGAL
granular, so if it is the final big union, it has to finish before
cancelling.



-----
OpenSCAD Admin - email* me if you need anything,  or if I've done something stupid...

* on the Forum, click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
* on the Forum, click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain;
to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.
Reply | Threaded
Open this post in threaded view
|

Re: Auto reload and preview behaviour?

jon_bondy
Troberg may have been focusing on complex objects that are so difficult
to view on the screen (after F5) that OpenSCAD becomes unresponsive to
any input and has to be killed.  I am doing increasingly complex
projects, and this happens to me frequently. This is one reason I have
moved some projects to AngelCAD: the rendering time is much shorter and
I can then actually view the object, rather than having to kill it.

Sorry that I do not have a constructive suggestion for how to improve
OpenSCAD in this particular regard

Jon

On 12/13/2020 6:58 AM, MichaelAtOz wrote:

> Troberg wrote
>> it's not uncommon to do something stupid
>> so that it locks up in a "forever-render" which can't be cancelled, so I
>> have to kill the process.
>>
>> This brings another issue to mind: A cancel button that's actually
>> responsive all the time, and which can always cancel a render.
> There is an issue on GitHub, asking to do Preview/F5 in a separate thread,
> so it can be cancelled, like Render/F6.
>
> ATM there is a 'X' button at the progress bar for Render/F6, but it is CGAL
> granular, so if it is the final big union, it has to finish before
> cancelling.
>

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

Re: Auto reload and preview behaviour?

nophead
There is a simple example where F5 becomes unresponsive here: https://github.com/openscad/openscad/issues/3535

It seems that a nested difference explodes in OpenCSG complexity. The simple solution is to add a render because GCAL doesn't find it too difficult and of course doing it in 2D is much faster.

On Sun, 13 Dec 2020 at 12:40, jon <[hidden email]> wrote:
Troberg may have been focusing on complex objects that are so difficult
to view on the screen (after F5) that OpenSCAD becomes unresponsive to
any input and has to be killed.  I am doing increasingly complex
projects, and this happens to me frequently. This is one reason I have
moved some projects to AngelCAD: the rendering time is much shorter and
I can then actually view the object, rather than having to kill it.

Sorry that I do not have a constructive suggestion for how to improve
OpenSCAD in this particular regard

Jon

On 12/13/2020 6:58 AM, MichaelAtOz wrote:
> Troberg wrote
>> it's not uncommon to do something stupid
>> so that it locks up in a "forever-render" which can't be cancelled, so I
>> have to kill the process.
>>
>> This brings another issue to mind: A cancel button that's actually
>> responsive all the time, and which can always cancel a render.
> There is an issue on GitHub, asking to do Preview/F5 in a separate thread,
> so it can be cancelled, like Render/F6.
>
> ATM there is a 'X' button at the progress bar for Render/F6, but it is CGAL
> granular, so if it is the final big union, it has to finish before
> cancelling.
>

_______________________________________________
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: Auto reload and preview behaviour?

Troberg
nophead wrote
> It seems that a nested difference explodes in OpenCSG complexity. The
> simple solution is to add a render because GCAL doesn't find it too
> difficult and of course doing it in 2D is much faster.

Yep, that is usually my problem. I add a seemingly harmless difference, and
it locks up. Adding a render solves it.



--
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: Auto reload and preview behaviour?

jon_bondy
Would one of you please provide an example of where to put this render()?

Thanks

Jon

On 12/13/2020 12:37 PM, Troberg wrote:

> nophead wrote
>> It seems that a nested difference explodes in OpenCSG complexity. The
>> simple solution is to add a render because GCAL doesn't find it too
>> difficult and of course doing it in 2D is much faster.
> Yep, that is usually my problem. I add a seemingly harmless difference, and
> it locks up. Adding a render solves it.
>
>
>
> --
> 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: Auto reload and preview behaviour?

Troberg
jon_bondy wrote
> Would one of you please provide an example of where to put this render()?

Right before the last working operation.

So, for example:

difference(){ //no longer fails
    difference(){ //works
        myobject();
        myotherobject();
    }

    difference(){ //works
        myspecialobject();
        myveryspecialobject();

    }
}

I would change this to:

difference(){ //fails
    render()
    difference(){ //works
        myobject();
        myotherobject();
    }

    render()
    difference(){ //works
        myspecialobject();
        myveryspecialobject();

    }
}

Think of it like this (simplified...): Difference retains the original
geometries and the added "cut boundaries". This can get too much when you
stack enough differences on complex objects. Render kind of removes
everything that is not needed, and creates an optimized geometry which
contains only what's needed for the result, without any "history" geometry.
This is much simpler, and thus doesn't get too much for the next difference.



--
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: Auto reload and preview behaviour?

Tim Hawkins
In reply to this post by thehans
Normaly the os catches them and raises a seg fault signal against the process,  cant openscad trap the signal, show a diagnostic, and jump to the outer loop with a modal dialog that has a quit/contine option, continue reentering the command loop/listenrer/dispatcher?

On Sun, 13 Dec 2020, 18:54 Hans L, <[hidden email]> wrote:
It already does if i remember correctly.  Try/catch just doesn't help for a null pointer dereference.

Anyways I feel like crashes are fairly rare(particularly once a stable release is finalized), and usually very promptly fixed once identified.  The crash above was fixed within a day.  
So I'm not sure it's worth the effort to add special handling of crashes as a new feature.

On Sun, Dec 13, 2020 at 3:06 AM Tim Hawkins <[hidden email]> wrote:
Can the whole rendering process not be run in a try/catch block and have a message box show a suitable error message if an exception is thrown. That way if rendering fails it does not blow out the app. 

On Sun, Dec 13, 2020, 16:22 Troberg <[hidden email]> wrote:
I agree.

Also, it would be nice if it detected a previous crash, and offered to open
the backup file, without trying to rendering it, on the next start.

Now, I'll have to open it in another editor, fix the error, open an empty
project, paste the edited version and save as over the original. Not that
hard, but a chain of steps that can be effed up badly if you don't pay
attention.



--
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: Auto reload and preview behaviour?

MichaelAtOz
Administrator
Tim Hawkins wrote
> Normaly the os catches them and raises a seg fault signal against the
> process,  cant openscad trap the signal, show a diagnostic, and jump to
> the
> outer loop

Often crashes leave the process in an indeterminate state, particularly
memory.




-----
OpenSCAD Admin - email* me if you need anything,  or if I've done something stupid...

* on the Forum, click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
* on the Forum, click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain;
to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.