discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Long rendering time when using difference() with a lot of objects.

J
jpmendes
Thu, Mar 3, 2016 7:23 PM

Hey,

for 500 holes my code took 8:45 min to render in a dual core old machine.
I know your process is based on previous calculations possible by another
program and maybe your approach should be different than mine. Nevertheless
half an hour vs. 8:45 is a significant improvement.

http://forum.openscad.org/file/n16278/perforated_cylinder.jpg

Cheers,
jpmendes

--
View this message in context: http://forum.openscad.org/Long-rendering-time-when-using-difference-with-a-lot-of-objects-tp16268p16278.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Hey, for 500 holes my code took 8:45 min to render in a dual core old machine. I know your process is based on previous calculations possible by another program and maybe your approach should be different than mine. Nevertheless half an hour vs. 8:45 is a significant improvement. <http://forum.openscad.org/file/n16278/perforated_cylinder.jpg> Cheers, jpmendes -- View this message in context: http://forum.openscad.org/Long-rendering-time-when-using-difference-with-a-lot-of-objects-tp16268p16278.html Sent from the OpenSCAD mailing list archive at Nabble.com.
CA
Carsten Arnholm
Thu, Mar 3, 2016 8:03 PM

On 03. mars 2016 15:08, Maël Naccache wrote:

Le 2016-03-03 14:00, arnholm@arnholm.org a écrit :

On 2016-03-03 11:39, Maël Naccache wrote:

I've attached two exemple that takes a long time to render.

Thanks. However, it seems your attachments didn't make it through (or
there is something wrong with my mail reader).

Everything seems ok on my side, but I've pasted them just in case :
http://paste.ubuntu.com/15273519/ - circle_extrude1.scad.
http://paste.ubuntu.com/15273525/ - cylinder_higher1.scad.

Thank you, it was my web mail reader that messed it up. I could see the
original attachments just fine when using Thunderbird.

I have done the experiments mentioned now, some relevant files are
attached in the .7z file:

cylinder_higher1.scad : Your original .scad file
mael_cylinder.as : Your file translated to AngelScript CSG
mael_cylinder_CARVE.csg : OpenSCAD .csg file produced, see below
mael_cylinder_CGAL.csg  : OpenSCAD .csg file produced, see below

I am using OpenSCAD 2015.03-2 in these tests, all running on a Windows 7
desktop, approx 5 years old.

TEST A: Your cylinder_higher1.scad displayed with F6. It took just over
13.5 minutes and the final result was somewhat imprecise, i.e. the large
cylinder had visible linear segments.

cylinder_higher1.scad
-> OpenSCAD (F6)  (~13.5 minutes)
(large cylinder imprecise)

TEST B1: Your original .scad file translated into AngelScript CSG and an
OpenSCAD .csg file was produced from it. Slight editing of the file
($fs=1.0 globally and $fn=360 for the big cylinder) made the resolution
better than the original in TEST A. Displaying this file with OpenSCAD
F6 took 14 minutes.

mael_cylinder.as
-> AngelScript CSG (~7 sec)
-> mael_cylinder_CGAL.csg
-> OpenSCAD (F6)  (~14 minutes)

TEST B2: Here an experimental feature is tested, starting from the same
AngelScript CSG file as in test B1. An experimental file format (.xcsg)
is produced and further processed by a program called xcsg, xcsg
processing is based on the CARVE library to do boolean operations. xcsg
will be released on GitHub when ready. Processing the data with
xcsg/carve took 5 minutes and used no more than 200MB ram. The result
was written to an OpenSCAD .csg file as a complex polyhedron, see the
attached file.

mael_cylinder.as
-> AngelScript CSG (~7 sec)
-> mael_cylinder.xcsg      (experimental)
-> xcsg (CARVE)    (5 min) (experimental)
-> mael_cylinder_CARVE.csg (polyhedron result)
-> OpenSCAD (F6)  (10 sec)

The resolution of the B2 result is largely comparable to B1, so these
results can offer at least a rough indication of how CARVE compares to
CGAL wrt. speed and memory requirements. By reducing the resolution
somewhat, the xcsg/carve processing time is further reduced significantly.

Carsten Arnholm

On 03. mars 2016 15:08, Maël Naccache wrote: > Le 2016-03-03 14:00, arnholm@arnholm.org a écrit : >> On 2016-03-03 11:39, Maël Naccache wrote: >>> I've attached two exemple that takes a long time to render. >> >> Thanks. However, it seems your attachments didn't make it through (or >> there is something wrong with my mail reader). > > Everything seems ok on my side, but I've pasted them just in case : > http://paste.ubuntu.com/15273519/ - circle_extrude1.scad. > http://paste.ubuntu.com/15273525/ - cylinder_higher1.scad. Thank you, it was my web mail reader that messed it up. I could see the original attachments just fine when using Thunderbird. I have done the experiments mentioned now, some relevant files are attached in the .7z file: cylinder_higher1.scad : Your original .scad file mael_cylinder.as : Your file translated to AngelScript CSG mael_cylinder_CARVE.csg : OpenSCAD .csg file produced, see below mael_cylinder_CGAL.csg : OpenSCAD .csg file produced, see below I am using OpenSCAD 2015.03-2 in these tests, all running on a Windows 7 desktop, approx 5 years old. TEST A: Your cylinder_higher1.scad displayed with F6. It took just over 13.5 minutes and the final result was somewhat imprecise, i.e. the large cylinder had visible linear segments. cylinder_higher1.scad -> OpenSCAD (F6) (~13.5 minutes) (large cylinder imprecise) TEST B1: Your original .scad file translated into AngelScript CSG and an OpenSCAD .csg file was produced from it. Slight editing of the file ($fs=1.0 globally and $fn=360 for the big cylinder) made the resolution better than the original in TEST A. Displaying this file with OpenSCAD F6 took 14 minutes. mael_cylinder.as -> AngelScript CSG (~7 sec) -> mael_cylinder_CGAL.csg -> OpenSCAD (F6) (~14 minutes) TEST B2: Here an experimental feature is tested, starting from the same AngelScript CSG file as in test B1. An experimental file format (.xcsg) is produced and further processed by a program called xcsg, xcsg processing is based on the CARVE library to do boolean operations. xcsg will be released on GitHub when ready. Processing the data with xcsg/carve took 5 minutes and used no more than 200MB ram. The result was written to an OpenSCAD .csg file as a complex polyhedron, see the attached file. mael_cylinder.as -> AngelScript CSG (~7 sec) -> mael_cylinder.xcsg (experimental) -> xcsg (CARVE) (5 min) (experimental) -> mael_cylinder_CARVE.csg (polyhedron result) -> OpenSCAD (F6) (10 sec) The resolution of the B2 result is largely comparable to B1, so these results can offer at least a rough indication of how CARVE compares to CGAL wrt. speed and memory requirements. By reducing the resolution somewhat, the xcsg/carve processing time is further reduced significantly. Carsten Arnholm
N
Neon22
Thu, Mar 3, 2016 9:40 PM

