Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] how to read in Polygon in ascii format

Subject: CGAL users discussion list

List archive

[cgal-discuss] how to read in Polygon in ascii format


Chronological Thread 
  • From: <>
  • To:
  • Subject: [cgal-discuss] how to read in Polygon in ascii format
  • Date: Sat, 18 Apr 2009 04:26:17 +0200 (CEST)

Hi
I am very novice with cgal and have a very hard time with all this
templates.

I got so far , that i got modified the" boolean_operations_2" example to fit
for me.

but when I join , I get some vertex totally wrong .
http://i39.tinypic.com/vcvscj.jpg

I then would like to make a very small test app for bug reporting , but
struggle with reading back the ascii format again : (have appx 221 ) of this
kind

6 [62286 122530 --> 59786 125030]
[59786 125030 --> 48166 125030]
[48166 125030 --> 45666 122530]
[45666 122530 --> 48166 120030]
[48166 120030 --> 59786 120030]
[59786 120030 --> 62286 122530]

Polygon_2 p ;
instream >>p; // not possible since no >> avaible.

how to do ??
even my kernel supports circle , I only use segment for the moment.

Best regards
Buller

my type defs are :
typedef CGAL::Gmpq Base_nt;
typedef CGAL::Lazy_exact_nt<Base_nt> Coord_type;
struct Kernel : public CGAL::Cartesian<Coord_type> {};

typedef Kernel::Segment_2 Segment;
typedef Kernel::Point_2 Point_2;
typedef Kernel::Circle_2 Circle;
typedef Kernel::Iso_rectangle_2 Iso_rectangle;

typedef CGAL::Gps_circle_segment_traits_2<Kernel> Traits;
typedef Traits::Curve_2 Curve;
typedef Traits::X_monotone_curve_2 XCurve;
typedef Traits::Point_2 Circular_point_2;
typedef Traits::Polygon_2 Polygon_2;
typedef CGAL::General_polygon_with_holes_2<Polygon_2> Polygon_with_holes;
typedef CGAL::General_polygon_set_2<Traits> Polygon_set;
typedef Polygon_with_holes::Hole_const_iterator Hole_const_iterator;


typedef CGAL::Polygon_2<Kernel> Linear_polygon_2;
typedef CGAL::Polygon_with_holes_2<Kernel>
Linear_polygon_with_holes_2;


  • [cgal-discuss] how to read in Polygon in ascii format, cgal, 04/18/2009

Archive powered by MHonArc 2.6.16.

Top of Page