简体   繁体   中英

How to extract face information from Linear_cell_complex_for_combinatorial_map in CGAL?

I was trying to create a hexahedron mesh using CGAL. So far I was able to create a hexaheron, but was unable to extract face and edge info from it. I was able to extract vertices information though using point_of_vertex_attribute

typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC;
typedef LCC::Point Point;

.....

Dart_handle dh1 = lcc.make_hexahedron(
      Point(0, 0, 0), Point(5, 0, 0), Point(5, 5, 0), Point(0, 5, 0),
      Point(0, 5, 4), Point(0, 0, 4), Point(5, 0, 4), Point(5, 5, 4));
  Dart_handle dh2 = lcc.make_hexahedron(
      Point(5, 0, 0), Point(10, 0, 0), Point(10, 5, 0), Point(5, 5, 0),
      Point(5, 5, 4), Point(5, 0, 4), Point(10, 0, 4), Point(10, 5, 4));
  lcc.sew<3>(lcc.beta(dh1, 1, 1, 2), lcc.beta(dh2, 2));

By default (which is the case of your example above) a linear cell complex does not have ids associated to its cells. If you really need these ids, you should define your own item class and associate these ids after creation. But usually you don't need these ids; you can directly iterate through the cells of the linear cell complex by using iterators. Cf. the doc here doc.cgal.org/latest/Combinatorial_map/index.html.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM