Sketcher: Bezier curves
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Sketcher: Bezier curves
Dear all,
This is to say that I have started the coding. Here:
https://github.com/abdullahtahiriyo/Fre ... pline_2017
Currently there is very little coded, but it is possible to see an amovable bspline created in the sketcher from python:
it corresponds to these poles:
viewtopic.php?t=9312
Because BSpline is still missing serialization, FreeCAD will crash as soon as the autosave feature starts
There is a loooooooooooooooooooooooooong way to go and it is not usable yet. But it will get better with time... I hope
I want to thank everybody that helped me understand, provided resources (Werner's on continuity were very much welcome), contributed to the discussion... You are kind nice people (you even offered to send me a book, amazing!).
Now, I won't be coding for a couple of weeks as the "coding wind" is being overcome by a tornado of busy-ness...
EDIT: App.ActiveDocument.Sketch.addGeometry(Part.BSplineCurve([App.Vector(0,0),App.Vector(0.5,1),App.Vector(1,0)]),False)
This is to say that I have started the coding. Here:
https://github.com/abdullahtahiriyo/Fre ... pline_2017
Currently there is very little coded, but it is possible to see an amovable bspline created in the sketcher from python:
it corresponds to these poles:
viewtopic.php?t=9312
Because BSpline is still missing serialization, FreeCAD will crash as soon as the autosave feature starts
There is a loooooooooooooooooooooooooong way to go and it is not usable yet. But it will get better with time... I hope
I want to thank everybody that helped me understand, provided resources (Werner's on continuity were very much welcome), contributed to the discussion... You are kind nice people (you even offered to send me a book, amazing!).
Now, I won't be coding for a couple of weeks as the "coding wind" is being overcome by a tornado of busy-ness...
EDIT: App.ActiveDocument.Sketch.addGeometry(Part.BSplineCurve([App.Vector(0,0),App.Vector(0.5,1),App.Vector(1,0)]),False)
Re: Sketcher: Bezier curves
I have added a creation method, so now it can be constructed by clicking in the poles, double-click for last pole. Jim's icons from 3 years ago are in. Still amovable and crash on autosave, so not usable and no testing required, just a follow up post:
Re: Sketcher: Bezier curves
Hi Abdullah,
It's great to see your progress.
Keep up the good work !
Chris
It's great to see your progress.
Keep up the good work !
Chris
Re: Sketcher: Bezier curves
I have just pushed to my branch basic BSpline serialization, so now it does not crash when autosave. It still needs some work (to support periodic BSplines)... for the next coding slot...Chris_G wrote:Hi Abdullah,
It's great to see your progress.
Keep up the good work !
Chris
Re: Sketcher: Bezier curves
Thanks for your work Abdullah. Please see my comments I added to your branch on github.
Will you be able to do the recommended code change before you leave? Otherwise I can make the changes and merge the branch into master.
Will you be able to do the recommended code change before you leave? Otherwise I can make the changes and merge the branch into master.
There isn't much to do I think. All what you need is to store whether it's periodic or not. The actual information is put inside the knot sequence and the multiplicities.It still needs some work (to support periodic BSplines)... for the next coding slot...
Re: Sketcher: Bezier curves
This was one of the old daunting tasks nobody would dare to undertake... Thanks a lot for this Abdullah!
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: Sketcher: Bezier curves
Great,
I'm waiting to design my first car with profiles from sketcher
viewtopic.php?f=13&t=17970&p=152321#p152321
I'm waiting to design my first car with profiles from sketcher
viewtopic.php?f=13&t=17970&p=152321#p152321
Re: Sketcher: Bezier curves
Werner, this can not be merged. It is not there yet by far. It is not usable ATM (Compile and try to use it and you will see what I mean).wmayer wrote:Thanks for your work Abdullah. Please see my comments I added to your branch on github.
Will you be able to do the recommended code change before you leave? Otherwise I can make the changes and merge the branch into master.
There isn't much to do I think. All what you need is to store whether it's periodic or not. The actual information is put inside the knot sequence and the multiplicities.It still needs some work (to support periodic BSplines)... for the next coding slot...
While I accept that BSpline support may be added in chunks of increasing functionality, we do not currently meet any reasonable minimum requirements. For that, IMO the bspline has at least to be movable and constrainable on its endpoints. I would like to have the poles available in addition. Given my current workload I will try to reach there within a month. Sorry if it gave the impression it was more advanced.
I will take a look to your comments and also integrate your reply to my question in the other thread. Yes I am missing storing isperiodic. I ran out if coding time and had to commit to github as I was using a borrowed PC that I had to return...
Re: Sketcher: Bezier curves
Of course everything that affects the GUI or Python interface of the sketcher will be commented out. My idea was to avoid to duplicate effort when we wait again a couple of months because then too many things may have changed and a merge doesn't work properly any more.Werner, this can not be merged. It is not there yet by far. It is not usable ATM (Compile and try to use it and you will see what I mean).
Re: Sketcher: Bezier curves
Ok. I do understand your point.wmayer wrote:Of course everything that affects the GUI or Python interface of the sketcher will be commented out. My idea was to avoid to duplicate effort when we wait again a couple of months because then too many things may have changed and a merge doesn't work properly any more.Werner, this can not be merged. It is not there yet by far. It is not usable ATM (Compile and try to use it and you will see what I mean).
Let's do it like this if it is ok for you: let's see first how much I can handle within the next week. If progress is made, then we wait to have something usable, if it stalls, then I we disable the features a merge it.
With respect to the comments on GitHub, I must repeat myself: What a wonderful eye for detail you have! I have just fixed the issues.
Beautiful project!microelly2 wrote:Great,
I'm waiting to design my first car with profiles from sketcher
yorik wrote:This was one of the old daunting tasks nobody would dare to undertake... Thanks a lot for this Abdullah!
You are welcome! (although it is really not there yet) Hopefully I will manage to make it useful soon...wmayer wrote:Thanks for your work Abdullah