'm creating an application using qt creator which read .off files as CGAL::Linear_cell_complex_for_combinatorial_map and preview it I want to make operations on the read mesh such as removing edge and restore it .

it shows the following error :

terminate called after throwing an instance of 'CGAL::Assertion_exception'
  what():  CGAL ERROR: assertion violation!
Expr: i != idx.end()

my code:

 filename =std::string("/home/nourhan/QT projects/cube.off");
 std::ifstream ifile(filename.c_str());
 if (ifile)

   CGAL::load_off(lcc, ifile);

       lcc.display_characteristics(std::cout) << ", valid=" <<
         lcc.is_valid() << std::endl;

 LCC_3::Dart_handle d2=lcc.darts().begin();
   LCC_3::Dart_handle d3= lcc.insert_cell_0_in_cell_1( d2);
  lcc.insert_cell_0_in_cell_2(   d2);

       std::vector<LCC_3::Dart_handle> adarts;

       if (lcc.is_insertable_cell_1_in_cell_2(d2, d3))
      lcc.insert_cell_1_in_cell_2( d2, d3);

       lcc.display_characteristics(std::cout) << ", valid=" <<
         lcc.is_valid() << std::endl;

  CGAL::write_off(lcc, "copy-head.off");

the output :

Darts=24, #0-cells=8, #1-cells=12, #2-cells=6, #ccs=1, valid=1

Darts=36, #0-cells=10, #1-cells=18, #2-cells=10, #ccs=1, valid=Map not valid: dart 0x5d7df0 does not have a vertex.


the output .off file : OFF 8 10 0

I don't know how it inserted edges successfully and the same time Map not valid and the output .off file isn't correct .

I appreciate any help .


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.