CPU and RAM Resources Allocations Increase for OpenSCAD

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

CPU and RAM Resources Allocations Increase for OpenSCAD

Still_learning
My laptop computer is currently crunching numbers for an OpenSCAD STL file
which can be described as including a number of spheres, with an $fn=250
setting.

Running unimpeded since Friday, my resources program tells me that the
openscad.exe has ballooned to 22.73 GB, and the program varies its CPU
resources use from <1% to about 50% on a semi-repeating basis.  Yesterday
morning the openscad.exe appeared as 13.xx GB.

Running Windows 7 up to date, and OpenSCAD 2017.01.20.
Machine has 8 GB RAM and 20 GB allocated as additional disk
RAM.  High performance (7200 rpm) 1 TB HDD with openscad
in a 160 GB partition.

Windows is set to run without slowdown or stopping and for
"High Performance".

Display window meter for OpenSCAD reads 0/1000.

Is there any way to up the speed at which OpenSCAD crunches
with internal program switches or otherwise?





-----
The more I learn, the more I get curious about.
--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
The more I learn, the more I get curious about.
tp3
Reply | Threaded
Open this post in threaded view
|

Re: CPU and RAM Resources Allocations Increase for OpenSCAD

tp3
On 05/20/2018 05:58 PM, Still_learning wrote:
> My laptop computer is currently crunching numbers for
> an OpenSCAD STL file which can be described as including
> a number of spheres, with an $fn=250 setting.
>
Uff, why $fn=250? With that a single sphere has 61738 faces?

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: CPU and RAM Resources Allocations Increase for OpenSCAD

peetersm
In reply to this post by Still_learning
This is a great question, I would like to know what component would have the best effect on helping openscad render.
Which order do these help the most in? System Ram vs CPU speed vs Video card ram.

I have noticed that system ram seems to help my render process times the most.


On Sun, May 20, 2018 at 11:58 AM, Still_learning <[hidden email]> wrote:
My laptop computer is currently crunching numbers for an OpenSCAD STL file
which can be described as including a number of spheres, with an $fn=250
setting.

Running unimpeded since Friday, my resources program tells me that the
openscad.exe has ballooned to 22.73 GB, and the program varies its CPU
resources use from <1% to about 50% on a semi-repeating basis.  Yesterday
morning the openscad.exe appeared as 13.xx GB.

Running Windows 7 up to date, and OpenSCAD 2017.01.20.
Machine has 8 GB RAM and 20 GB allocated as additional disk
RAM.  High performance (7200 rpm) 1 TB HDD with openscad
in a 160 GB partition.

Windows is set to run without slowdown or stopping and for
"High Performance".

Display window meter for OpenSCAD reads 0/1000.

Is there any way to up the speed at which OpenSCAD crunches
with internal program switches or otherwise?





-----
The more I learn, the more I get curious about.
--
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
tp3
Reply | Threaded
Open this post in threaded view
|

Re: CPU and RAM Resources Allocations Increase for OpenSCAD

tp3
On 05/20/2018 06:26 PM, Mark Peeters wrote:
> This is a great question, I would like to know what component
> would have the best effect on helping openscad render. Which
> order do these help the most in? System Ram vs CPU speed vs
> Video card ram.
>
 From earlier discussions, it seems the most effective thing is
to maximize the combination of single thread CPU speed + RAM
access speed.

GPU may help a tiny bit for interactive preview performance,
but it has no impact on the final render (F6).

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: CPU and RAM Resources Allocations Increase for OpenSCAD

Still_learning
In reply to this post by tp3
High $fn= setting is due to required smoothness of surfaces.

Do I take it from your reply that Openscad has no internal option for
increasing its resource use?

Or should I take away that it does not matter when a high $fn= number is
used?



-----
The more I learn, the more I get curious about.
--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
The more I learn, the more I get curious about.
Reply | Threaded
Open this post in threaded view
|

Re: CPU and RAM Resources Allocations Increase for OpenSCAD

MichaelPFrey
In reply to this post by Still_learning
On 20.05.2018 17:58, Still_learning wrote:
> Running unimpeded since Friday, my resources program tells me that the
> openscad.exe has ballooned to 22.73 GB, and the program varies its CPU
> resources use from <1% to about 50% on a semi-repeating basis.  Yesterday
> morning the openscad.exe appeared as 13.xx GB.

