Arrangement_2 accept mixed type of curves

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Arrangement_2 accept mixed type of curves

EvanPi
I'm trying to use cgal to store various types of 2d curves on plane, e.g.
line segments, conic curves, algebraic curves etc.
I've looked into the documentation and find out that arrangement_2 might be
what I'm looking for but the problem is that all the examples initialize
arrangement_2<> with a specific trait, e.g. linear_traits, conic_traits.
And it seems that these traits are independent and are not inherenting from
a parent trait class. So I am wondering how I can use a general type and put
all types of curve into 1 arrangement_2 instance.

I know I can have multiple arrangement_2 instances and put each type of
curve into it but that's very inefficient and would be my last option.
Any help or suggestion are greatly appreciated!



--
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


Reply | Threaded
Open this post in threaded view
|

Re: Arrangement_2 accept mixed type of curves

Efi Fogel
You need to use a traits class that supports all your curve types.
The most general one is Arr_algebraic_segment_traits_2.h.
Naturally, using this traits is less efficient than using, e.g,. the Arr_segment_traits_2 for handling segments only.
Any traits that supports linear curves is more efficient than any traits that supports algebraic curves of some degree higher than 1, so you may want to consider Arr_polyline_curve_2 and approximate each of your curves by a polyline.
As last resort, you can implement your own traits class. It's not trivial, but doable.

   ____  _        ____             _
  /_____/_) o    /__________  __  //
 (____ (   (    (    (_/ (_/-(-'_(/
                         _/



On 23 December 2017 at 04:43, EvanPi <[hidden email]> wrote:
I'm trying to use cgal to store various types of 2d curves on plane, e.g.
line segments, conic curves, algebraic curves etc.
I've looked into the documentation and find out that arrangement_2 might be
what I'm looking for but the problem is that all the examples initialize
arrangement_2<> with a specific trait, e.g. linear_traits, conic_traits.
And it seems that these traits are independent and are not inherenting from
a parent trait class. So I am wondering how I can use a general type and put
all types of curve into 1 arrangement_2 instance.

I know I can have multiple arrangement_2 instances and put each type of
curve into it but that's very inefficient and would be my last option.
Any help or suggestion are greatly appreciated!



--
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



Reply | Threaded
Open this post in threaded view
|

Re: Arrangement_2 accept mixed type of curves

EvanPi
I just take a look at the polyline traits class but the thing is that if I
approximate all curves using a large number of points, I would lose track of
which subsets of point defines which type of curve, which could be a problem
in case I want to delete them and insert a new type of curve. But I do find
something I overlooked, which is the polycurve traits class. According to
the documentation, "The traits class
Arr_polycurve_traits_2<GeometryTraits_2> handles piecewise curves that are
not necessarily linear, such as conic arcs, circular arcs, Bezier curves, or
line segments". Is it able to handle a curve that contains multiple types of
subcurve? If so, could you provide a quick example?



--
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


Reply | Threaded
Open this post in threaded view
|

Re: Arrangement_2 accept mixed type of curves

Efi Fogel
1. You can use all kind of data-structures and extensions to retain the association.
For example, you can use Arrangement_with_history_2 to retain the association of the resulting x-monotone curves and their original polyline curve inserted into the arrangement. You can extend the halfedge record with a pointer or reference to your original curve.
2. Arr_polycurve_traits_2<GeometryTraits_2> is not able to handle a curve that contains multiple types of subcurve.

   ____  _        ____             _
  /_____/_) o    /__________  __  //
 (____ (   (    (    (_/ (_/-(-'_(/
                         _/



On 23 December 2017 at 11:53, EvanPi <[hidden email]> wrote:
I just take a look at the polyline traits class but the thing is that if I
approximate all curves using a large number of points, I would lose track of
which subsets of point defines which type of curve, which could be a problem
in case I want to delete them and insert a new type of curve. But I do find
something I overlooked, which is the polycurve traits class. According to
the documentation, "The traits class
Arr_polycurve_traits_2<GeometryTraits_2> handles piecewise curves that are
not necessarily linear, such as conic arcs, circular arcs, Bezier curves, or
line segments". Is it able to handle a curve that contains multiple types of
subcurve? If so, could you provide a quick example?



--
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



Reply | Threaded
Open this post in threaded view
|

Re: Arrangement_2 accept mixed type of curves

biswajitcse
dear all;


May your home be filled with joy and love This Christmas season. Wishing you a wonderful holiday!


On Sat, Dec 23, 2017 at 8:12 PM, Efi Fogel <[hidden email]> wrote:
1. You can use all kind of data-structures and extensions to retain the association.
For example, you can use Arrangement_with_history_2 to retain the association of the resulting x-monotone curves and their original polyline curve inserted into the arrangement. You can extend the halfedge record with a pointer or reference to your original curve.
2. Arr_polycurve_traits_2<GeometryTraits_2> is not able to handle a curve that contains multiple types of subcurve.

   ____  _        ____             _
  /_____/_) o    /__________  __  //
 (____ (   (    (    (_/ (_/-(-'_(/
                         _/



On 23 December 2017 at 11:53, EvanPi <[hidden email]> wrote:
I just take a look at the polyline traits class but the thing is that if I
approximate all curves using a large number of points, I would lose track of
which subsets of point defines which type of curve, which could be a problem
in case I want to delete them and insert a new type of curve. But I do find
something I overlooked, which is the polycurve traits class. According to
the documentation, "The traits class
Arr_polycurve_traits_2<GeometryTraits_2> handles piecewise curves that are
not necessarily linear, such as conic arcs, circular arcs, Bezier curves, or
line segments". Is it able to handle a curve that contains multiple types of
subcurve? If so, could you provide a quick example?



--
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






--
thanks and regards 
mobile:9163016823

0.jpg (54K) Download Attachment