Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Delaunay_d not making triangulation

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Delaunay_d not making triangulation


Chronological Thread 
  • From: Adam Getchell <>
  • To:
  • Subject: Re: [cgal-discuss] Delaunay_d not making triangulation
  • Date: Thu, 16 Oct 2014 07:08:05 -0700

Marc,

Thanks again for your comments.

I wondered if it were due to using the Homogenous kernel. If I change to a Cartesian kernel, then the first test fails due to invalid triangulation, and the second test still yields only 5 vertices instead of 8. I looked at the cartesian to homogenous point converters, but they only go to three dimensions. Suggestions?

(Also, how do you switch to debug mode?)

https://github.com/acgetchell/CDT-plusplus/blob/master/src/Delaunay.h

┌─[adam][Hapkido][±][master ][~/CDT-plusplus]

└─▪ ./build/unittests 

[==========] Running 4 tests from 3 test cases.

[----------] Global test environment set-up.

[----------] 1 test from S3Triangulation

[ RUN      ] S3Triangulation.CreatesTetrahedronTriangulation

[       OK ] S3Triangulation.CreatesTetrahedronTriangulation (0 ms)

[----------] 1 test from S3Triangulation (0 ms total)


[----------] 2 tests from SdTriangulation

[ RUN      ] SdTriangulation.CreatesTetrahedralTriangulationIn4D

Point #1

Point #2

Point #3

Point #4

/Users/adam/CDT-plusplus/unittests/SdTriangulationTest.cpp:36: Failure

Value of: T.is_valid()

  Actual: false

Expected: true

Triangulation is invalid.

[  FAILED  ] SdTriangulation.CreatesTetrahedralTriangulationIn4D (0 ms)

[ RUN      ] SdTriangulation.Creates16cellTriangulationIn4D

Point #1

Point #2

Point #3

Point #4

Point #5

/Users/adam/CDT-plusplus/unittests/SdTriangulationTest.cpp:58: Failure

Value of: CountVertices(&T)

Expected: is equal to 8

  Actual: 5 (of type int)

Triangulation has wrong number of vertices.

[  FAILED  ] SdTriangulation.Creates16cellTriangulationIn4D (1 ms)

[----------] 2 tests from SdTriangulation (1 ms total)


[----------] 1 test from Sphere

[ RUN      ] Sphere.CreatesSphere

Generating 5 random points on the surface of a sphere in 4D

of center 0 and radius 1.

 4 0.216594 0.895128 -0.251742 0.29742 

 4 0.108702 -0.14668 -0.405465 -0.895694 

 4 -0.170433 0.0644393 -0.980995 0.0666965 

 4 0.453997 0.691497 -0.358078 0.433012 

 4 0.91417 -0.310213 0.210919 -0.153542 

[       OK ] Sphere.CreatesSphere (0 ms)

[----------] 1 test from Sphere (0 ms total)


[----------] Global test environment tear-down

[==========] 4 tests from 3 test cases ran. (1 ms total)

[  PASSED  ] 2 tests.

[  FAILED  ] 2 tests, listed below:

[  FAILED  ] SdTriangulation.CreatesTetrahedralTriangulationIn4D

[  FAILED  ] SdTriangulation.Creates16cellTriangulationIn4D


 2 FAILED TESTS



On Thu, Oct 16, 2014 at 1:39 AM, Marc Glisse <> wrote:
On Thu, 16 Oct 2014, Adam Getchell wrote:

Hi Marc,
Thanks for the suggestion. I wrote a function to iterate on the vertices and counted them, and I still only ever get two, for both my test cases where I insert 4 for a
tetrahedron and 8 for a 16cell:

https://github.com/acgetchell/CDT-plusplus/blob/master/src/Delaunay.h

https://github.com/acgetchell/CDT-plusplus/blob/master/unittests/SdTriangulationTest.cpp

Point(0,0,0,0)

are you expecting this to be the origin in R^4? Since you are using a Homogeneous kernel, I would expect it to be a point in R^3, of coordinates (0./0.,0./0.,0./0.). And indeed in debug mode (which you should be using when writing new code) I am getting:

terminate called after throwing an instance of 'CGAL::Assertion_exception'
  what():  CGAL ERROR: assertion violation!
Expr: (w!=0)
File: /usr/include/CGAL/Kernel_d/PointHd.h
Line: 162
Explanation: PointHd::construction: w == 0.



--
Marc Glisse

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





--
Adam Getchell
"Invincibility is in oneself, vulnerability in the opponent." -- Sun Tzu



Archive powered by MHonArc 2.6.18.

Top of Page