CGAL 5.6.3 - 2D Polygons

Loading...
Searching...
No Matches
Polygon/draw_polygon.cpp
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polygon_2.h>
#include <CGAL/draw_polygon_2.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Polygon_2<K> Polygon_2;
typedef CGAL::Point_2<K> Point;
int main()
{
// create a polygon and put some points in it
Polygon_2 p;
p.push_back(Point(0,0));
p.push_back(Point(4,0));
p.push_back(Point(4,4));
p.push_back(Point(2,2));
p.push_back(Point(0,4));
CGAL::draw(p);
return EXIT_SUCCESS;
}
CGAL::Exact_predicates_inexact_constructions_kernel
CGAL::Point_2
CGAL::Polygon_2
The class Polygon_2 implements polygons.
Definition: Polygon_2.h:64
CGAL::draw
void draw(const P &ap)
opens a new window and draws ap, an instance of the CGAL::Polygon_2 class.