Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Initializing bezier curve from list of control points

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Initializing bezier curve from list of control points


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Initializing bezier curve from list of control points
  • Date: Tue, 22 Jan 2013 12:12:11 +0100
  • Organization: GeometryFactory

On 01/22/2013 12:03 PM, Shriramana Sharma wrote:
Hello.
CGAL-4.1/doc_html/cgal_manual/Boolean_set_operations_2/Chapter_main.html#Subsection_19.4.3
the documentation only shows how to initialize a Bezier curve from a
file stream using operator>>. However the operator>> for Curve_2 is
defined in CGAL-4.1/include/CGAL/Arr_geometry_traits/Bezier_curve_2.h
and it calls the constructor starting near l 353 which reads:

_Bezier_curve_2 (InputIterator pts_begin, InputIterator pts_end) :

In my program I'd like to initialize a bezier curve directly from a
vector of control pts, and not from a file. My questions:

1) Is the above constructor part of the official API so that I can
safely construct my high-level Curve_2 class (which gets redirected
via typedefs to the above _Bezier_curve_2 class) using the pair of
begin/end iterators?
It is documented here:
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Arrangement_on_surface_2_ref/Class_Arr_Bezier_curve_traits_2.html


2) IIUC the begin/end iterator is often used in CGAL.

2a) Is this to enable the user to select any subset of the list used for
input?

2b) Would it be possible to provide a useful overload which takes a
(const?) ref to a vector object and doesn't require the user to
manually specify the begin/end iterators?
This is the classical way to deal with sequences in the STL.
In the future, we will be using the Range concept which will allow
you to pass directly a container model of this Range concept.


3) (OK so this one is probably silly but well I'm relatively
inexperienced so just to be sure:) I am working with contours that can
have straight line or quadratic or cubic bezier segments. I suppose I
just input the relevant number of ctrl pts per bezier i.e. 2,3,4 and
the library will take care of the boolop calculations correctly?

It should yes.

Sebastien.

Thanks!





Archive powered by MHonArc 2.6.18.

Top of Page