Sketcher BSplinePoleWeight

From FreeCAD Documentation
Revision as of 20:59, 16 April 2024 by Roy 043 (talk | contribs)
This documentation is a work in progress. Please don't mark it as translatable since it will change in the next hours and days.

Sketcher BSplinePoleWeight

Menu location
Sketch → Sketcher visual → Show/hide B-spline information layer → Show/hide B-spline control point weight
Workbenches
Sketcher
Default shortcut
None
Introduced in version
0.19
See also
Sketcher CreateBSpline

Description

The Sketcher BSplinePoleWeight tool shows or hides the B-spline control point weight in all sketches. See below for an explanation about weights.

The numbers (green, in square brackets) refer to the weights of the control points.

Usage

  1. There are several ways to invoke the tool:
    • Press the Show/hide B-spline control point weight button.
    • Select the Sketch → Sketcher visual → Show/hide B-spline information layer → Show/hide B-spline control point weight option from the menu.

Weight explanation

B-splines are basically a combination of Bézier curves (nicely explained in this and this video).

A Bézier curve is calculated using this formula:

Where n is the degree of the curve. So a Bézier curve of degree n is a polygon with order n. The factors are in fact the coordinates of the Bézier curves' control points. For a visualization see this page.

The term weight in FreeCAD is a bit misleading because in literature the factors are often called weights as well. FreeCAD's weights are something different. The idea of these weights is to modify the spline so that the different control points are "weighted". The idea is that a point with weight 2 should have twice as much influence than a point with weight 1. This is achieved by using this different formula to calculate the spline:

where is the weight for the point .

This is a new class of Bézier curves because despite the points are indeed weighted as desired, the curve is no longer a polynomial but a fractional polynomial. Therefore these curves are called rational Bézier curves and the B-splines is then called rational B-splines.

The consequence is that you gain more flexibility in defining the spline shape. If all weights are equal, the shape of the spline does not change. So the weights relative to each other is important, not the value alone. For example this spline has exactly the same shape as the one in the first image:

Same B-spline as in first image but with different absolute weight values

A weight of zero would be a singularity in the equation to calculate the rational Bézier curves, therefore FreeCAD assures that it cannot become zero. Nevertheless, small values have the same effect as if the control point would almost not exist:

Same B-spline with an almost zero weight control point

Changing weights

How to change weights is described on this page.