Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Intersecting conic arcs

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Intersecting conic arcs


Chronological Thread 
  • From: Efi Fogel <>
  • To:
  • Subject: Re: [cgal-discuss] Intersecting conic arcs
  • Date: Wed, 29 May 2019 12:11:34 +0300
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:u1DVMRB92OjoMV+imfLRUyQJP3N1i/DPJgcQr6AfoPdwSPT4psbcNUDSrc9gkEXOFd2Cra4d0qyP6f+rADVIyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+KPjrFY7OlcS30P2594HObwlSizexfK5+IA+roQnPtMQajpZuJrsswRbVv3VEfPhby3l1LlyJhRb84cmw/J9n8ytOvv8q6tBNX6bncakmVLJUFDspPXw7683trhnDUBCA5mAAXWUMkxpHGBbK4RfnVZrsqCT6t+592C6HPc3qSL0/RDqv47t3RBLulSwKMSMy/mPKhcxqlK9UrxyhqB5/zYDaY4+bKeRwcb/GcNwAWWZMRNxcWzBdDo6+aYYEEuoPPfxfr4n4v1YAohW+BQixD+3vzT9IiWH53akn2OkmDw7G0g0gH9wJsHTbstr1MLwfUe+wzKbSzDXDa+la1iv66IjNax0sp+yHU7x3ccrU00YvFgXFg02WqYP/JDyazeANvHaB4+V8UuKvjnYrqwB3oji1x8cjkJPFhowPylzc6Sp5z5w6JdmiRE58e96kH51dvDyZOYtuWs4uXX1ktSIgxrAFuZO3ZjUGxZUmyhLFdvCKcZSE7xT+X+iLOzh4nmhqeLenihay70egzur8W9Gx0FlQrypFlsDAtnER1xDO88SHROZx80W91TqV2ADT7eZEIU8wlaXFMZIu3rkwlp8LvUTCGC/5hln2gbeIekk4/uWk8efqb7X8qpOBNoJ5ixvyPrksl8CjGeg4NxIBX2mf+eSyzr3j+kj5Ta1Ugf04k6nZvpfaJcsFqa69GAJV3YMj5Ay+DzeiytgXgX4HLFdddBKdk4fpI03OIOz/Dfqnn1usny1kx/TfMrL8A5XNNWTMkKr6fbZm8ENc0woyzdVH551OEL0BIfTzWlXwtNPCFBM5PRa0kK7aDs5g3NYeRX6XGf3ed7jDtEeBoOMpOeiFIoEP/y3sLuAsoP/og3h+klAUeeyl3IAcdWujTchhdk6WaH6pjtYaGnoRpSI/SvbrgRuMS219fXG3Co8y53kVD42rCc+XS46sjruO0SOTEZhfZ2QAAVeJRyS7P76YUusBPXrBavRqlSYJAOD4Ft0RkCq2vQq/8IJJa+rZ/ipC68Dm3dlxouzPzFQ8rGMsScua1G6JQid/mWZaH2ZqjpA6mlR0zxK46YY9m+ZRTIUB6PZAUwN8PpnZnbQjWoLCHznZd9LMc26IB9CvADU/VNU0moZcbEN0GtHkhRfGjXOn

1. You need to compute the entire arrangement if you only need the intersection points of two curves---just use the traits directly.
2. You can try using the Arr_algebraic_segment_traits_2 traits instead of the Arr_conic_traits_2. The latter is dedicated to conics, but a bit old.
3. I don't see other options.
   ____  _        ____             _
  /_____/_) o    /__________  __  //
 (____ (   (    (    (_/ (_/-(-'_(/
                         _/




On Wed, 29 May 2019 at 10:46, Stefan <> wrote:
Hello everyone,

I am working on an application that requires me to repeatedly compute the
intersection points of two conic arcs in an exact manner. Currently, I am
using CGAL's Arrangement_2 class in combination with Arr_conic_traits_2 to
carry out this task. In particular, I compute the arrangement of two conics
from which I extract the vertices that correspond to intersections. The
following minimal example (which I derived from
https://doc.cgal.org/latest/Arrangement_on_surface_2/Arrangement_on_surface_2_2conics_8cpp-example.html)
reflects my current approach.

#include <CGAL/config.h>
#include <CGAL/Cartesian.h>
#include <CGAL/CORE_algebraic_number_traits.h>
#include <CGAL/Arr_conic_traits_2.h>
#include <CGAL/Arrangement_2.h>

typedef CGAL::CORE_algebraic_number_traits Nt_traits;
typedef Nt_traits::Rational Rational;
typedef Nt_traits::Algebraic Algebraic;
typedef CGAL::Cartesian<Rational> Rat_kernel;
typedef Rat_kernel::Point_2 Rat_point_2;
typedef Rat_kernel::Segment_2 Rat_segment_2;
typedef Rat_kernel::Circle_2 Rat_circle_2;
typedef Rat_kernel::Line_2 Rat_line_2;
typedef CGAL::Cartesian<Algebraic> Alg_kernel;
typedef CGAL::Arr_conic_traits_2<Rat_kernel, Alg_kernel, Nt_traits>
Traits_2;
typedef Traits_2::Point_2 Point_2;
typedef Traits_2::Curve_2 Conic_arc_2;
typedef CGAL::Arrangement_2<Traits_2> Arrangement_2;

int main() {
    Arrangement_2 arr;
    Point_2 ps1(Rational(1, 4), 4);
    Point_2 pt1(2, Rational(1, 2));
    Conic_arc_2 c1(0, 0, 1, 0, 0, -1, CGAL::COUNTERCLOCKWISE, ps1, pt1);
    insert(arr, c1);

    Conic_arc_2 c2(58, 72, -48, 0, 0, -360);
    insert(arr, c2);

    for (auto vit = arr.vertices_begin(); vit != arr.vertices_end(); ++vit)
{
        std::cout << "(" << vit->point() << ")";
        if (vit->is_isolated()) {
            std::cout << " - Isolated." << "\n";
        } else {
            std::cout << " - Degree " << vit->degree() << "\n";
            if (vit->degree() == 4) {
                std::cout << "Found intersection at (" << vit->point() <<
")\n";
            }
        }
    }

    return 0;
}

I was wondering if there exists a simpler way of achieving this with the
tools that CGAL provides? Does there exist some variant of CGAL's
intersection() method that is able to handle conic arcs?

Any help is very appreciated! Thank you!




--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

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





Archive powered by MHonArc 2.6.18.

Top of Page