Class bezier_curve
implements Bezier curves. A bezier smooth curve is a curve from bezier_curve<-start
to bezier_curve<-end using either one or
two control-points. They are used to create a smooth connection from a
certain point leaving at a defined direction to another point arriving
in some direction.
XPCE's class bezier_curve is a subclass of class joint, inheriting the possibility to have arrow objects at either end of the curve.
To get a feeling for the behaviour of this class, please try PceDraw from the demo programs (File/Demo Programs).
When bezier_curve->selected,
the system will show the control-points connected by dotted lines.
A good description of the details on Bezier curves can be found at http://graphics.cs.ucdavis.edu/CAGDNotes/ See also class path.
<-control1
and bezier_curve<-control2
define the Bezier curve's control-points. If bezier_curve<-control2
= @nil, the
curve has only a single control-point and is known as a quadratic
Bezier curve. If the second control point is specified, it is known as a cubic
Bezier curve.
The curve departs from bezier_curve<-start
in the direction of bezier_curve<-control1
and ends in bezier_curve<-end from the
direction of bezier_curve<-control2
(or
bezier_curve<-control1
if bezier_curve<-control2
is @nil.
Unlike class path, the
curve does not go through its control-points.
-control1
-control1, bezier_curve->control1->geometry
method is redefined by class bezier to move the bezier curve.start going to end using
either one (quadratic) or two (cubic) control-points.->selected
to deal with the graphical<-area
change resulting from displaying the control-points.
The control-points and dotted connection-lines are visible if the window<-selection_feedback
is set to handles.
<-start, bezier_curve<-control1, bezier_curve<-control2
or bezier_curve<-end and bezier_curve->compute’s
the curve afterwards,
It is normally used with the result if bezier_curve<-point
to allow interactive editing of bezier curves. See also the PceDraw demo
application.
|event,
max_distance=[int] -> point<-start, bezier_curve<-control1, bezier_curve<-control2
or bezier_curve<-end that is within max_distance.
This method is designed after path<-point.
See also
bezier_curve->set_point.