Subject: CGAL users discussion list
List archive
- From: Myirci <>
- To:
- Subject: [cgal-discuss] Re: Conics Arrangement : Orientation
- Date: Tue, 5 Mar 2013 13:44:10 +0100
Hi again,
No one has any idea?
Have a nice week
Murat
On Thu, Feb 28, 2013 at 10:25 AM, Myirci <> wrote:
Hello,I'm using conics arrangement and I've a difficulty to understand the orientation of the conics arcs. In the simple example below, I want to insert the parabola segment: { y² + x = 0, source (-4,-2), target(-1,1) } in to my arrangement. And according to my understanding, from source point to target, the direction must be CCW. However, in this case, the resultant arrangement has 3 vertices and 2 edges (which is unexpected for me). If I change the orientation to CW then, I get the expected output. Could you clarify my confusion?Output when orientation is CCW:3 vertices:
(-4 -2) - degree 1
(0 0) - degree 2
(-1 1) - degree 1
2 edges:
[{0*x^2 + -1*y^2 + 0*xy + -1*x + 0*y + 0} : (-4,-2) --ccw--> (0,0)]
[{0*x^2 + -1*y^2 + 0*xy + -1*x + 0*y + 0} : (0,0) --ccw--> (-1,1)]
Output when orientation is CW:
2 vertices:
(-4 -2) - degree 1
(-1 1) - degree 1
1 edges:
[{0*x^2 + 1*y^2 + 0*xy + 1*x + 0*y + 0} : (-4,-2) --cw--> (-1,1)]
Here is the code:#include <CGAL/Cartesian.h> #include <CGAL/CORE_algebraic_number_traits.h> #include <CGAL/Exact_predicates_exact_constructions_kernel_with_sqrt.h> #include <CGAL/Segment_Delaunay_graph_2.h> #include <CGAL/Segment_Delaunay_graph_traits_2.h> #include <CGAL/Arr_conic_traits_2.h> #include <CGAL/Arrangement_2.h> #include "print_arrangement.hpp" // same as the arr_print.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 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 conics_arr;Conic_arc_2 parabola_arc(0, 1, 0, 1, 0, 0, CGAL::COUNTERCLOCKWISE, Point_2(-4, -2), Point_2(-1, 1)); if(parabola_arc.is_valid()) { CGAL::insert(conics_arr, parabola_arc); print_arrangement(conics_arr);} else { std::cerr << "Conic arc is not valid! " << std::endl; } return 0;}--
Murat Yirci
Murat Yirci
- [cgal-discuss] Re: Conics Arrangement : Orientation, Myirci, 03/05/2013
- Re: [cgal-discuss] Re: Conics Arrangement : Orientation, Efi Fogel, 03/09/2013
- Re: [cgal-discuss] Re: Conics Arrangement : Orientation, Myirci, 03/11/2013
- Re: [cgal-discuss] Re: Conics Arrangement : Orientation, Efi Fogel, 03/11/2013
- Re: [cgal-discuss] Re: Conics Arrangement : Orientation, Myirci, 03/11/2013
- Re: [cgal-discuss] Re: Conics Arrangement : Orientation, Efi Fogel, 03/09/2013
Archive powered by MHonArc 2.6.18.