Draft BezCurve

Draft BezCurve

Menu location
Drafting → Bézier tools → Bézier curve
2D Drafting → Bézier curve
Workbenches
Draft, BIM
Default shortcut
B Z
Introduced in version
0.14
See also
Draft CubicBezCurve, Draft BSpline

Description

The Draft BezCurve command creates a Bézier curve from several points.

The command creates a single Bézier curve with a DataDegree that is number_of_points - 1. It can be transformed into a piecewise Bézier curve by reducing this property.

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

Bézier curve defined by multiple points

Usage

See also: Draft Tray, Draft Snap and Draft Constrain.

  1. There are several ways to invoke the command:
    • Press the Bézier curve button.
    • Draft: Select the Drafting → Bézier tools → Bézier curve option from the menu.
    • BIM: Select the 2D Drafting → Bézier curve option from the menu.
    • Use the keyboard shortcut: B then Z.
  2. The Bézier curve task panel opens. See Options for more information.
  3. Pick the first point in the 3D view, or type coordinates and press the Enter point button.
  4. Pick additional points in the 3D view, or type coordinates and press the Enter point button.
  5. Press Esc or the Close button to finish the command.

Options

The single character keyboard shortcuts available in the task panel can be changed. See Draft Preferences. The shortcuts mentioned here are the default shortcuts (for version 1.0).

Notes

Properties

See also: Property editor.

A Draft BezCurve object is derived from a Part Part2DObject and inherits all its properties. It also has the following additional properties:

Data

Draft

View

Draft

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

To create a Draft Line use the make_bezcurve method (introduced in version 0.19) of the Draft module. This method replaces the deprecated makeBezCurve method.

bezcurve = make_bezcurve(pointslist, closed=False, placement=None, face=None, support=None, degree=None)
bezcurve = make_bezcurve(Part.Wire, closed=False, placement=None, face=None, support=None, degree=None)

Example:

import FreeCAD as App
import Draft

doc = App.newDocument()

p1 = App.Vector(0, 0, 0)
p2 = App.Vector(1000, 1000, 0)
p3 = App.Vector(2000, 0, 0)
p4 = App.Vector(1500, -2000, 0)

bezcurve1 = Draft.make_bezcurve([p1, p2, p3, p4], closed=True)
bezcurve2 = Draft.make_bezcurve([p4, 1.3*p2, p1, 4.1*p3], closed=True)
bezcurve3 = Draft.make_bezcurve([1.7*p3, 1.5*p4, 2.1*p2, p1], closed=True)

doc.recompute()