When you talk about CPU usage: Please also provide the number of
physical cores and hyper-treading.

50% sounds like a dual core machine, where only one core is being used.

Note that OpenSCAD only really uses one core.

1% CPU usages combined with the RAM size and usage means that the RAM is
bottlenecking the system.


On 20.05.2018 17:58, Still_learning wrote:
> Is there any way to up the speed at which OpenSCAD crunches
> with internal program switches or otherwise?
I do not know what you model and how you model it, so it is hard to
guess what helps.

For my use case, it helps to break up the model into "sub sections" that
I each render into to STL files and then I merge those STL files. This
way, I only have to re-render the changed section and the assembly.
Even when re-rendering the whole model from scratch, this approach can
lower the RAM usage (less temporary data hold in memory) and/or help
rendering multiple parts at the same time (increasing CPU usage).

An other approach could be to run OpenSCAD in command line mode may also
help.

You might also may want to try experimental windows builds.
Maybe some of the changes in the last few years might make the rendering
process faster (or slower) for you.
But given the time it takes to render for you, trial and error does not
seam to be the best approach.

With kind regards,
Michael Frey

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

Re: CPU and RAM Resources Allocations Increase for OpenSCAD

MichaelPFrey
In reply to this post by Still_learning
On 20.05.2018 18:52, Still_learning wrote:
> Do I take it from your reply that Openscad has no internal option for
> increasing its resource use?
You do not have an excess of resources, so allowing OpenSCAD to use more
of the resources would not help rendering time, even if there would be
an option.

First of all: OpenSCAD has no multithreading support.
So, there is no simple option to use more of your CPU.

Given your description (8 GB of real RAM, but OpenSCAD needing 23GB to
render you file) you are also bottle necked by your RAM-size.
Allowing OpenSCAD to use even more resources would not help.

(so even if we had multithreading support: It would not help, when data
has to be moved backed and forward between Harddrive and RAM. Keep in
mind: More threads generally means more memory usages)

My strategy would be to review the Code you are using.
If that is not an option, the next thing would be a RAM upgrade to about
32GB (yes I know it is expensive - but the CPU having to wait for data
from a mechanical hard drive is a real bottleneck), followed by a CPU
with higher single thread performance (which might knock down a few
percents - CPUs have not gotten that much faster in the last few years).
Realistically, optimizing your code has the most potential - but
offcourse also the hardest.

Maybe it would help to have a SSD for the Swap/Page File, but I doubt
that this would significantly speed up the process - so I would not
bother with that option.

With kind regards,
Michael Frey

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

Re: CPU and RAM Resources Allocations Increase for OpenSCAD

Still_learning
In reply to this post by MichaelPFrey
MichaelPFrey wrote:

>>On 20.05.2018 17:58, Still_learning wrote:
>> Running unimpeded since Friday, my resources program tells me that the
>> openscad.exe has ballooned to 22.73 GB, and the program varies its CPU
>> resources use from <1% to about 50% on a semi-repeating basis.  Yesterday
>> morning the openscad.exe appeared as 13.xx GB.

> When you talk about CPU usage: Please also provide the number of
> physical cores and hyper-treading.

AMD dual core processors.  Process monitor indicates 10 open threads being
used by program to varying degrees and with various quantities of CPU
cycles being devoted to each.  The number of threads stays constant, while
the cycle usages rises and falls among them.

> 50% sounds like a dual core machine, where only one core is being used.

I have seen the process monitor register as high as 57% of CPU, though
the typical high is in the 53% region.

> Note that OpenSCAD only really uses one core.

Is that something OpenSCAD has control over in its system calls?

> 1% CPU usages combined with the RAM size and usage means that
> the RAM is bottlenecking the system.

This is possible, but now that I  am looking a little more closely at
process, it strikes me that the program is perhaps calculating the faces
of each sphere sequentially and adding the result to a cached assembly
area, then, as it rises up the side, the sphere need for more computing
power arises.

Response from the system is noticeably impacted for using other programs,
in that they take more time to load and are initially slower to use, but
then
response rises to normal rates.


> But given the time it takes to render for you, trial and error does not
> seam to be the best approach.

