Skip to Content.
Sympa Menu

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

Subject: CGAL users discussion list

List archive

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


Chronological Thread 
  • From: J_Young <>
  • To:
  • Subject: [cgal-discuss] Re: How to offset/inset a general polygon by a certain values?
  • Date: Tue, 28 Feb 2012 11:39:19 -0800 (PST)

Sebastien,

Yes, the outputs in the example are General_polygon_2, but not the input.

I tried the following, but I don't know how to add an arc to the polygon.

#include <CGAL/Exact_circular_kernel_2.h>
#include <CGAL/approximated_offset_2.h>

typedef CGAL::Exact_circular_kernel_2 Kernel;
typedef CGAL::Polygon_2<Kernel> Polygon_2;

typedef CGAL::Gps_circle_segment_traits_2<Kernel> Gps_traits_2;
typedef Gps_traits_2::Polygon_2 Offset_polygon_2;
typedef Gps_traits_2::Polygon_with_holes_2 Offset_polygon_with_holes_2;

void approximateInset( )
{
 Polygon_2 P;         // how to add an arc into this polygon on the circular kernel?

Kernel::FT radius = 2;
const double err_bound = 0.00001;
std::list<Offset_polygon_2> inset_polygons;
CGAL::approximated_inset_2(P, radius, err_bound, std::back_inserter(inset_polygons));
}



From: Sebastien Loriot (GeometryFactory) [via cgal-discuss] <[hidden email]>
To: J_Young <[hidden email]>
Sent: Monday, February 27, 2012 11:26 PM
Subject: Re: How to offset/inset a general polygon by a certain values?

In the first example here:
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Minkowski_sum_2/Chapter_main.html#Subsection_24.3.3

the nested type Gps_traits_2::Polygon_2  is
General_polygon_2<Arr_circle_segment_traits_2<Kernel> >

Sebastien.

On 02/28/2012 12:16 AM, J_Young wrote:

> Sebastien,
>
> The examples in the following chapter does not work either.
> http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Minkowski_sum_2/Chapter_main.html
>
> offset_polygon_2 takes in a Polygon_2 object, not a General_polygon_2 object
> which is what I need.
>
> Are there other ways?
>
> Thanks,
> Jay
>
> --
> View this message in context: http://cgal-discuss.949826.n4.nabble.com/How-to-offset-inset-a-general-polygon-by-a-certain-values-tp4414852p4426420.html
> Sent from the cgal-discuss mailing list archive at Nabble.com.
>

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss




If you reply to this email, your message will be added to the discussion below:
http://cgal-discuss.949826.n4.nabble.com/How-to-offset-inset-a-general-polygon-by-a-certain-values-tp4414852p4427297.html
To unsubscribe from How to offset/inset a general polygon by a certain values?, click here.
NAML




View this message in context: Re: How to offset/inset a general polygon by a certain values?
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.16.

Top of Page