graphicscgal

How to render a polygon with CGAL?


I have my polygon read from a list of points on a text file, this works fine but I was wondering if there is a way to draw the Polygon read or at least the points. I couldn't find anything related on the documentation.

Is gnuplot the only solution? Hope you can help me.


Solution

  • You can use Geomview as mentioned in the documentation. But you will have to write the Polygon to OFF format, for which CGAL provides functions similar to write_off for many of its classes. You will have to open Geomview externally. Another option would be to write out a VTK file and visualize it with Paraview. This is what I use but you will have to write the code to convert from CGAL data structures to VTK data-structures.