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: Efi Fogel <>
- To:
- Subject: Re: [cgal-discuss] Convert points and circles from 2D linear kernel to 2D circular kernel?
- Date: Sat, 17 Feb 2018 16:46:55 +0200
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:ym6IMBLwLZJeWT6t/tmcpTZWNBhigK39O0sv0rFitYgRLPvxwZ3uMQTl6Ol3ixeRBMOHs6kC07KempujcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47xaFLIv3K98yMZFAnhOgppPOT1HZPZg9iq2+yo9JDffwtFiCChbb9uMR67sRjfus4KjIV4N60/0AHJonxGe+RXwWNnO1eelAvi68mz4ZBu7T1et+ou+MBcX6r6eb84TaFDAzQ9L281/szrugLdQgaJ+3ART38ZkhtMAwjC8RH6QpL8uTb0u+ZhxCWXO9D9QLYpUjqg8qhrUgflhyUJNzA5/m/ZidF+grxHrx+6vRNz35TZbZuJOPZifK7Qe84RS2pbXsZWUixMGoyyb4UOD+EcPehYqIb9qEUKrRCjAgSjGu3vyj5Ghn/x0q01zeAhHBrJ3AwlBd0OsXDUoM/pO6cVVOC41a/FxijNYfNR3Dfy8onIchY5rPGNW7Jwa8vRxlM1GwPLlFWdr5HuMTCN1ukVsWWW4PBsWf+xh2MnsQ18oTaiyt0sh4XXgI8e10rK+j9jwIkvIN21UE57bsCgEJtXryyaMpF5QsImQ21xoCY6xaEKtYe1fCUK1pgr3RHfa/uAc4iH5hLsSvydLit/hHJgYL6/hhCy/la8yuDkVMS530xGojdbntTMrHwA1BLe5tKHR/dj5kuh3CyA1wHX6uFKO0A0kq/bJoY/zb4+l5oTv0PDHiDol0Xyl6KWeUAk9fKp6+TjeLnpupicN4pshgHkLqsugtC/Afg/MgUWQ2eb9v6z1Ln68ULkQbVKleE5krTCsJDBPskbva64AwpN0ok58Rq/DjGm0M4ZnXYdNl5FdgiH3MDUPUrTKqX4EeunmAbr1yx6wujPeLznGJTEaHbZ16zweK50rE9axg10xt9W49dYC6oKPenoCXP24dfXBxt8Pw2vyPv8E/180JkfUCSBGPy3KqTX5HKG56oBJOaBYMdBtTj8Jf8q6vrGgnowmFtbdq6si8hEIEukF+hrdh3KKUHnhc0MRD9T71gOCdfygVjHagZ9InO7XqYy/DY+Udv0AoLKR4Tri7uEjn7iQs9mI1teA1XJKk/GMp2eUq5VOi2XK85l1DcDUOr5EtJz5VSVrAb/joFfAK/U9ykf78+x0dF046jLmkl3+2EuScua1G6JQid/mWZaHzI=
1. I guess it does, but why not using one of the predefined kernel (see below)?
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
typedef CGAL::Exact_predicates_exact_constructions_kernel Linear_kernel;
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
typedef CGAL::Exact_predicates_exact_constructions_kernel Linear_kernel;
2. The points and curve types defined by the circular kernel and the points and curves defined by the Arr_circle_segment_traits_2 traits are the same. They use coordinates represented by a type called CGAL: :Sqrt_extension. You can read more about it in the manual.)
Operations performed on geometric objects defined using this type are efficient. (The alternative, for example, would be using an algebraic number type, which is much less efficient).
Operations performed on geometric objects defined using this type are efficient. (The alternative, for example, would be using an algebraic number type, which is much less efficient).
Naturally all operations required by the traits concept are implemented (using this type).
However, operations on this type, or geometric object defined using this type, are indeed limited.
However, operations on this type, or geometric object defined using this type, are indeed limited.
____ _ ____ _
/_____/_) o /__________ __ //
(____ ( ( ( (_/ (_/-(-'_(/
_/
/_____/_) o /__________ __ //
(____ ( ( ( (_/ (_/-(-'_(/
_/
On 13 February 2018 at 23:02, Stuart Hungerford <> wrote:
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
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss
- [cgal-discuss] Convert points and circles from 2D linear kernel to 2D circular kernel?, Stuart Hungerford, 02/13/2018
- Re: [cgal-discuss] Convert points and circles from 2D linear kernel to 2D circular kernel?, Efi Fogel, 02/13/2018
- Re: [cgal-discuss] Convert points and circles from 2D linear kernel to 2D circular kernel?, Stuart Hungerford, 02/13/2018
- Re: [cgal-discuss] Convert points and circles from 2D linear kernel to 2D circular kernel?, Efi Fogel, 02/17/2018
- Re: [cgal-discuss] Convert points and circles from 2D linear kernel to 2D circular kernel?, Stuart Hungerford, 02/17/2018
- Re: [cgal-discuss] Convert points and circles from 2D linear kernel to 2D circular kernel?, Efi Fogel, 02/17/2018
- Re: [cgal-discuss] Convert points and circles from 2D linear kernel to 2D circular kernel?, Stuart Hungerford, 02/17/2018
- Re: [cgal-discuss] Convert points and circles from 2D linear kernel to 2D circular kernel?, Efi Fogel, 02/17/2018
- Re: [cgal-discuss] Convert points and circles from 2D linear kernel to 2D circular kernel?, Stuart Hungerford, 02/13/2018
- Re: [cgal-discuss] Convert points and circles from 2D linear kernel to 2D circular kernel?, Efi Fogel, 02/13/2018
Archive powered by MHonArc 2.6.18.