Sketcher BSplinePoleWeight/en: Difference between revisions
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
{{Docnav |
{{Docnav |
||
|[[Sketcher_BSplineKnotMultiplicity|Show/hide B-spline knot multiplicity]] |
|[[Sketcher_BSplineKnotMultiplicity|Show/hide B-spline knot multiplicity]] |
||
|[[Sketcher_RestoreInternalAlignmentGeometry|Show/hide internal geometry]] |
|||
|[[Sketcher_BSplineApproximate|Convert geometry to B-spline]] |
|||
|[[Sketcher_Workbench|Sketcher]] |
|[[Sketcher_Workbench|Sketcher]] |
||
|IconL=Sketcher_BSplineKnotMultiplicity.svg |
|IconL=Sketcher_BSplineKnotMultiplicity.svg |
||
|IconR= |
|IconR=Sketcher_RestoreInternalAlignmentGeometry.svg |
||
|IconC=Workbench_Sketcher.svg |
|IconC=Workbench_Sketcher.svg |
||
}} |
}} |
||
Line 12: | Line 12: | ||
{{GuiCommand |
{{GuiCommand |
||
|Name=Sketcher BSplinePoleWeight |
|Name=Sketcher BSplinePoleWeight |
||
|MenuLocation=Sketch → Sketcher B-spline |
|MenuLocation=Sketch → Sketcher visual → Show/hide B-spline information layer → Show/hide B-spline control point weight |
||
|Workbenches=[[Sketcher_Workbench|Sketcher]] |
|Workbenches=[[Sketcher_Workbench|Sketcher]] |
||
|Version=0.19 |
|Version=0.19 |
||
|SeeAlso=[[ |
|SeeAlso=[[Sketcher_CreateBSpline|Sketcher CreateBSpline]] |
||
}} |
}} |
||
==Description== |
==Description== |
||
The [[Image:Sketcher_BSplinePoleWeight.svg|24px]] [[Sketcher_BSplinePoleWeight|Sketcher BSplinePoleWeight]] tool shows or hides the [[B-Splines|B-spline]] control point weight in all sketches. |
|||
Shows or hides the display of the '''weights''' for the control points of a B-spline curve (see [[#Weight_Explanation|below]] for an explanation of weights). |
|||
[[File:sketcher_BSplineWeightShow.png|468px]] |
[[File:sketcher_BSplineWeightShow.png|468px]] |
||
{{Caption| |
{{Caption|The numbers (green, in square brackets) refer to the weights of the control points.}} |
||
==Usage== |
==Usage== |
||
# There are several ways to invoke the tool: |
|||
# |
#* Press the {{Button|[[Image:Sketcher_BSplinePoleWeight.svg|16px]] [[Sketcher_BSplinePoleWeight|Show/hide B-spline control point weight]]}} button. |
||
#* Select the {{MenuCommand|Sketch → Sketcher visual → Show/hide B-spline information layer → [[Image:Sketcher_BSplinePoleWeight.svg|16px]] Show/hide B-spline control point weight}} option from the menu. |
|||
== |
==Changing weights== |
||
⚫ | |||
B-splines are basically a combination of [[B-Splines#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 Bézier curve is calculated using this formula: |
|||
<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{P_{i}}_{\text{point coordinate}} |
|||
</math> |
|||
''n'' is hereby the degree of the curve. So a Bézier curve of degree ''n'' is a polygon with order ''n''. The factors <math>P_{i}</math> are hereby in fact the coordinates of the Bézier curves' control points. For a visualization see [https://pomax.github.io/bezierinfo/#control this page]. |
|||
The term weight in FreeCAD is a bit misleading because in literature the factors <math>P_{i}</math> 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: |
|||
<math>\quad |
|||
\mathrm{Rational\ Bezier}(n,t)=\cfrac{\sum_{i=0}^{n}\binom{n}{i}\left(1-t\right)^{n-i}t^{i}w_{i}P_{i}}{\sum_{i=0}^{n}\binom{n}{i}\left(1-t\right)^{n-i}t^{i}w_{i}\;\;\;\,} |
|||
</math> |
|||
whereby <math>w_{i}</math> is the weight for the point <math>P_{i}</math>. |
|||
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: |
|||
[[File:sketcher_BSplineWeightDouble.png|468px]] |
|||
{{Caption|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: |
|||
[[File:sketcher_BSplineWeightZero.png|468px]] |
|||
{{Caption|Same B-spline with an almost zero weight control point}} |
|||
==Changing Weights== |
|||
⚫ | |||
{{Docnav |
{{Docnav |
||
|[[Sketcher_BSplineKnotMultiplicity|Show/hide B-spline knot multiplicity]] |
|[[Sketcher_BSplineKnotMultiplicity|Show/hide B-spline knot multiplicity]] |
||
|[[Sketcher_RestoreInternalAlignmentGeometry|Show/hide internal geometry]] |
|||
|[[Sketcher_BSplineApproximate|Convert geometry to B-spline]] |
|||
|[[Sketcher_Workbench|Sketcher]] |
|[[Sketcher_Workbench|Sketcher]] |
||
|IconL=Sketcher_BSplineKnotMultiplicity.svg |
|IconL=Sketcher_BSplineKnotMultiplicity.svg |
||
|IconR= |
|IconR=Sketcher_RestoreInternalAlignmentGeometry.svg |
||
|IconC=Workbench_Sketcher.svg |
|IconC=Workbench_Sketcher.svg |
||
}} |
}} |
Latest revision as of 11:04, 7 May 2024
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.
The numbers (green, in square brackets) refer to the weights of the control points.
Usage
- 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.
Changing weights
How to change weights is described on this page.
Sketcher
- 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
User documentation
- 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, Assembly, BIM, 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