[new feature] Bspline knots
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
[new feature] Bspline knots
As from today, Bsplines have knots and you can change the multiplicity of the knots:
Those points on the line are the knots, and you have a couple of controls in the bspline bar to increase and decrease the multiplicity of a knot.
So yes, now if you want to make a sharp edge within a bspline you can
Those points on the line are the knots, and you have a couple of controls in the bspline bar to increase and decrease the multiplicity of a knot.
So yes, now if you want to make a sharp edge within a bspline you can
Re: [new feature] Bspline knots
abdullah ,
Thank you very much for your contribution in improving the design capacity of the program, I just wish that you would like to develop the parametric Bspline that I mentioned months ago in the following link:
viewtopic.php?f=8&t=16081
Tanks again.
Thank you very much for your contribution in improving the design capacity of the program, I just wish that you would like to develop the parametric Bspline that I mentioned months ago in the following link:
viewtopic.php?f=8&t=16081
Tanks again.
Re: [new feature] Bspline knots
What you refer to apparently requires point on B-Spline. That is not within my short-term goals.MMSN wrote:abdullah ,
Thank you very much for your contribution in improving the design capacity of the program, I just wish that you would like to develop the parametric Bspline that I mentioned months ago in the following link:
viewtopic.php?f=8&t=16081
Tanks again.
It might happen sooner to have the ability of approximate a bspline to points in the sketcher (outside the sketcher there is already such functionality). In fact, I think it is possible to create a bspline in the sketcher that approximates some points ATM from python (look at the ways to generate a bspline from python and add the result to the sketch). However, this is a one time approximation, if you move the points or you move the bspline it won't follow.
I do not know if it suites your application, but if instead of linking points on the bspline, you would link the bspline poles with the spreedsheet, then you could have some degree of parametric control.
If you are good with Python (I am not), you may be able to combine both, so somehow, you read the location of your points in a sketcher, you approximate a bspline using these points, the you update the bspline in the sketcher with the poles used for the approximation... I might just have come to a very weird alternative way of implementing a one-way point on object...
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: [new feature] Bspline knots
This is really the last great step forward (for me). Thank you for your work.abdullah wrote:As from today, Bsplines have knots and you can change the multiplicity of the knots:
Those points on the line are the knots, and you have a couple of controls in the bspline bar to increase and decrease the multiplicity of a knot.
So yes, now if you want to make a sharp edge within a bspline you can
Now once more we can simplify the models.
We have a method to get a Skecher Bspline from a Draft Bspline (from a point cloud)MMSN wrote: viewtopic.php?f=8&t=16081
https://www.youtube.com/watch?v=Dh5jUAdPp5I
At the end the parameters should not be points because there will be some DOG when you approximate/interpolate
Having poles with weights and knots with multiplicities is the best parametric solution.
https://www.youtube.com/watch?v=7gU2jaKNYUI
Re: [new feature] Bspline knots
I think I will make a break on B-Spline coding. There are still some ideas I would like to see implemented, but I have other things I would like to have in FC first. I will probably try to improve the external geometry import (DeepSOIC's teaser in carbon copy thread). I would like to see some kind of offset curve implementation in the Sketcher. I would like to see an automatic working plane generation in Part Design. I want to revisit the deletion of geometry in the sketcher now that we have unique identifiers in the geometry... I will be using FC for a while, so I will probably see more shortcomings.microelly2 wrote:This is really the last great step forward (for me). Thank you for your work.
Now once more we can simplify the models.
However, if you see bugs or features, feel free to post in the "Bezier" (sic) thread
Re: [new feature] Bspline knots
Thanks!abdullah wrote:As from today, Bsplines have knots and you can change the multiplicity of the knots...
Re: [new feature] Bspline knots
Great work Abdullah.
I think I found a bug. I created a B-spline, selected a knot then raised its multiplicity from (1) to (2). Then I tried to decrease the same knot multiplicity from (2) to (1) but I get this error:
Thanks for your work!
OS: Ubuntu 16.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10792 (Git)
Build type: None
Branch: master
Hash: 3b50a786f351339dd0c791b4e0e0e403f86033f0
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
I think I found a bug. I created a B-spline, selected a knot then raised its multiplicity from (1) to (2). Then I tried to decrease the same knot multiplicity from (2) to (1) but I get this error:
I have a question: there's a tool to increase the degree of a B-spline: it increases the number of control points. But I haven't found a way to decrease the degree of a B-spline? That is, to decrease the number of control points.Error wrote:Unknown C++ exception
Thanks for your work!
OS: Ubuntu 16.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10792 (Git)
Build type: None
Branch: master
Hash: 3b50a786f351339dd0c791b4e0e0e403f86033f0
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Re: [new feature] Bspline knots
There are further bugs:
- when increasing the degree it doesn't add the new control points
- when selecting a knot to decrease it the SW always complained that a knot was not selected (but can't reproduce this behaviour any more)
- Attachments
-
- sketch_spline_test.FCStd
- (9.56 KiB) Downloaded 110 times
Re: [new feature] Bspline knots
Hi Normand,
It is always possible to increase the degree of a BSpline curve, while keeping its exact shape.
The algorithm will ( usually ? always ? I'm not sure ) add 1 control point for each degree increase step.
On the other hand, in the general case, there is no way to decrease the degree of the curve AND keep the original shape.
The general approach would be to approximate the curve with a lower degree one. And this (lower degree) approximating curve will most probably have MORE control points that the original one.
There are only special cases where it is possible : when you increase the degree of a curve, then, if you don't manipulate it, you can go back to a "simpler" (lower degree, fewer control points) curve.
So, modifying the degree of a curve while keeping its exact shape is a kind of "one way road".
Below is a degree increase sequence ( the exact shape of the curve is preserved ): And here is the degree decrease sequence, by approximating ( the exact shape of the curve is NOT preserved ): In the end, we are pretty lucky because the algorithm found a simple degree-3, 4-poles curve, but it is most probably not exactly the original one ...
Unfortunately, that's not that easy ...I have a question: there's a tool to increase the degree of a B-spline: it increases the number of control points. But I haven't found a way to decrease the degree of a B-spline? That is, to decrease the number of control points.
It is always possible to increase the degree of a BSpline curve, while keeping its exact shape.
The algorithm will ( usually ? always ? I'm not sure ) add 1 control point for each degree increase step.
On the other hand, in the general case, there is no way to decrease the degree of the curve AND keep the original shape.
The general approach would be to approximate the curve with a lower degree one. And this (lower degree) approximating curve will most probably have MORE control points that the original one.
There are only special cases where it is possible : when you increase the degree of a curve, then, if you don't manipulate it, you can go back to a "simpler" (lower degree, fewer control points) curve.
So, modifying the degree of a curve while keeping its exact shape is a kind of "one way road".
Below is a degree increase sequence ( the exact shape of the curve is preserved ): And here is the degree decrease sequence, by approximating ( the exact shape of the curve is NOT preserved ): In the end, we are pretty lucky because the algorithm found a simple degree-3, 4-poles curve, but it is most probably not exactly the original one ...
Re: [new feature] Bspline knots
Thanks Normand!!NormandC wrote:Great work Abdullah.
I think I found a bug. I created a B-spline, selected a knot then raised its multiplicity from (1) to (2). Then I tried to decrease the same knot multiplicity from (2) to (1) but I get this error:
I have a question: there's a tool to increase the degree of a B-spline: it increases the number of control points. But I haven't found a way to decrease the degree of a B-spline? That is, to decrease the number of control points.Error wrote:Unknown C++ exception
Thanks for your work!
OS: Ubuntu 16.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10792 (Git)
Build type: None
Branch: master
Hash: 3b50a786f351339dd0c791b4e0e0e403f86033f0
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Now, I had one sketch where I was having this problem. I wanted to recreate the issue with OCC only code, but I failed. Then I forgot about it. So far, it only happens in some bsplines having exactly 5 poles. I will look into it. Thanks for reporting!!
EDIT: I stand corrected. I was mixing degrees and multiplicities... No tools for degree reduction.
Last edited by abdullah on Wed Apr 12, 2017 12:03 pm, edited 2 times in total.