New Wiki page describing B-splines

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
User avatar
uwestoehr
Posts: 2730
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

New Wiki page describing B-splines

Postby uwestoehr » Sat Jun 05, 2021 4:06 pm

I created a new Wiki page:

https://wiki.freecadweb.org/B-Splines

that
* explains what B-splines are
* how one can use them in FreeCAD
* shows some use cases

I hope this helps especially new users.

Every constructive comment is welcome.

For developers the section https://wiki.freecadweb.org/B-Splines#Limitations might be interesting. I know that ironing out the limitations is not easy, but maybe there are some libraries around that actually provide e.g. the calculation of a tangential to a spline.

abdullah wrote: .
User avatar
onekk
Posts: 952
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: New Wiki page describing B-splines

Postby onekk » Sat Jun 05, 2021 4:43 pm

At a first glance it seems very weel explained, impressive are the animations, explanation is clear (after a quick reading).

Well done!

It lacks of a part describing scripting, it wil be very useful, expecially if it is taylored on Part WB, as it is more near the OCCT implmentation.


Regards.

Carlo D.
Il mio Blog: https://onekk-maker.blogspot.com/

Introduzione a FreeCAD in Italiano: https://github.com/onekk/freecad-doc
abdullah
Posts: 4060
Joined: Sun May 04, 2014 3:16 pm

Re: New Wiki page describing B-splines

Postby abdullah » Sun Jun 06, 2021 5:33 am

uwestoehr wrote: Sat Jun 05, 2021 4:06 pm For developers the section https://wiki.freecadweb.org/B-Splines#Limitations might be interesting. I know that ironing out the limitations is not easy, but maybe there are some libraries around that actually provide e.g. the calculation of a tangential to a spline.
The problem are not static calculations. In fact, the solver, unlike for any other geometry, relies on OCCT for calculation of the B-Spline. The solver only sees points (control points, i.e. poles). That is the problem. What is needed is to implement in the solver the parametric calculation of the B-Spline along with all its partial derivatives, then implement the constraints (such as point on object) where they need to be geometry specific. DeepSOIC has given it a thought:
Thanks. You reminded me that I need to come up with an n-th derivative algorithm for b-spline, with parameter derivative support. That's like d2x(t)/(dt dp), d3x(t)/(dt2dp), and so on...
He also posted another post where he asked help for a discussion, which he did not get (and which I cannot find...)

Personally, I have not found time to undertake this yet.
Last edited by Kunda1 on Sun Jun 06, 2021 12:25 pm, edited 1 time in total.
Reason: fixed broken bbcode
UR_
Posts: 1327
Joined: Tue Jan 03, 2017 8:42 pm

Re: New Wiki page describing B-splines

Postby UR_ » Sun Jun 06, 2021 6:29 am

under Limitations you wrote:
4. You cannot create an offset curve for a B-spline using the tool Draft Offset.
This sounds a little bit desperately :(

Perhaps you can add:
Please use Part 2D Offset instead
;)
jonasb
Posts: 29
Joined: Tue Dec 22, 2020 7:57 pm

Re: New Wiki page describing B-splines

Postby jonasb » Sun Jun 06, 2021 11:33 am

abdullah wrote: Sun Jun 06, 2021 5:33 am He also posted another post where he asked help for a discussion, which he did not get (and which I cannot find...)
Are you referring to this endeavour: https://forum.freecadweb.org/viewtopic.php?f=20&t=40525
User avatar
uwestoehr
Posts: 2730
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

Re: New Wiki page describing B-splines

Postby uwestoehr » Sun Jun 06, 2021 5:12 pm

UR_ wrote: Sun Jun 06, 2021 6:29 am Perhaps you can add:
Please use Part 2D Offset instead
;)
This does not help. At least in my use cases I need the offset spline within the same sketch. With Part's 2D offset I can only offset the whole sketch and I never had a use case where this helps.

But in general the Sketcher WB should offer an offset tool -> I know the whishlist is long, therefore I don't complain but continue to contribute :ugeek:
User avatar
uwestoehr
Posts: 2730
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

Re: New Wiki page describing B-splines

Postby uwestoehr » Thu Jun 10, 2021 12:47 pm

abdullah wrote: Sun Jun 06, 2021 5:33 am
DeepSOIC wrote: Fri Jun 08, 2018 11:54 pm You reminded me that I need to come up with an n-th derivative algorithm for b-spline, with parameter derivative support. That's like d2x(t)/(dt dp), d3x(t)/(dt2dp), and so on...
He also posted another post where he asked help for a discussion, which he did not get (and which I cannot find...)

Personally, I have not found time to undertake this yet.
Many thanks that you are aware of this. Since the post from DeepSOIC is 3 years old, maybe he already worked on this or would like to?
-> inviting DeepSOIC

DeepSOIC wrote: .
User avatar
DeepSOIC
Posts: 7843
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: New Wiki page describing B-splines

Postby DeepSOIC » Thu Jun 10, 2021 5:04 pm

well, the nth derivatives were halfway there when i abandoned constraintsolver. As for offset bspline in sketcher, i'm not sure. I've heard that an offset spline is possible, though it will be of a higher degree. I suppose, if general constraints to bspline become a reality, it will be possible do knock out an approximation of an offset spline with just these regular constraint, something like constrain the distance between them at all knots for example.
User avatar
GlouGlou
Posts: 3087
Joined: Sun Apr 05, 2015 9:02 am
Location: La Rochelle, France

Re: New Wiki page describing B-splines

Postby GlouGlou » Thu Jun 10, 2021 8:55 pm

Great job!
Limitations
At the moment (FreeCAD 0.19) there are some limitations when using splines you should know:
You cannot set tangential constraints.
...
but can be got around with several bspline. ;)
abdullah
Posts: 4060
Joined: Sun May 04, 2014 3:16 pm

Re: New Wiki page describing B-splines

Postby abdullah » Sat Jun 12, 2021 5:19 am

jonasb wrote: Sun Jun 06, 2021 11:33 am
abdullah wrote: Sun Jun 06, 2021 5:33 am He also posted another post where he asked help for a discussion, which he did not get (and which I cannot find...)
Are you referring to this endeavour: https://forum.freecadweb.org/viewtopic.php?f=20&t=40525
Not that one. But, there might be a link to the one I refer hidden in it.