An example of Gordon Surface based upon OCC

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
freecad-heini-1
Veteran
Posts: 7791
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: An example of Gordon Surface based upon OCC

Post by freecad-heini-1 »

Chris_G wrote: Wed Nov 14, 2018 9:14 am The good news is that I found were the bug is happening.
The bad news is that it is located in the most complex function, dealing with "matrix solving", that is way over my poor math skills.
So I don't know how I will be able to fix that ... :cry:
What about to ask user rainman110, Martin from Cologne Germany?
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: An example of Gordon Surface based upon OCC

Post by microelly2 »

Chris_G wrote: Wed Nov 14, 2018 9:14 am
hammax wrote: Wed Nov 14, 2018 6:44 am … I see new features updated for GordonSurface in the CurvesWB.
I am trying to fix Gordon surface.
Currently, the algorithm is only partially working, and produces surfaces that have far too much control points.
The smartest and most important part of the TiGL algorithm is about preparing and reparametrizing the curves before feeding them to the actual Gordon algo.
I realized that these optimization functions were actually skipped in my implementation (and broken BTW).
The good news is that I found were the bug is happening.
The bad news is that it is located in the most complex function, dealing with "matrix solving", that is way over my poor math skills.
So I don't know how I will be able to fix that ... :cry:
The simplest workaround should be to run the method with ribs which have the same structure: number of poles,multiplicities and the same degree.
any two curves can be refined to such a common structure.
User avatar
Chris_G
Veteran
Posts: 2601
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: An example of Gordon Surface based upon OCC

Post by Chris_G »

freecad-heini-1 wrote: Wed Nov 14, 2018 9:23 am What about to ask user rainman110, Martin from Cologne Germany?
Well ... I am not very keen on disturbing people.
And I see it as a good opportunity to learn these matrix things first.
Then, if I fail, I might ask for help.
microelly2 wrote: Wed Nov 14, 2018 9:27 am The simplest workaround should be to run the method with ribs which have the same structure: number of poles,multiplicities and the same degree.
any two curves can be refined to such a common structure.
That's not enough. The curves must also be reparametrized, so that they become isoCurves of the future surface.
That's all the beauty of the original algorithm : it does this hard job for us.
And even outside of the Gordon surface context, the reparametrizing function offers great functionalities :
- imagine you have a list of points, and you want to fit a curve on them.
- you can set some of the points to be interpolated, while the others will be approximated
- and you can choose the degree, and the number of control points !
So this is a very interesting mix between interpolation and approximation.
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: An example of Gordon Surface based upon OCC

Post by microelly2 »

Chris_G wrote: Wed Nov 14, 2018 9:59 am And even outside of the Gordon surface context, the reparametrizing function offers great functionalities :
- imagine you have a list of points, and you want to fit a curve on them.
- you can set some of the points to be interpolated, while the others will be approximated
- and you can choose the degree, and the number of control points !
So this is a very interesting mix between interpolation and approximation.
Would be an interesting tool.
How the user will control which points are approximated and which are interpolation anchors?
My idea at the moment is to define bezier with parametric control points and the tangent direction I calculate with least square against a point cloud.
https://youtu.be/kPrQq4UOnR4
User avatar
Chris_G
Veteran
Posts: 2601
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: An example of Gordon Surface based upon OCC

Post by Chris_G »

Good news : I think I managed to fix a couple of bugs !
The resulting surfaces are now almost identical to the one produced by the C++ TiGL algo.
User avatar
hammax
Veteran
Posts: 1994
Joined: Thu Jan 19, 2017 5:03 pm
Location: Ammersee DE

Re: An example of Gordon Surface based upon OCC

Post by hammax »

… yes, now it works also with the interpolated curves
twisted_3_2.PNG
twisted_3_2.PNG (41.94 KiB) Viewed 1726 times
User avatar
hammax
Veteran
Posts: 1994
Joined: Thu Jan 19, 2017 5:03 pm
Location: Ammersee DE

Re: An example of Gordon Surface based upon OCC

Post by hammax »

… answering gflorent's mail:
An updated ships' hull with gordon surface => very easy and straightforward from
https://forum.freecadweb.org/viewtopic. ... 10#p244083
Maybe look also here: https://forum.freecadweb.org/viewtopic. ... 63#p269050
Gordon_Hull.PNG
Gordon_Hull.PNG (21.42 KiB) Viewed 1694 times
Attachments
GordonS_Test.FCStd
FC.18.15208
(22.82 KiB) Downloaded 80 times
freecad-heini-1
Veteran
Posts: 7791
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: An example of Gordon Surface based upon OCC

Post by freecad-heini-1 »

Chris_G wrote: Wed Nov 14, 2018 6:18 pm Good news : I think I managed to fix a couple of bugs !
The resulting surfaces are now almost identical to the one produced by the C++ TiGL algo.
Hi Chris,
thank you so much. Indeed you are reporting great news.
Best regards
Wilfried
User avatar
gflorent
Posts: 49
Joined: Fri Aug 10, 2018 10:05 am
Location: France
Contact:

Re: An example of Gordon Surface based upon OCC

Post by gflorent »

I am starting with the Curves WB. Installed it via the Addons Manager on FC 0.17 13528 on Win 10. I create a BSpline curve with the "Create a BSpline curve" command and then, while it is selected, I click the "Create an editable spline from selected edges" in the hope to be able to modify it later via the control points. Then FreeCAD crashes and closes. Is it the right way to make a BSpline editable? Does anyone know of a good tutorial to get started?
User avatar
Chris_G
Veteran
Posts: 2601
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: An example of Gordon Surface based upon OCC

Post by Chris_G »

gflorent wrote: Mon Nov 19, 2018 7:37 pm I am starting with the Curves WB. Installed it via the Addons Manager on FC 0.17 13528 on Win 10. I create a BSpline curve with the "Create a BSpline curve" command and then, while it is selected, I click the "Create an editable spline from selected edges" in the hope to be able to modify it later via the control points. Then FreeCAD crashes and closes. Is it the right way to make a BSpline editable? Does anyone know of a good tutorial to get started?
CurvesWB is an """EXPERIMENTAL""" workbench.
Some tools are not working very good.
These 2 tools you tried should not be used. I should remove them from the toolbar.
For an editable BSpline, you'd better use Sketcher, or Draft.
Post Reply