Your split model building approach might work in this instance, but I think
not.  But I will try it after the first STL is finished generating.

As you say, T & E is not all that applicable in this case.





-----
The more I learn, the more I get curious about.
--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
The more I learn, the more I get curious about.
Reply | Threaded
Open this post in threaded view
|

Re: CPU and RAM Resources Allocations Increase for OpenSCAD

Still_learning
As an additional note, one of the threads opened in the process indicates
that this is a time critical process, so aside from critical system
functions, OpenSCAD.exe has first call on system resources.

Also, the swap/page RAM capacity is 20 gb, plus system RAM of 8 gb is still
well short of the
22+ gb size of the openscad.exe incidence.

I agree that a machine with faster processors and 64 GB of RAM would
probably speed things up.

I am not complaining about OpenSCAD, only trying to understand its quirks.

If OpenSCAD would be best served on a stand alone dedicated server, I can
live with that and building a suitable machine is not a big deal, only $$$.

Then I can build and preview the files in my laptop and render them on the
big machine.

Thanks for the input.





-----
The more I learn, the more I get curious about.
--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
The more I learn, the more I get curious about.
Reply | Threaded
Open this post in threaded view
|

Re: CPU and RAM Resources Allocations Increase for OpenSCAD

Alan Cox
On Sun, 20 May 2018 12:10:50 -0700 (MST)
Still_learning <[hidden email]> wrote:

> As an additional note, one of the threads opened in the process indicates
> that this is a time critical process, so aside from critical system
> functions, OpenSCAD.exe has first call on system resources.
>
> Also, the swap/page RAM capacity is 20 gb, plus system RAM of 8 gb is still
> well short of the
> 22+ gb size of the openscad.exe incidence.
>
> I agree that a machine with faster processors and 64 GB of RAM would
> probably speed things up.
>
> I am not complaining about OpenSCAD, only trying to understand its quirks.
>
> If OpenSCAD would be best served on a stand alone dedicated server, I can
> live with that and building a suitable machine is not a big deal, only $$$.

Shouldn't cost you much. OpenSCAD is single threaded so there is no point
buying an expensive system to run it. If you need multithreading you need
to move to one of the altenatives that does multi-thread although they
tend to be less nice to use in other ways.

You'll get the same general performance from a dirt cheap i3 as an
equivalent top end processor with the same turbo frequency and TDP. You
can even turn off hyperthreading on it.

Alan

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

Re: CPU and RAM Resources Allocations Increase for OpenSCAD

Still_learning

Thank you for the tip Alan.

On May 20, 2018 12:32 PM, <[hidden email]> wrote:
On Sun, 20 May 2018 12:10:50 -0700 (MST)
Still_learning <[hidden email]> wrote:

> As an additional note, one of the threads opened in the process indicates
> that this is a time critical process, so aside from critical system
> functions, OpenSCAD.exe has first call on system resources.
>
> Also, the swap/page RAM capacity is 20 gb, plus system RAM of 8 gb is still
> well short of the
> 22+ gb size of the openscad.exe incidence.
>
> I agree that a machine with faster processors and 64 GB of RAM would
> probably speed things up.
>
> I am not complaining about OpenSCAD, only trying to understand its quirks.
>
> If OpenSCAD would be best served on a stand alone dedicated server, I can
> live with that and building a suitable machine is not a big deal, only $$$.

Shouldn't cost you much. OpenSCAD is single threaded so there is no point
buying an expensive system to run it. If you need multithreading you need
to move to one of the altenatives that does multi-thread although they
tend to be less nice to use in other ways.

You'll get the same general performance from a dirt cheap i3 as an
equivalent top end processor with the same turbo frequency and TDP. You
can even turn off hyperthreading on it.

Alan

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
The more I learn, the more I get curious about.
Reply | Threaded
Open this post in threaded view
|

Re: CPU and RAM Resources Allocations Increase for OpenSCAD

