[new feature] Sketcher basic BSpline support

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!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

[new feature] Sketcher basic BSpline support

Post by abdullah »

A basic BSpline support for the Sketcher has just been merged into master.

Now you can create a BSpline in the sketcher:
bspline-pole-weight.png
bspline-pole-weight.png (17.22 KiB) Viewed 3809 times
The construction circles represent the poles (also known as control points), the center is the position of the pole and the radius is the weight of the pole. Pole position and weight allows for coarse, finer control over the BSpline.

Periodic closed BSplines are also supported:
bspline-periodic1.png
bspline-periodic1.png (13.61 KiB) Viewed 3809 times
While the constraint support on the curve of the BSpline is very limited, endpoint tangency is supported (also endpoint perpendicular):
bspline-endpoint-tangency.png
bspline-endpoint-tangency.png (13.98 KiB) Viewed 3809 times
Enjoy it!!

EDIT: You can create them by using this new icons in the toolbar:
tool-bspline.png
tool-bspline.png (24.7 KiB) Viewed 3805 times
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: [new feature] Sketcher basic BSpline support

Post by jmaustpc »

Well done Abdulla! This is something that has been asked for many times over the years. Sketcher gets Bspline support on the same day I got a new pet goat, who is now living with our pet cowies.....One of the advantages of living in the bush, you can have cool pets! :)

Jim
Msegade
Posts: 12
Joined: Fri Nov 18, 2016 4:13 pm

Re: [new feature] Sketcher basic BSpline support

Post by Msegade »

Thanks! This is very cool.

Is this supposed to work with the "create an edge linked to external geometry" tool, to add external splines to the sketch? or is this not yet implemented?
I want to create geometries based on external splines (using the fixing point to object constraint), and this could be very helpful.
jean.thil
Posts: 209
Joined: Tue Jul 28, 2015 7:28 am

Re: [new feature] Sketcher basic BSpline support

Post by jean.thil »

It is not supported yet

Code: Select all

BSpline: Not yet supported geometry for external geometry
Failed to add external geometry: Not able to add external shape element
I support this demand.
I think that the control points of the BSpline which is the result of the projection of another BSpline are the projections of the control points of the projected BSpline so it shouldn't be too difficult from a mathematical point of view.
Anyway, many thanks to Abdullah.
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: [new feature] Sketcher basic BSpline support

Post by yorik »

Incredible advance Abdullah! Thanks so much for this!
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: [new feature] Sketcher basic BSpline support

Post by triplus »

Thanks @abdullah.

P.S. I guess now Sketcher isn’t rough around the edges anymore! ;)
wmayer
Founder
Posts: 20241
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: [new feature] Sketcher basic BSpline support

Post by wmayer »

Thanks! Very cool feature!!!
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: [new feature] Sketcher basic BSpline support

Post by abdullah »

Thanks to all. It is a very basic support, but should allow users to do quite a lot. If you do something cool post in the user case, I usually check what you guys do there! ;)
jmaustpc wrote:Well done Abdulla! This is something that has been asked for many times over the years. Sketcher gets Bspline support on the same day I got a new pet goat, who is now living with our pet cowies.....One of the advantages of living in the bush, you can have cool pets!
Definitely cool pets!! BTW I guess you will recognise the BSpline icons, don't you? Thanks for that!
Msegade wrote: Is this supposed to work with the "create an edge linked to external geometry" tool, to add external splines to the sketch? or is this not yet implemented?
jean.thil wrote:It is not supported yet

Code: Select all
BSpline: Not yet supported geometry for external geometry
Failed to add external geometry: Not able to add external shape element

I support this demand.
I think that the control points of the BSpline which is the result of the projection of another BSpline are the projections of the control points of the projected BSpline so it shouldn't be too difficult from a mathematical point of view.
I though I had done this, but I checked and I did not. It will come probably with STAGE 1b (next work package on BSplines).
hinckel
Posts: 111
Joined: Fri Nov 21, 2014 11:45 am
Location: SJCAMPOS, SP - BR

Re: [new feature] Sketcher basic BSpline support

Post by hinckel »

What am I doing wrong?
I compiled latest version of FC without problems. I get the BSpline icons in the Sketcher toolbar. I choose one of the two options and start
drawing the Spline. (point after point) I get lines connecting the point (with a slightly different color and than polyline). When I right-click
to end Bs I get nothing; gone the pseudo polyline, the point and the BSpline.

OS: "openSUSE Leap 42.2"
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.9758 (Git)
Build type: Unknown
Branch: master
Hash: f3f7b01202646d7103961ba24063658a9f72e650
Python version: 2.7.12
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.9.1.oce-0.18

Thanks.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: [new feature] Sketcher basic BSpline support

Post by triplus »

Currently you need to double click to exit the curve creation process.
Post Reply