Draft CubicBezCurve

Description
The Draft CubicBezCurve command creates a Bézier Curve of the third degree (four points required). It uses the Draft Linestyle set on the Draft Tray.

The Bézier Curve is one of the most commonly used curves in computer graphics. This command allows you to create a continuous spline made up of several 3rd-degree Bézier segments, in a way that is similar to the Bézier tool in Inkscape. A general Bézier curve of any degree can be created with the Draft BezCurve command.

The Draft BezCurve and the Draft CubicBezCurve commands use to define the position and curvature of the spline. The Draft BSpline command, on the other hand, specifies the through which the curve will pass.



Usage

 * 1) There are several ways to invoke the command:
 * 2) * Press the button.
 * 3) * Select the option from the menu.
 * 4) Click the first point in the 3D view, and hold the mouse button (1); this is the first end point.
 * 5) Drag the pointer to another point in the 3D view, and release the mouse button (2); this is the first control point.
 * 6) Move the pointer to another point in the 3D view, and click and hold the mouse button on this point (3); this is the second end point.
 * 7) Move the pointer to another point in the 3D view to adjust the final curvature of the spline, and then release the mouse button (4).
 * 8) At this moment you already have one Bézier curve of 3rd degree. The command can be completed by pressing  or the  button, or you may repeat the process of clicking and holding (5), and dragging and releasing (6) to add more 3rd-degree Bézier segments.

Note that with this workflow you need two click-hold-release sequences to create a single Bézier curve of third degree.
 * The first click-hold defines the first end point.
 * The first release defines the first control point.
 * The second click-hold defines the second end point, and the general direction of the spline.
 * The second release defines the final curvature of the spline.
 * The second control point is not explicitly given, but is determined from the location of the pointer during the second release.

Creating several Bézier segments

 * The second release also correspond to the first control point of the subsequent Bézier curve.
 * This means that the second click-hold was also the first end point of the second Bézier curve.
 * A third click-hold would be the second end point.
 * A third release would define the final curvature of the second curve, and it would also be the first control point of a third curve.

This means that for every two click-hold (c-h) and release (r) sequences, the second sequence is already part of a subsequent curve segment, as indicated in the following graphic:

|c-h -- r -- c-h -- r| 2 |c-h -- r -- c-h -- r| 3 |c-h -- r -- c-h -- r| 4
 * c-h -- r -- c-h -- r| 1

How to exactly place the control points
The graphical operation of this tool only allows the user to specify the first control point of the curve when it is being drawn. The second control point can be adjusted after the object is created: double click on the curve object in tree view, or select it and press. Then drag the second control point to the desired position.

In order to choose exactly both end points and both control points, the Python command must be used. See the Scripting section.

Options
See the options of the Draft BezCurve command.

Properties
A Draft CubicBezCurve is a Draft BezCurve of the third degree and has the same properties.

Scripting
See also: Autogenerated API documentation and FreeCAD Scripting Basics.

See Draft BezCurve for general information. A cubic Bézier is created by passing the option  to.

For each cubic Bézier segment four points must be used, of which the two extreme points indicate where the spline passes through, and the two intermediate points are control points.
 * If only 3 points are given, it creates a quadratic Bézier instead, with only one control point.
 * If only 2 points are given, it creates a linear Bézier, that is, a straight line.
 * If 5 points are given, the first 4 create a cubic Bézier segment; the 4th and the 5th points are used to create a straight line.
 * If 6 points are given, the first 4 create a cubic Bézier segment; the 4th and the other two points are used to create a quadratic Bézier segment.
 * If 7 points are given, the first 4 create a cubic Bézier segment; the 4th and the other three points are used to create a second cubic Bézier segment.
 * In general, the last point in a group of four is shared with the following three points maximum to create another Bézier segment.
 * To have smooth curves, with no straight segments, the number of points should be or, where  is the number of segments, for.



Example: