Sketcher BSplinePoleWeight: Difference between revisions
(more info) |
(more info - more to come) |
||
Line 35: | Line 35: | ||
{{Caption|Same B-spline without weights}} |
{{Caption|Same B-spline without weights}} |
||
The weights determine how the control points are taken into account. |
The weights determine how the control points are taken into account. The term weight is hereby a bit misleading because in literature the coordinates of the control points are often described as weights since they appear as factor in the definition of the Bézier curves: |
||
⚫ | |||
<math>\quad |
|||
\textrm{Bezier}(n,t)=\sum_{i=0}^{n}\underbrace{\binom{n}{i}}_{\text{polynomial term}}\underbrace{\left(1-t\right)^{n-i}t^{i}}_{\text{polynomial term}}\underbrace{w_{i}}_{\text{weight}} |
|||
</math> |
|||
''n'' is hereby the degree of the curve. So a Bézier curve of degree ''n'' is a polygon with order ''n''. B-splines are basically a combination of [https://en.wikipedia.org/wiki/Bezier_curve#Constructing_B%C3%A9zier_curves Bézier curves] (nicely explained in [https://www.youtube.com/watch?v=bE1MrrqBAl8 this] and [https://www.youtube.com/watch?v=xXJylM2S72s this] video). |
|||
The spline weight in FreeCAD is however something different. The idea is to modify the spline so that the different control points are "weighted". So a point with weight 2 should have twice as much influence than a point with weight 1. This is achieved by using this formula to calculate the spline: |
|||
<math>\quad |
|||
\textrm{Bezier}(n,t)=\sum_{i=0}^{n}\underbrace{\binom{n}{i}}_{\text{polynomial term}}\underbrace{\left(1-t\right)^{n-i}t^{i}}_{\text{polynomial term}}\underbrace{w_{i}}_{\text{weight}} |
|||
</math> |
|||
⚫ | |||
</translate> |
</translate> |
||
Line 43: | Line 58: | ||
{{Caption|Same B-spline as in first image but with different absolute weight values}} |
{{Caption|Same B-spline as in first image but with different absolute weight values}} |
||
A weight of |
A weight of zero would be a singularity in equation??, therefore FreeCAD assures that it cannot become zero. Nevertheless, small values have the same effect as if the control point would almost not exist: |
||
</translate> |
</translate> |
Revision as of 01:24, 9 November 2020
Sketcher BSplinePoleWeight |
Menu location |
---|
Sketch → Sketcher B-spline tools → Show/Hide B-spline control point weight |
Workbenches |
Sketcher |
Default shortcut |
None |
Introduced in version |
0.19 |
See also |
Create B-spline |
Description
Shows or hides the display of the weight for the control points of a B-spline curve (see B-spline).
B-spline with control point weights displayed in brackets
File:Sketcher BSplineWeightHide.png
Same B-spline without weights
The weights determine how the control points are taken into account. The term weight is hereby a bit misleading because in literature the coordinates of the control points are often described as weights since they appear as factor in the definition of the Bézier curves:
n is hereby the degree of the curve. So a Bézier curve of degree n is a polygon with order n. B-splines are basically a combination of Bézier curves (nicely explained in this and this video).
The spline weight in FreeCAD is however something different. The idea is to modify the spline so that the different control points are "weighted". So a point with weight 2 should have twice as much influence than a point with weight 1. This is achieved by using this formula to calculate the spline:
Therefore, 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 equation??, 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 a zero weight control point
Usage
- Select a B-spline and apply.
- General: Create sketch, Edit sketch, Map sketch to face, Reorient sketch, Validate sketch, Merge sketches, Mirror sketch, Leave sketch, View sketch, View section, Toggle grid, Toggle snap, Configure rendering order, Stop operation
- Sketcher geometries: Point, Line, Arc, Arc by 3 points, Circle, Circle by 3 points, Ellipse, Ellipse by 3 points, Arc of ellipse, Arc of hyperbola, Arc of parabola, B-spline by control points, Periodic B-spline by control points, B-spline by knots, Periodic B-spline by knots, Polyline, Rectangle, Centered rectangle, Rounded rectangle, Triangle, Square, Pentagon, Hexagon, Heptagon, Octagon, Regular polygon, Slot, Fillet, Corner-preserving fillet, Trim, Extend, Split, External geometry, Carbon copy, Toggle construction geometry
- Sketcher constraints:
- Geometric constraints: Coincident, Point on object, Vertical, Horizontal, Parallel, Perpendicular, Tangent, Equal, Symmetric, Block
- Dimensional constraints: Lock, Horizontal distance, Vertical distance, Distance, Radius or weight, Diameter, Auto radius/diameter, Angle, Refraction (Snell's law)
- Constraint tools: Toggle driving/reference constraint, Activate/deactivate constraint
- Sketcher tools: Select unconstrained DoF, Select associated constraints, Select associated geometry, Select redundant constraints, Select conflicting constraints, Show/hide internal geometry, Select origin, Select horizontal axis, Select vertical axis, Symmetry, Clone, Copy, Move, Rectangular array, Remove axes alignment, Delete all geometry, Delete all constraints
- Sketcher B-spline tools: Show/hide B-spline degree, Show/hide B-spline control polygon, Show/hide B-spline curvature comb, Show/hide B-spline knot multiplicity, Show/hide B-spline control point weight, Convert geometry to B-spline, Increase B-spline degree, Decrease B-spline degree, Increase knot multiplicity, Decrease knot multiplicity, Insert knot, Join curves
- Sketcher virtual space: Switch virtual space
- Additional: Sketcher Dialog, Preferences, Sketcher scripting
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test Framework
- Hubs: User hub, Power users hub, Developer hub