Quantcast

Problem when changing from inexact to exact kernel

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problem when changing from inexact to exact kernel

tholzmann
Hi,

I have a CGAL::Triangulation_3, which I manually created (just converted
a given triangulation to a CGAL data structure) and which is valid (
checked with triangulation.is_valid()). I'm currently using
Exact_predicates_inexact_constructions_kernel, but I'm having problems
when making various geometric operation afterwards. Therefore, I want to
change to Exact_predicates_exact_constructions_kernel.

However, after changing the kernel, the conversion back to a double
representation doesn't work anymore, ie.

double x = CGAL::to_double(vertex->point().x());
...

results in a segmentation fault sometimes. It doesn't happen for all
vertices, just for some.

The same part of the code with inexact constructions kernel works
without problems.

Does someone have an idea what the problem could be?

Thomas


--
====================================================
Dipl.-Ing. Thomas Holzmann
TU Graz - Institut fuer Maschinelles Sehen und Darstellen
Graz University of Technology - Institute for Computer Graphics & Vision
Inffeldgasse 16/II, 8010 Graz, Austria

http://www.icg.tugraz.at/
phone: +43 316 873 5091
====================================================


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


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem when changing from inexact to exact kernel

Sebastien Loriot (GeometryFactory)
On 02/15/2017 03:15 PM, Thomas Holzmann wrote:

> Hi,
>
> I have a CGAL::Triangulation_3, which I manually created (just converted
> a given triangulation to a CGAL data structure) and which is valid (
> checked with triangulation.is_valid()). I'm currently using
> Exact_predicates_inexact_constructions_kernel, but I'm having problems
> when making various geometric operation afterwards. Therefore, I want to
> change to Exact_predicates_exact_constructions_kernel.
>
> However, after changing the kernel, the conversion back to a double
> representation doesn't work anymore, ie.
>
> double x = CGAL::to_double(vertex->point().x());
> ...
>
> results in a segmentation fault sometimes. It doesn't happen for all
> vertices, just for some.
>
> The same part of the code with inexact constructions kernel works
> without problems.
>
> Does someone have an idea what the problem could be?
>
> Thomas
>
>
Check that the vertex is not the infinite vertex.



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


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem when changing from inexact to exact kernel

tholzmann


On 02/15/2017 03:28 PM, Sebastien Loriot (GeometryFactory) wrote:

> On 02/15/2017 03:15 PM, Thomas Holzmann wrote:
>> Hi,
>>
>> I have a CGAL::Triangulation_3, which I manually created (just converted
>> a given triangulation to a CGAL data structure) and which is valid (
>> checked with triangulation.is_valid()). I'm currently using
>> Exact_predicates_inexact_constructions_kernel, but I'm having problems
>> when making various geometric operation afterwards. Therefore, I want to
>> change to Exact_predicates_exact_constructions_kernel.
>>
>> However, after changing the kernel, the conversion back to a double
>> representation doesn't work anymore, ie.
>>
>> double x = CGAL::to_double(vertex->point().x());
>> ...
>>
>> results in a segmentation fault sometimes. It doesn't happen for all
>> vertices, just for some.
>>
>> The same part of the code with inexact constructions kernel works
>> without problems.
>>
>> Does someone have an idea what the problem could be?
>>
>> Thomas
>>
>>
> Check that the vertex is not the infinite vertex

infinity is checked with triangulation.is_infinite(). So no infinite
vertices should be touched.

--
====================================================
Dipl.-Ing. Thomas Holzmann
TU Graz - Institut fuer Maschinelles Sehen und Darstellen
Graz University of Technology - Institute for Computer Graphics & Vision
Inffeldgasse 16/II, 8010 Graz, Austria

http://www.icg.tugraz.at/
phone: +43 316 873 5091
====================================================


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


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem when changing from inexact to exact kernel

Laurent Rineau (CGAL/GeometryFactory)
In reply to this post by tholzmann
Le Wednesday, February 15, 2017 3:15:01 PM CET Thomas Holzmann a écrit :

> Hi,
>
> I have a CGAL::Triangulation_3, which I manually created (just converted
> a given triangulation to a CGAL data structure) and which is valid (
> checked with triangulation.is_valid()). I'm currently using
> Exact_predicates_inexact_constructions_kernel, but I'm having problems
> when making various geometric operation afterwards. Therefore, I want to
> change to Exact_predicates_exact_constructions_kernel.
>
> However, after changing the kernel, the conversion back to a double
> representation doesn't work anymore, ie.
>
> double x = CGAL::to_double(vertex->point().x());
> ...
>
> results in a segmentation fault sometimes. It doesn't happen for all
> vertices, just for some.

Could it be that you use parallel threads working both on such CGAL exact
points? The kernel `Exact_predicates_exact_constructions_kernel` is not
thread-safe as far as I know.

--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory           http://www.geometryfactory.com/
Release Manager of the CGAL Project       http://www.cgal.org/


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


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem when changing from inexact to exact kernel

tholzmann

On 02/15/2017 07:56 PM, Laurent Rineau (CGAL/GeometryFactory) wrote:

> Le Wednesday, February 15, 2017 3:15:01 PM CET Thomas Holzmann a écrit :
>> Hi,
>>
>> I have a CGAL::Triangulation_3, which I manually created (just converted
>> a given triangulation to a CGAL data structure) and which is valid (
>> checked with triangulation.is_valid()). I'm currently using
>> Exact_predicates_inexact_constructions_kernel, but I'm having problems
>> when making various geometric operation afterwards. Therefore, I want to
>> change to Exact_predicates_exact_constructions_kernel.
>>
>> However, after changing the kernel, the conversion back to a double
>> representation doesn't work anymore, ie.
>>
>> double x = CGAL::to_double(vertex->point().x());
>> ...
>>
>> results in a segmentation fault sometimes. It doesn't happen for all
>> vertices, just for some.
> Could it be that you use parallel threads working both on such CGAL exact
> points? The kernel `Exact_predicates_exact_constructions_kernel` is not
> thread-safe as far as I know.
>
Yes, that was the problem! I am using openmp for some operations, which
are just designed to be write thread-safe. Setting
omp_set_num_threads(1) solved the problem.

Thank you!

Best,
Thomas

--
====================================================
Dipl.-Ing. Thomas Holzmann
TU Graz - Institut fuer Maschinelles Sehen und Darstellen
Graz University of Technology - Institute for Computer Graphics & Vision
Inffeldgasse 16/II, 8010 Graz, Austria

http://www.icg.tugraz.at/
phone: +43 316 873 5091
====================================================


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


Loading...