Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Delaunay_triangulation_3::flip(Cell_handle c, int i) invalidates the triangulation

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Delaunay_triangulation_3::flip(Cell_handle c, int i) invalidates the triangulation


Chronological Thread 
  • From: Adam Getchell <>
  • To:
  • Subject: Re: [cgal-discuss] Delaunay_triangulation_3::flip(Cell_handle c, int i) invalidates the triangulation
  • Date: Wed, 4 Feb 2015 22:23:42 -0800

I've also done tests on flips of (2,2) simplices, with the same results (triangulation validity violated), except that they don't also violate my time foliation. The code currently on GitHub reflects the flips on (2,2) simplices.

On Wed, Feb 4, 2015 at 10:07 PM, Adam Getchell <> wrote:
Hello all,

For the following code:

void make_23_move(Delaunay* D3, std::vector<Cell_handle>* three_one,
                     std::vector<Cell_handle>* two_two) {
  // Pick a random (2,2)
  unsigned choice = generate_random_unsigned(three_one->size());
  std::cout << "We're picking (3,1) vector " << choice << std::endl;
  Cell_handle to_be_moved = (*three_one)[choice];
  for (size_t i = 0; i < 4; i++) {
    if (D3->flip(to_be_moved, i)) {
      // Delaunay::flip_flippable(to_be_moved,0)
      std::cout << "Facet " << i << " was flippable." << std::endl;
      break;
    } else {
      std::cout << "Facet " << i << " was not flippable." << std::endl;
    }
  }
}


Invoked in the test:

TEST_F(S3ErgodicMoves, MakeA23Move) {
  unsigned number_of_vertices_before = T.number_of_vertices();
  unsigned N3_31_before = three_one.size();
  unsigned N3_22_before = two_two.size();
  unsigned N3_13_before = one_three.size();
  std::cout << "Number of (2,2) simplices before = " << N3_22_before
            << std::endl;
  make_23_move(&T, &three_one, &two_two);

  // Now look at changes
  reclassify_3_simplices(&T, &three_one, &two_two, &one_three);
  unsigned N3_31_after = three_one.size();
  unsigned N3_22_after = two_two.size();
  unsigned N3_13_after = one_three.size();

  EXPECT_TRUE(T.is_valid())
  << "Triangulation is invalid.";


I've run these tests a couple dozen times, and every time there is a flippable edge the triangulation is invalidated, e.g.:

Repeating all tests (iteration 9) . . .


Note: Google Test filter = S3ErgodicMoves.MakeA23Move

[==========] Running 1 test from 1 test case.

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

[----------] 1 test from S3ErgodicMoves

[ RUN      ] S3ErgodicMoves.MakeA23Move

Generating universe ...

Pass #1

Fixing foliation....

Pass #2

Fixing foliation....

Pass #3

Fixing foliation....

Pass #4

Fixing foliation....

Pass #5

Fixing foliation....

Classifying simplices....

Valid foliation: true

Delaunay triangulation has 95251 cells.

There are 29713 (3,1) simplices and 35628 (2,2) simplices and 29910 (1,3) simplices.

Number of (2,2) simplices before = 35628

Random number is 27858

We're picking (3,1) vector 27858

Facet 0 was flippable.

Classifying simplices....

../unittests/S3ErgodicMovesTest.cpp:82: Failure

Value of: T.is_valid()

  Actual: false

Expected: true

Triangulation is invalid.

[  FAILED  ] S3ErgodicMoves.MakeA23Move (2229 ms)

[----------] 1 test from S3ErgodicMoves (2229 ms total)


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

[==========] 1 test from 1 test case ran. (2229 ms total)

[  PASSED  ] 0 tests.

[  FAILED  ] 1 test, listed below:

[  FAILED  ] S3ErgodicMoves.MakeA23Move


 1 FAILED TEST



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



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



Archive powered by MHonArc 2.6.18.

Top of Page