The offical release is 2015.03-2 on Windows.
Is it time for a new release for 2015.05.16 ?

8hours vs 0 seconds seems like maybe it might be ??

http://www.openscad.org/downloads.html

--
View this message in context: http://forum.openscad.org/Long-rendering-time-when-using-difference-with-a-lot-of-objects-tp16268p16281.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

The offical release is 2015.03-2 on Windows. Is it time for a new release for 2015.05.16 ? 8hours vs 0 seconds seems like maybe it might be ?? http://www.openscad.org/downloads.html -- View this message in context: http://forum.openscad.org/Long-rendering-time-when-using-difference-with-a-lot-of-objects-tp16268p16281.html Sent from the OpenSCAD mailing list archive at Nabble.com.
TP
Torsten Paul
Thu, Mar 3, 2016 10:01 PM

On 03/03/2016 10:40 PM, Neon22 wrote:

The offical release is 2015.03-2 on Windows.
Is it time for a new release for 2015.05.16 ?

8hours vs 0 seconds seems like maybe it might be ??

Where's that calculation coming from?

The 2015.03-2 patch release is from November 2015

Both that version and the nightly build need 0 seconds
for the 2D + linear-extrude example posted (the file
named circle_extrude1.scad).

A new release would be nice, but there's no chance to be
faster than 0 seconds ;-).

ciao,
Torsten.

On 03/03/2016 10:40 PM, Neon22 wrote: > The offical release is 2015.03-2 on Windows. > Is it time for a new release for 2015.05.16 ? > > 8hours vs 0 seconds seems like maybe it might be ?? > Where's that calculation coming from? The 2015.03-2 patch release is from November 2015 Both that version and the nightly build need 0 seconds for the 2D + linear-extrude example posted (the file named circle_extrude1.scad). A new release would be nice, but there's no chance to be faster than 0 seconds ;-). ciao, Torsten.
NH
nop head
Thu, Mar 3, 2016 10:22 PM

How does that compare with 2015.05.16 (git e673fff) that I am using?

On 3 March 2016 at 22:01, Torsten Paul Torsten.Paul@gmx.de wrote:

On 03/03/2016 10:40 PM, Neon22 wrote:

The offical release is 2015.03-2 on Windows.
Is it time for a new release for 2015.05.16 ?

8hours vs 0 seconds seems like maybe it might be ??

Where's that calculation coming from?

The 2015.03-2 patch release is from November 2015

Both that version and the nightly build need 0 seconds
for the 2D + linear-extrude example posted (the file
named circle_extrude1.scad).

A new release would be nice, but there's no chance to be
faster than 0 seconds ;-).

ciao,
Torsten.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

How does that compare with 2015.05.16 (git e673fff) that I am using? On 3 March 2016 at 22:01, Torsten Paul <Torsten.Paul@gmx.de> wrote: > On 03/03/2016 10:40 PM, Neon22 wrote: > > The offical release is 2015.03-2 on Windows. > > Is it time for a new release for 2015.05.16 ? > > > > 8hours vs 0 seconds seems like maybe it might be ?? > > > Where's that calculation coming from? > > The 2015.03-2 patch release is from November 2015 > > Both that version and the nightly build need 0 seconds > for the 2D + linear-extrude example posted (the file > named circle_extrude1.scad). > > A new release would be nice, but there's no chance to be > faster than 0 seconds ;-). > > ciao, > Torsten. > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
TP
Torsten Paul
Thu, Mar 3, 2016 10:38 PM

On 03/03/2016 11:22 PM, nop head wrote:

How does that compare with 2015.05.16 (git e673fff) that I am using?

The most critical stuff was some crash fixes, I think.

List of changes should be:
https://github.com/openscad/openscad/compare/master@%7B2015-05-16%7D...openscad-2015.03-2

So if you get crashes with some model, try the release version,
otherwise it probably will not make much difference.

ciao,
Torsten.

On 03/03/2016 11:22 PM, nop head wrote: > How does that compare with 2015.05.16 (git e673fff) that I am using? > The most critical stuff was some crash fixes, I think. List of changes should be: https://github.com/openscad/openscad/compare/master@%7B2015-05-16%7D...openscad-2015.03-2 So if you get crashes with some model, try the release version, otherwise it probably will not make much difference. ciao, Torsten.