Alan Cox
In reply to this post by MichaelPFrey
> If that is not an option, the next thing would be a RAM upgrade to about
> 32GB (yes I know it is expensive - but the CPU having to wait for data

Can be cheaper to pick up a second hand Xeon server or workstation. Not
only do they have sufficient sockets to do it with smaller memories but
they also take older RAM and require registered RAM that won't work on
desktops. Makes a 64GB E5-26x0 v1 system really quite cheap. E56xx
systems are even cheaper but a shade slower - they use DDR2 registered
ECC RAM which is dirt cheap.

Last I checked I could pick up a hex core Xeon 5690 (3.4GHz) box with 48GB
of RAM for about €350 (€400 or so for 72GB) which is the same price as
32GB of DDR4 for a current system and not much different to 32GB of DDR3
!

Alan

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

Re: CPU and RAM Resources Allocations Increase for OpenSCAD

Neon22
In reply to this post by Still_learning
There are several elephants in the room. single threaded underlying
library in openSCAD is one but one of the others is the $fn=250.

Its worth noting that $fn can be set per operation.
e.e. sphere(r=10, center=true, $fn=100) will only affect that sphere.

So you might have a cylindrical curve where a high polycount is required
to get a smooth surface whjilst at the same time using a sphere to do
rounding on a filletted edge. In which case using $fn=8 for eth sphere
and $fn=250 for eth cylinder will vastly improve the overal speed of
your solution.


_______________________________________________
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: CPU and RAM Resources Allocations Increase for OpenSCAD

tp3
Multi-threading in OpenSCAD itself will not make a huge difference
as this is still limited by the final union. Some measurements can
be found in https://github.com/openscad/openscad/pull/1980

It would be just one useful puzzle piece which combined with other
things could really speed up rendering.

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: CPU and RAM Resources Allocations Increase for OpenSCAD

MichaelAtOz
Administrator
For small models and/or low-mid $fn, maximise single thread CPU speed + CPU
cache size.
For larger  models and/or high $fn, add memory. CPU is useless if you swap.
If you have swapping, add memory.
If you can't add memory, get a small SSD for swapping (or larger for global
replacement).
But this will be slow. For me, swapping to HDD was useless, swapping to SDD
worked but slowly.
Get the fastest memory you can, get an interleaved memory motherboard
(unusual on laptops).

However, 20+GB does point to overly optimistic design parameters...

Add $$$ to the  multi-thread bounty
<https://www.bountysource.com/issues/394455-multi-threaded-geometry-rendering>
, tho that may take a while...needs research into latest CGAL versions.

Having observed Windows internals with OpenSCAD & large models, I can
explain many of the earlier observations. But if you are swapping to HDD the
explanation is simple, it is churning chunks of memory & waiting on I/O,
more than calculating geometry.



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

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.

The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/   time is running out!
--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Admin - email* me if you need anything,
or if I've done something stupid...
* 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.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: CPU and RAM Resources Allocations Increase for OpenSCAD

MichaelAtOz
Administrator
p.s. Note that I did not mention GPU. Save your money for CPU & memory.

Still_learning, can you share your code? Sometimes there are particular
issues where a small coding change can make a big difference, lots of
co-incident points for example.



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

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.

The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/   time is running out!
--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Admin - email* me if you need anything,
or if I've done something stupid...
* 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.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: CPU and RAM Resources Allocations Increase for OpenSCAD

Len Trigg
In reply to this post by tp3
There's also a branch that has the ability to turn off implicit unions -- it would be fantastic if that and the multithreading were available as an experimental option in nightly builds for people to play with and see how they affect the ability to use multiple cores in practise. It's heartbreaking to see an 8-core machine sitting there spinning on a single cpu for so long during rendering, while these potentially useful branches sit bitrotting.

Cheers,
Len.

On Mon, 21 May 2018 at 08:22, Torsten Paul <[hidden email]> wrote:
Multi-threading in OpenSCAD itself will not make a huge difference
as this is still limited by the final union. Some measurements can
be found in https://github.com/openscad/openscad/pull/1980

It would be just one useful puzzle piece which combined with other
things could really speed up rendering.

ciao,
   Torsten.


_______________________________________________
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: CPU and RAM Resources Allocations Increase for OpenSCAD

jon_bondy
In reply to this post by Alan Cox
There was a thread a while back about how performance was degraded
because one of the RAM caches was overflowing.  Getting dirt cheap RAM
is not always as good a deal as you might imagine

Jon


On 5/20/2018 3:47 PM, [hidden email] wrote:

