简体   繁体   中英

how to convert planar mesh to arrangement in CGAL

I need to convert 2d planar polygonal meshes to 2D Arrangements in CGAL . for example if I have the following mesh in Wavefront obj format:

v -5.687006 -4.782805 0.000000

v 4.878987 -4.782805 0.000000

v -5.687006 4.782805 0.000000

v 4.878987 4.782805 0.000000

v -0.404010 -4.782805 0.000000

v -5.687006 0.000000 0.000000

v 4.878987 0.000000 0.000000

v -0.404010 4.782805 0.000000

v -0.404010 0.000000 0.000000

f 5 2 9

f 9 2 7

f 7 4 9

f 9 4 8

f 8 3 9

f 9 3 6

f 6 1 9

f 9 1 5

what is the simplest way I could convert it to a 2d Arrangement using the CGAL library?

Using the following example , you'll find out.

  • insert_in_face_interior for the first segment
  • insert_from_left_vertex or insert_from_right_vertex for the middle one, depending on the orientation of your polygon.
  • insert_at_vertices for the last one

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