Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] simple line/arc segment Polygon_2 fails preconditions while taking orientation()

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] simple line/arc segment Polygon_2 fails preconditions while taking orientation()


Chronological Thread 
  • From: Efi Fogel <>
  • To:
  • Subject: Re: [cgal-discuss] simple line/arc segment Polygon_2 fails preconditions while taking orientation()
  • Date: Sun, 16 Aug 2020 09:42:56 +0300
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:+JmyMR0hJ8uTAaCCsmDT+DRfVm0co7zxezQtwd8ZseMfKvad9pjvdHbS+e9qxAeQG9mCtbQd07Kd6vi/EUU7or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRpOOv1BpTSj8Oq3Oyu5pHfeQpFiCe8bL9oMRm6sRndusYLjYd+KKs61wfErGZPd+lK321jOEidnwz75se+/Z5j9zpftvc8/MNeUqv0Yro1Q6VAADspL2466svrtQLeTQSU/XsTTn8WkhtTDAfb6hzxQ4r8vTH7tup53ymaINH2QLUpUjms86tnVBnlgzoBOjUk8m/Yl9ZwgbpUrxKvpRNxw4DaboKIOvRgYqzQZskVSXZbU8tLSyBNHoGxYo0SBOQBJ+ZYqIz9qkMBoxuwBAmnGePhyjhHhnDo2a0xzuMsHh/I3AwhEdIOt3vUo8vxNKoJXuC1ybPHzTTHb/9MxTj9743IfwknrPqRUr1+bdDfxlMzFwPZkFqQs4rlMiuX2+gTrWSW7/ZtW+2ghmMopQ99vDqiyMkshITKgo8YxU3I+CV4zYg1JdO1SU51bcKrHpdNtyyXN4R4T98+Tmxnvisx17MIuZm+fCcQyZQnwQbSa/2Bc4iS4xLsTvydITlihH9jZbmxhA6y/FC+xuHgUsS4ylVHoypfntXRt30A1gbf58iaRvZ740yvwyyA1xrJ5eFBOU00lbTUK5omwrMok5ocq0XDHivvlEX3i6+aa1wo+uao5uj6eLnmqZicN4h7igH6LKsigNCwAeM9MgQWXmib//qz1KH78EHnXLlHiuc6n6rZvZzAOMgWp6+0DxVV34o+8xq/Ci2p0NUcnXkJNlJFfxeHgpD3NFHAIfD4A/C/g1uynzdv3P3GMbjhDY/MLnjHirvuYbF960tExAop0d9f/45UCq0GIP/rRkDxu8bXDhsgPwOpwubnE8ly1p4FWWKUGaKZK6PTsVqQ5u01OeWMZYkVuCz8K/c//fLug2U5yhcge7K0184XdGygBaYhZF6IZGLlxNYHC2YD+AQkC/f7jUWLFj9VaXH1VK014nQ3CZmtEJzYFb2rm6GL/Du+GshWenxeEQLLVmz5cp2NHfYKciObZMF71ScVUKCoDI4n2xbpvwDzz/9rL/Hf5zYD5q/lz8V/2+DDiUQy6SBsFJbalHqcSnl92GIOXT4/mq5l5ldsz0+Klql+jfsfHtNa47ZFUxwxKIXHnNB9Xtv9UwaEctaSQ0u9Wf2nByswR5Q/2YwgeUF4Tvisj1jt2CWnB/dBmrKKCps7/6b00H34JsI7wHHDgvpyx2I6S9dCYDX1zpV08BLeUtaQzxep0p2yfKFZ5xbjsX+ZxDPX7k5dWQ90F67CWCJHPxaEnZHC/krHCoSWJ/EnPw9Gk5PQL6JLbpjoigwDSqq6ftvZZG21liG7AhPanurdPrqvQH0U2WDmMGZBlgkS+XicMg1nX3WupmvfCHplEle9Ok4=

It's normal.
It's not a bug.
You are doing something wrong---you are using limited precision.
Use the Epec kernel, for example, it is exact and filtered.
Read the manual.

   ____  _        ____             _
  /_____/_) o    /__________  __  //
 (____ (   (    (    (_/ (_/-(-'_(/
                         _/




On Fri, 14 Aug 2020 at 12:21, Forest Darling <> wrote:
Hello,

As I mentioned in my earlier email, I am having a discrepancy between the exact math and floating point kernels when constructing a "CGAL::Gps_circle_segment_traits_2" Polygon_2, resulting in a crash.

I attached an image of the test case, and the C++ sourcecode that constructs the Polygon_2 and tries to calculate it's orientation. You can uncomment the "#define USE_EXACT_MATH" on line 3 of main.cpp to enable the use of the exact construction kernel to verify it works under that.

Console output when using the "CGAL::Exact_predicates_exact_constructions_kernel" kernel:

g++ -c -o main.o main.cpp -Os -g -std=c++1z -DCGAL_DISABLE_ROUNDING_MATH_CHECK=ON
g++ -o broken-cgal main.o -lCGAL -lCGAL_Core -lmpfr -lgmp
poly = 6 (0 0.5 0.0001 1) [0.01 0.5 --> 0.01 0.5] (0 0.5 0.0001 1) [0.01 0.5 --> -0.01 0.5] (0 0.5 0.0001 1) [-0.01 0.5 --> -0.01 0.5] [-0.01 0.5 --> -0.01 0] (0 0 0.0001 1) [-0.01 0 --> 0.01 0] [0.01 0 --> 0.01 0.5]
poly.orientation() = 1

Console output when using the "CGAL::Simple_cartesian<double>" kernel:

g++ -c -o main.o main.cpp -Os -g -std=c++1z -DCGAL_DISABLE_ROUNDING_MATH_CHECK=ON
g++ -o broken-cgal main.o -lCGAL -lCGAL_Core -lmpfr -lgmp
poly = 4 (0 0.5 0.0001 1) [0.01 0.5 --> -0.01 0.5] [-0.01 0.5 --> -0.01 0] (0 0 0.0001 1) [-0.01 0 --> 0.01 0] [0.01 0 --> 0.01 0.5]
terminate called after throwing an instance of 'CGAL::Precondition_exception'
  what():  CGAL ERROR: precondition violation!
Expr: cv1.point_position (p) == EQUAL && cv2.point_position (p) == EQUAL
File: /usr/include/CGAL/Arr_circle_segment_traits_2.h
Line: 254
Aborted (core dumped)

I am using "stock" CGAL 4.11-2build1 on Ubuntu 18.04 64-bit.

Is it normal for the algorithms to be this sensitive? Is it a bug? Or am I doing something wrong?

I'd appreciate any insight!

--Forest

--
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.19+.

Top of Page