Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Convert points and circles from 2D linear kernel to 2D circular kernel?

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Convert points and circles from 2D linear kernel to 2D circular kernel?


Chronological Thread 
  • From: Stuart Hungerford <>
  • To:
  • Subject: Re: [cgal-discuss] Convert points and circles from 2D linear kernel to 2D circular kernel?
  • Date: Wed, 14 Feb 2018 08:02:06 +1100
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:+ES97hzhtme/BQzXCy+O+j09IxM/srCxBDY+r6Qd1O8fIJqq85mqBkHD//Il1AaPAd2Craocw8Pt8InYEVQa5piAtH1QOLdtbDQizfssogo7HcSeAlf6JvO5JwYzHcBFSUM3tyrjaRsdF8nxfUDdrWOv5jAOBBr/KRB1JuPoEYLOksi7ze+/94HObwlSmDaxfa55IQmrownWqsQYm5ZpJLwryhvOrHtIeuBWyn1tKFmOgRvy5dq+8YB6/ShItP0v68BPUaPhf6QlVrNYFygpM3o05MLwqxbOSxaE62YGXWUXlhpIBBXF7A3/U5zsvCb2qvZx1S+HNsDwULs6Wymt771zRRDqhicJNzA3/mLKhMJukK1Wuw6hqwBlzoLIfI2ZKPhzc6XAdt0aX2pBWcNRWjRcDIOgcosAFfABPfpFpIf/ulsOqxS+Che2BOPhzT9InGL51rA93uQ6DQHGwRYvH8gSsHjOrNX1KaESUe+rw6nSwzXDaOlW1irm5YjHdxAuu/CMXbZqfcXNzkkvEhrIg1ONooLmJzOYzvoBv3Sf4uZ6Vu+ii3QrpxxwrzSy3Msgl4rEipwTx1vZ7yt22pw1Kse9SENjYd6rDp9QtyaCOotzWMwiQmVotD86y7wIpZK3ZSYKxIkkyhLBcfCHfI+I4hXsVOaVPzh0nm5qeLW6hxqq8EigzPPzVtWs3VpUsiZIlsPAu3MN2hDJ98SKS+Zx8l281TuMyQzf8uRELlo1larfJZ4h2Lkwlp8LvETYAi/2hV/5jLWKdkk++uio9uLnYrr4qZ+GOY90jRv+Pbk1l8ywBOQ3KAkOX2yB9eug073j+FX1QK9Wgf0ujqnZrJfaKNwHqa62GQBV1p8v5Au+Dze9zNsYgGIHLEledRKcj4npPknOL+riAfe+hVSsijZryOrcMr3vGJWeZkTExbzudLI4509Hwxco1vhe4YhVA/cPOqHdQEj04efEExYjL0SU3uDoBc9z0ZkSETaUHrKQKr+UsUKO6e81Le6WaKcavT/8L74u4Pu43ixxokMUYaT8hchfU3u/BPkzexzIM0qpuc8IFCIxhiR7SeXrjFOYVjsKPiS9Wqs94ncwD4f0VN6fFLDou6SI2WKAJrMTfnpPUwneHnLhdoHCUPAJOnrLf51R1wccXL3kcLcPkBGjsAiglehiJ+vQvzwH7dftjYgvoeLUkh42+Hp/CMHPi2w=

On Tue, Feb 13, 2018 at 5:26 PM, Efi Fogel
<>
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



Archive powered by MHonArc 2.6.18.

Top of Page