[new feature] Sketcher basic BSpline support

Info about new implemented features, classes, modules or APIs. Might get technical!
abdullah
Posts: 1599
Joined: Sun May 04, 2014 3:16 pm

[new feature] Sketcher basic BSpline support

Postby abdullah » Fri Jan 20, 2017 10:37 pm

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 712 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 712 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 712 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 708 times
jmaustpc
Posts: 8094
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: [new feature] Sketcher basic BSpline support

Postby jmaustpc » Sat Jan 21, 2017 3:24 am

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: 11
Joined: Fri Nov 18, 2016 4:13 pm

Re: [new feature] Sketcher basic BSpline support

Postby Msegade » Sat Jan 21, 2017 3:39 am

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: 156
Joined: Tue Jul 28, 2015 7:28 am

Re: [new feature] Sketcher basic BSpline support

Postby jean.thil » Sat Jan 21, 2017 7:15 am

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
Site Admin
Posts: 8647
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: [new feature] Sketcher basic BSpline support

Postby yorik » Sat Jan 21, 2017 2:46 pm

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

Re: [new feature] Sketcher basic BSpline support

Postby triplus » Sat Jan 21, 2017 2:48 pm

Thanks @abdullah.

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

Re: [new feature] Sketcher basic BSpline support

Postby wmayer » Sat Jan 21, 2017 3:57 pm

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

Re: [new feature] Sketcher basic BSpline support

Postby abdullah » Sat Jan 21, 2017 8:34 pm

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: 21
Joined: Fri Nov 21, 2014 11:45 am
Location: SJCAMPOS, SP - BR

Re: [new feature] Sketcher basic BSpline support

Postby hinckel » Sat Jan 21, 2017 10:09 pm

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
Posts: 4988
Joined: Mon Dec 12, 2011 4:45 pm

Re: [new feature] Sketcher basic BSpline support

Postby triplus » Sat Jan 21, 2017 10:11 pm

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