Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Boolean performance

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Boolean performance


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Boolean performance
  • Date: Thu, 14 Jan 2016 10:08:34 +0100
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:Wml9TxFW1aOs1oNG+6hpmp1GYnF86YWxBRYc798ds5kLTJ74oM6wAkXT6L1XgUPTWs2DsrQf27SQ4/CrADZfqb+681k8M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aJBzzOEJPK/jvHcaK1oLsh770q82YOl8XzBOGIppMbzyO5T3LsccXhYYwYo0Q8TDu5kVyRuJN2GlzLkiSlRuvru25/Zpk7jgC86l5r50IAu3Heb8lR+lYECg+KDJyo9b6sAHKCwqJ/HoVFGsM1QFZBhDMqxD8UJC2uSTzsq9x2TKRINbtHo0yQimouqd3VAfz2mBALC886GiRi8pqjasdrgjmvA1624eTYYebM711carZON8bXmFcRd0CaysUCYy1a84DDvEKIP1Dh4j7vVoH6xWkVie2A+a6gARFjHbtwaw31awFFhvH2xBoX/0Dt3HZsM/kGq4ZTeev3eiChWHYa/RM2DDhro3MWh8kqPCIG7l3dJyCmgEUCwrZgwDI+sTeNDSP27FVvg==
  • Organization: GeometryFactory

The increase of the runtime is due to the fact that your input are identical which leads to many filter failures.

No idea about the CLR, I've never tried.

Sebastien.

On 01/11/2016 11:42 AM, Taus Møller wrote:
I spent some time trying to figure out why I get so poor performance
from Boolean operations. I created at very simple example where two
sphere meshes are read from OFF files as Polyhedron_3. These are then
converted to Nef_polyhedron and used in a union. Here are the contents
of the main function:

std::ifstream stream1("Sphere1.OFF");
std::ifstream stream2("Sphere2.OFF");

Polyhedron P1 = Polyhedron();
Polyhedron P2 = Polyhedron();

stream1 >> P1;
stream2 >> P2;

Nef_polyhedron N1(P1);
Nef_polyhedron N2(P2);

Nef_polyhedron N3 = N1 + N2;


I have clocked each step of the process. As expected the bulk of the
time is spent on the union operation, with the mesh conversions a
distant second.

As you suggested previously, using Also using "typedef
CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Gmpq> > Kernel;" cut
a few seconds.

I found that the largest culprit was the /clr switch. When building
with /clr the union took around 30 seconds. Removing clr support cut
this down to 10 seconds. Why there is such a huge overhead in clr i
don't know. It is quite a problem, since we need the CLR support as we
need to be able to call CGAL from C#.

Even so, removing CLR support still has the union at 10 seconds, which
is quite a bit off what you reported. I have included the meshes i am
using just in case. However, we really need a general solution and
unless i am missing something it really should work fine with these
meshes.

On 20 November 2015 at 16:45, Sebastien Loriot (GeometryFactory)
<>
wrote:
I don't know what you did but I tried within the polyhedron demo
and the union of 2 spheres made of 1280 triangles took 756 ms
on my laptop using nef with EPEC.

Sebastien.


On 11/20/2015 04:35 PM, Taus Møller wrote:

It did indeed cut about 3 seconds of the boolean operation with two
sphere. It is still very very slow though.

On 20 November 2015 at 08:47, Sebastien Loriot (GeometryFactory)
<>
wrote:

On 11/10/2015 10:49 AM, Taus Møller wrote:


I have implemented boolean operation using nef polyhedra. The
performance however leaves something to be desired. A simple union
between two spheres constructed from roughly 400 triangles each, take
almost 8 seconds to solve(in release mode). Is this expected or might
i be doing something to inhibit the performance. I am using an epec
kernel which i know might impact performance. I have however been
unable to get it working with other kernels. Even so, 8 seconds seems
excessive for a simple union.

Are there any obvious caveats i might be missing, or is simply the
time it takes with CGAL?


In some case EPEC is slower that using directly
CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL:Gmpq> >.
You might want to give it a try.

Sebastien.

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss







--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss









Archive powered by MHonArc 2.6.18.

Top of Page