Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Re: About Bezier curves in Arrangement

Subject: CGAL users discussion list

List archive

[cgal-discuss] Re: About Bezier curves in Arrangement


Chronological Thread 
  • From: stzpz <>
  • To:
  • Subject: [cgal-discuss] Re: About Bezier curves in Arrangement
  • Date: Sat, 12 Feb 2011 09:57:58 -0800 (PST)

Here is the code and data that made the assertion shown:
------------------------ CODE BEGIN --------------------------------

#include <CGAL/basic.h>
#include <CGAL/Cartesian.h>
#include <CGAL/CORE_algebraic_number_traits.h>
#include <CGAL/Arr_Bezier_curve_traits_2.h>
#include <CGAL/Arrangement_2.h>
#include <list>
using namespace std;

typedef CGAL::CORE_algebraic_number_traits              Nt_traits;
typedef Nt_traits::Rational                             NT;
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_Bezier_curve_traits_2<Rat_kernel, Alg_kernel, Nt_traits> Traits_2;

typedef Traits_2::Curve_2                               Bezier_curve_2;
typedef CGAL::Arrangement_2<Traits_2>                   Arrangement_2;

int main (int argc, char *argv[])
{
  const char   *filename = (argc > 1) ? argv[1] : "test7.dat";
  std::ifstream   in_file (filename);

  int               n_curves;
  std::list<Bezier_curve_2>  curves;
  Bezier_curve_2             B;
  int               k;
  
  in_file >> n_curves;
  for (k = 0; k < n_curves; k++) {
    in_file >> B;
    curves.push_back (B);
  }
  
  Arrangement_2                     arr;

  // here comes the assertion
  insert (arr, curves.begin(), curves.end());

  return 0;
}

------------------------ CODE END -----------------------------------

test7.dat
------------------------ DATA BEGIN --------------------------------

2
3 0 0 10 20 10 20
4 1 6 30 50 40 70 40 70

------------------------ DATA END ------------------------------------

It seems that CGAL does not allow consecutive control points have the same value. But this program can be run in RELEASE mode.

For the second question, all my using of CGAL are limited to bezier segments because it is a project of converting bitmap line segments to beizer curves. So no other kinds of beizer curves are used except the bezier segment.


2011/2/12 Sebastien Loriot (GeometryFactory) [via cgal-discuss] <[hidden email]>
stzpz wrote:
> Thanks so much, Sebastien. It's ok now. 
>
> Besides, why CGAL does not allow inserting bezier curve to an
> arrangement which control poionts are continually identical, just like 3
> 0 0 20 30 20 30?
>
I guess it should not be hard to fix this but can you motivate it?

Just by curiosity, are you also using bezier which are not segments?
what is the application?

S.

> Thanks!
>  
> Stzpz
>
>
>
> 2011/2/7 Sebastien Loriot (GeometryFactory) [via cgal-discuss] <[hidden
> email] </user/SendEmail.jtp?type=node&node=3301547&i=0>>
>
>     Hope the third try will be the good one.
>
>     S.
>
>
> ------------------------------------------------------------------------
> View this message in context: Re: About Bezier curves in Arrangement
> <http://cgal-discuss.949826.n4.nabble.com/About-Bezier-curves-in-Arrangement-tp3238384p3301547.html>
> Sent from the cgal-discuss mailing list archive
> <http://cgal-discuss.949826.n4.nabble.com/> at Nabble.com.


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




If you reply to this email, your message will be added to the discussion below:
http://cgal-discuss.949826.n4.nabble.com/About-Bezier-curves-in-Arrangement-tp3238384p3301570.html
To unsubscribe from About Bezier curves in Arrangement, click here.



View this message in context: Re: About Bezier curves in Arrangement
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.16.

Top of Page