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: Wed, 29 Feb 2012 08:04:23 +0100

On 02/28/2012 08:39 PM, J_Young wrote:
Sebastien,

Yes, the outputs in the example are General_polygon_2, but not the input.
You are right, I parsed the example too fast. Now I remember your
problem is an on-going work at TAU.
In the meantime, something that might work in your case is to
approximate circular arcs by segments (then you'll have a Polygon).

Sebastien.


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] </user/SendEmail.jtp?type=node&node=4429269&i=0>>
*To:* J_Young <[hidden email]
</user/SendEmail.jtp?type=node&node=4429269&i=1>>
*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
<http://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
<http://cgal-discuss.949826.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




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




Archive powered by MHonArc 2.6.16.

Top of Page