>> If that is not an option, the next thing would be a RAM upgrade to about
>> 32GB (yes I know it is expensive - but the CPU having to wait for data
> Can be cheaper to pick up a second hand Xeon server or workstation. Not
> only do they have sufficient sockets to do it with smaller memories but
> they also take older RAM and require registered RAM that won't work on
> desktops. Makes a 64GB E5-26x0 v1 system really quite cheap. E56xx
> systems are even cheaper but a shade slower - they use DDR2 registered
> ECC RAM which is dirt cheap.
>
> Last I checked I could pick up a hex core Xeon 5690 (3.4GHz) box with 48GB
> of RAM for about €350 (€400 or so for 72GB) which is the same price as
> 32GB of DDR4 for a current system and not much different to 32GB of DDR3
> !
>
> Alan
>
> _______________________________________________
> 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: CPU and RAM Resources Allocations Increase for OpenSCAD

nophead
I think union time is proportional to the square of the number of facets of the two items being unioned. With a "number" of spheres with 61738 facets I don't think it will finish in a life time.

The way to estimatet how long it will take is to run it with $fn set to small numbers and look at how the time increases with $fn. Then you can predict how long it will be for $fn=250. It will be a gross underestimation because it doesn't take into account swapping, etc. But I am sure it will show you it is totally impractical to work with such values of $fn in OpenSCAD.

On 21 May 2018 at 01:29, jon <[hidden email]> wrote:
There was a thread a while back about how performance was degraded because one of the RAM caches was overflowing.  Getting dirt cheap RAM is not always as good a deal as you might imagine

Jon



On 5/20/2018 3:47 PM, [hidden email] wrote:
If that is not an option, the next thing would be a RAM upgrade to about
32GB (yes I know it is expensive - but the CPU having to wait for data
Can be cheaper to pick up a second hand Xeon server or workstation. Not
only do they have sufficient sockets to do it with smaller memories but
they also take older RAM and require registered RAM that won't work on
desktops. Makes a 64GB E5-26x0 v1 system really quite cheap. E56xx
systems are even cheaper but a shade slower - they use DDR2 registered
ECC RAM which is dirt cheap.

Last I checked I could pick up a hex core Xeon 5690 (3.4GHz) box with 48GB
of RAM for about €350 (€400 or so for 72GB) which is the same price as
32GB of DDR4 for a current system and not much different to 32GB of DDR3
!

Alan

_______________________________________________
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
rew
Reply | Threaded
Open this post in threaded view
|

Re: CPU and RAM Resources Allocations Increase for OpenSCAD

rew
On Mon, May 21, 2018 at 10:16:37AM +0100, nop head wrote:
> I think union time is proportional to the square of the number of facets of
> the two items being unioned. With a "number" of spheres with 61738 facets I
> don't think it will finish in a life time.
>
> The way to estimatet how long it will take is to run it with $fn set to
> small numbers and look at how the time increases with $fn. Then you can
> predict how long it will be for $fn=250. It will be a gross underestimation
> because it doesn't take into account swapping, etc. But I am sure it will
> show you it is totally impractical to work with such values of $fn in

Weeeelllll....

This means to me that there is work to be done. Is unioning inherently
quadratic?

Well,  yes it is: You have to check for each pair of triangles if they
intersect. Right?

Wrong! For example, you can split up the working space is small
cubes. Go through the list of triangles once, and those that are small
and land in 1 or two of those cubes, you place in a "bin" for that
cube. The big trangles and those that are unlucky go into a bin for
"other". Now from a theoretical point-of-view, the algorithm will
probably still be O(N^2) But from a practical point-of-view, in say
the case where you are unioning a bunch of near-perfect spheres, you
will be able to handle 90 or 99% of the items in O(N) time. This
improves the "feasable dataset size" by a big margin.

In practise, I work at low $fn, until for the final render I increase
it.

        Roger.

--
** [hidden email] ** http://www.BitWizard.nl/ ** +31-15-2600998 **
**    Delftechpark 26 2628 XH  Delft, The Netherlands. KVK: 27239233    **
*-- BitWizard writes Linux device drivers for any device you may have! --*
The plan was simple, like my brother-in-law Phil. But unlike
Phil, this plan just might work.

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