Problem with complex scad file

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

Problem with complex scad file

David Goodenough
I have tried to load the main scad file from :-

http://www.thingiverse.com/thing:12664

in a directory with the included files, and got very odd
behaviour from openscan.  I have tried this with openscad
version 2011-09-30.

I open the file, and then press F5.  Things start OK but then
the lower right console screen stops scrolling, but the scroll
bar indicates there is lots of stuff below it.  The machine
then locks solid, and while I can interrupt it by switching
to a console (Ctrl-Alt-F1) and killing it, but that is the
only way.

I have tried this on two different machines, both running Debian
sid.

Any ideas?

David

Reply | Threaded
Open this post in threaded view
|

Re: Problem with complex scad file

donbright
I had the same problem as you, when opening y-carriage2.scad

I ran 'top' to learn more: openscad uses 99% CPU for a few seconds,
then after printing "CSG Normalization" it rapidly gobbles up 800 M
RES and 990 M VIRT memory, and SWAP climbs into the high 70s M. Cpu
drops to about 5-10%.

I am running ubuntu 10 with 1 GB ram, openscad 2011.10.15

To run openscad without completely hard-locking my system I use ionice
+ nice, for example:

ionice -c 3 nice -n 19 openscad y-carriage2.scad

I am not sure of a workaround, other than breaking the part up into
smaller pieces... sorry

-DB


On Wed, Oct 19, 2011 at 2:26 PM, David Goodenough
<[hidden email]> wrote:

> I have tried to load the main scad file from :-
>
> http://www.thingiverse.com/thing:12664
>
> in a directory with the included files, and got very odd
> behaviour from openscan.  I have tried this with openscad
> version 2011-09-30.
>
> I open the file, and then press F5.  Things start OK but then
> the lower right console screen stops scrolling, but the scroll
> bar indicates there is lots of stuff below it.  The machine
> then locks solid, and while I can interrupt it by switching
> to a console (Ctrl-Alt-F1) and killing it, but that is the
> only way.
>
> I have tried this on two different machines, both running Debian
> sid.
>
> Any ideas?
>
> David
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
>

Reply | Threaded
Open this post in threaded view
|

Re: Problem with complex scad file

kintel
Administrator
On Oct 20, 2011, at 00:11 AM, Don Bright wrote:

> then after printing "CSG Normalization" it rapidly gobbles up 800 M

CSG normalization can severely mess things up some times.
In some cases, it might be faster to do a full CGAL evaluation instead (as CSG normalization is only used for the preview).

If this behavior is different from earlier versions of OpenSCAD, you might have stumbled across a new bug.

I'm out traveling atm., so I have limited time to investigate, so the more information you manage to dig up, the easier I can contribute.

Cheers,

 -Marius
Reply | Threaded
Open this post in threaded view
|

Re: Problem with complex scad file

Brad Pitcher
Yep, it works for me to go straight to render rather than previewing first.
I don't know about you guys but the preview actually crashed OpenSCAD. It only took a minute or so and the message on the shell was "Killed". This is with the latest code and also on the latest release (the one in June).

On Wed, Oct 19, 2011 at 4:07 PM, Marius Kintel <[hidden email]> wrote:
On Oct 20, 2011, at 00:11 AM, Don Bright wrote:

> then after printing "CSG Normalization" it rapidly gobbles up 800 M

CSG normalization can severely mess things up some times.
In some cases, it might be faster to do a full CGAL evaluation instead (as CSG normalization is only used for the preview).

If this behavior is different from earlier versions of OpenSCAD, you might have stumbled across a new bug.

I'm out traveling atm., so I have limited time to investigate, so the more information you manage to dig up, the easier I can contribute.

Cheers,

 -Marius
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad

Reply | Threaded
Open this post in threaded view
|

Re: Problem with complex scad file

kintel
Administrator
On Oct 20, 2011, at 01:33 AM, Brad Pitcher wrote:

> Yep, it works for me to go straight to render rather than previewing first.
> I don't know about you guys but the preview actually crashed OpenSCAD. It only took a minute or so and the message on the shell was "Killed". This is with the latest code and also on the latest release (the one in June).
>
Thrown together mode should also work fine.
I can put on my list to test with "all" earlier versions of OpenSCAD, just to make sure this isn't a regression.

 -Marius


Reply | Threaded
Open this post in threaded view
|

Re: Problem with complex scad file

Triffid Hunter
In reply to this post by Brad Pitcher
On Thu, Oct 20, 2011 at 10:33 AM, Brad Pitcher <[hidden email]> wrote:
> Yep, it works for me to go straight to render rather than previewing first.
> I don't know about you guys but the preview actually crashed OpenSCAD. It
> only took a minute or so and the message on the shell was "Killed". This is
> with the latest code and also on the latest release (the one in June).

that sounds more like your oom-killer stepped in to save your system
rather than a bona-fide crash.

Greg Frost's X-ends also cause openscad to gobble many gigabytes of
memory, and no-one I've spoken to has any idea why.

Reply | Threaded
Open this post in threaded view
|

Re: Problem with complex scad file

kintel
Administrator
On Oct 21, 2011, at 05:22 AM, Triffid Hunter wrote:
>
> that sounds more like your oom-killer stepped in to save your system
> rather than a bona-fide crash.
>
> Greg Frost's X-ends also cause openscad to gobble many gigabytes of
> memory, and no-one I've spoken to has any idea why.

OK, after a long debugging session, it turned out that this was a subtle bug in the CSG normalization code.
This is now fixed. While at it, I implemented bounding box-based tree pruning of the CSG tree, which further optimizes these complex CSG models. Such complex models should be orders of magnitude faster now.

Note that for performance reasons, OpenCSG rendering is still capped at 1000 object in the CSG tree. This could perhaps be made configurable, but it would be slow.

I also feel that optimizing the OpenGL rendering code would have significant potential.

 -Marius