Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Re: Converting X_monotone_curve_2 to Curve_2

Subject: CGAL users discussion list

List archive

[cgal-discuss] Re: Converting X_monotone_curve_2 to Curve_2


Chronological Thread 
  • From: Shriramana Sharma <>
  • To:
  • Subject: [cgal-discuss] Re: Converting X_monotone_curve_2 to Curve_2
  • Date: Mon, 11 Feb 2013 19:20:34 +0530

On Fri, Feb 8, 2013 at 3:39 PM, Shriramana Sharma
<>
wrote:
> For Bezier curves (which I am specifically interested in) I suppose
> one could apply de Casteljau twice

So I went ahead and tried to manually apply de Casteljau (by slightly
modifying the internal de Casteljau header and including it into my
sources) and I find that even with the example in the documentation, I
am not able to extract the correct subcurve. I have verified my
adaptation of the CGAL de Casteljau implementation with a separate
Python implementation and find that there is no problem with it.

Specifically the problem is with the endpoints of the calculated
subcurves. For instance in the documented example (only modified to
output the control points) Polygon 1 Segment 4 is supposed to end at
~0.267059 ~-1.92404 as per that segment's target() and Segment 5 is
supposed to pickup from that exact same point as per that segment's
source(), which is all correct and fine, but calculating the point at
t=0.859375 obtained from parameter_range().second() of the supporting
curve of Segment 4 gives (0.267074,-1.92511) and t=0.765625
parameter_range().first() of the supporting curve of Segment 5 gives
(0.26728,-1.92391) which are both different from the target point!

(Note that the internal calculations still use CORE::BigRat -- I'm
only printing them out as doubles for convenience in reading.)

I am aware that the documentation states that the parameter range is
approximate, but I wouldn't have expected it to fail at the fourth
decimal point! Is there a way to obtain the accurate parameter range,
or is there any other way to obtain the subcurve extracted as a full
Curve_2 instead of an X_monotone_curve_2 involving a supporting
Curve_2 and a *rough* parameter range?

Without being able to extract the actual geometric contours of the
boolean operations, I'm not sure of how much use the whole Bezier
boolop module is! :-( Please help me solve this problem!

BTW I'd like to know why there has been a distinct lack responses on
my CGAL Bezier questions -- I trust I have worded them properly? Is
perhaps the concerned person travelling etc?

Thanks and I really really hope someone can help me solve the problem.

--
Shriramana Sharma

Attachment: bezier-polygons.tar.gz
Description: GNU Zip compressed data




Archive powered by MHonArc 2.6.18.

Top of Page