On Tue, Feb 13, 2018 at 5:26 PM, Efi Fogel <

[hidden email]> wrote:

> You can use the Arr_circle_segment_traits_2 geometry traits module of the 2D

> Arrangement package. This traits uses the exact same number type that the

> circular kernel uses to represent circular arcs. It is called CGAL:

> :SQRT_EXTENSION.

Thanks for the pointer Efi. Does the following example implement the

approach you're suggesting?

#include <CGAL/MP_Float.h>

#include <CGAL/Cartesian.h>

#include <CGAL/Arrangement_2.h>

#include <CGAL/Arr_circle_segment_traits_2.h>

// We need an exact, rational number type for coordinates

using Coordinate = CGAL::Quotient<CGAL::MP_Float>;

// Linear 2D kernel with cartesian points

using Linear_Kernel = CGAL::Cartesian<Coordinate>;

using Linear_Circle_2 = Linear_Kernel::Circle_2;

// Bring in the 2D arrangement traits

using Circle_Traits_2 = CGAL::Arr_circle_segment_traits_2<Linear_Kernel>;

// We need the circular entities from the 2D trait

using Circle_Point_2 = Circle_Traits_2::Point_2;

using Circle_Curve_2 = Circle_Traits_2::Curve_2;

// Setup the reference circle for the arc

auto circle_center = Linear_Kernel::Point_2(0.0, 0.0);

auto base_circle = Linear_Circle_2(circle_center, 100.0);

// Setup the arc start and end points

auto start_pt = Circle_Point_2(10.0, 0.0);

auto end_pt = Circle_Point_2(0.0, 10.0);

// Create the arc

auto my_arc = Circle_Curve_2(base_circle, start_pt, end_pt);

Can I also check whether it's possible to apply an orthogonal

transform to a circular arc? Or find the bounding box (AABB) of one?

I get the impression that circular arcs in CGAL are not intended to be

widely useful like other geometric entities (e.g. polygons, line

segments), in that case it might be easier to define my own arc type?

Thanks again,

Stu

--

You are currently subscribed to cgal-discuss.

To unsubscribe or access the archives, go to

https://sympa.inria.fr/sympa/info/cgal-discuss