Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Re: How to offset/inset a general polygon by a certain values?

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Re: How to offset/inset a general polygon by a certain values?


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Re: How to offset/inset a general polygon by a certain values?
  • Date: Fri, 24 Feb 2012 08:08:19 +0100

You mixed up declaration from two different packages.

Have a look here for example:

http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Straight_skeleton_2/Chapter_main.html#Subsection_23.3.4

Sebastien.

On 02/23/2012 11:11 PM, J_Young wrote:
But I got compiling error when I try to pass in a General_polygon_2 object.

1>------ Build started: Project: TestApp1, Configuration: Release Win32
------
1> TestApp1.cpp
1>C:\Program Files\CGAL-3.9\include\CGAL/create_offset_polygons_2.h(304):
error C2039: 'Traits' : is not a member of
'CGAL::General_polygon_2<Arr_traits>'
1> with
1> [
1> Arr_traits=CGAL::Arr_circle_segment_traits_2<Kernel,true>
1> ]
1> TestApp1.cpp(122) : see reference to function template
instantiation 'std::vector<_Ty,_Ax>
CGAL::create_interior_skeleton_and_offset_polygons_2<int,Polygon_2>(const FT
&,const Polygon&)' being compiled
1> with
1> [
1> _Ty=boost::shared_ptr<Polygon_2>,
1> _Ax=std::allocator<boost::shared_ptr&lt;Polygon_2>>,
1> FT=int,
1> Polygon=Polygon_2
1> ]
1>C:\Program Files\CGAL-3.9\include\CGAL/create_offset_polygons_2.h(304):
error C3861: 'Traits': identifier not found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Below is the code snippet.

#include<CGAL/Exact_predicates_exact_constructions_kernel.h>
#include<CGAL/Gps_circle_segment_traits_2.h>
#include<CGAL/create_offset_polygons_2.h>

typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef Kernel::Point_2 Point_2;
typedef CGAL::Gps_circle_segment_traits_2<Kernel> Traits_2;
typedef Traits_2::General_polygon_2 Polygon_2;
typedef Traits_2::General_polygon_with_holes_2
Polygon_with_holes_2;
typedef Traits_2::X_monotone_curve_2
X_monotone_curve_2;

Polygon_2 construct_polygon (const Point_2& p1, const Point_2& p2,
const Point_2& p3, const Point_2& p4)
{
Polygon_2 pgn;
X_monotone_curve_2 s1(p1, p2); pgn.push_back(s1);
X_monotone_curve_2 s2(p2, p3); pgn.push_back(s2);
X_monotone_curve_2 s3(p3, p4); pgn.push_back(s3);
X_monotone_curve_2 s4(p4, p1); pgn.push_back(s4);
return pgn;
}

int main()
{
Polygon_2 rect1;
rect1 = construct_polygon(Point_2(1, 0), Point_2(5, 0),
Point_2(5, 2),
Point_2(1, 2));

CGAL::create_interior_skeleton_and_offset_polygons_2(1, rect1);
return 0;
}



--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/How-to-offset-inset-a-general-polygon-by-a-certain-values-tp4414852p4415432.html
Sent from the cgal-discuss mailing list archive at Nabble.com.





Archive powered by MHonArc 2.6.16.

Top of Page