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!
chrisb
Posts: 24369
Joined: Tue Mar 17, 2015 9:14 am

Re: An example of Gordon Surface based upon OCC

Postby chrisb » Wed Sep 05, 2018 10:51 pm

rainman110 wrote:
Wed Sep 05, 2018 7:36 pm
I am the developer of TiGL and implemented the gordon surface algorithm with my student merlin.
Thanks for making it public.
User avatar
GlouGlou
Posts: 2125
Joined: Sun Apr 05, 2015 9:02 am
Location: La Rochelle, France

Re: An example of Gordon Surface based upon OCC

Postby GlouGlou » Sun Nov 11, 2018 10:40 am

Hi. How to avoid twisted surface?
I've tried to change the order of selection for profiles or guides, but without result.
Attachments
Capture.PNG
Capture.PNG (54.5 KiB) Viewed 671 times
twisted.FCStd
(18.95 KiB) Downloaded 26 times
User avatar
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: An example of Gordon Surface based upon OCC

Postby microelly2 » Sun Nov 11, 2018 10:33 pm

GlouGlou wrote:
Sun Nov 11, 2018 10:40 am
Hi. How to avoid twisted surface?
I've tried to change the order of selection for profiles or guides, but without result.
You gave to flip the direction of one rib curve
freecad-heini-1
Posts: 6925
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: An example of Gordon Surface based upon OCC

Postby freecad-heini-1 » Mon Nov 12, 2018 8:03 am

microelly2 wrote:
Sun Nov 11, 2018 10:33 pm
GlouGlou wrote:
Sun Nov 11, 2018 10:40 am
Hi. How to avoid twisted surface?
I've tried to change the order of selection for profiles or guides, but without result.
You gave to flip the direction of one rib curve
And how?
User avatar
Chris_G
Posts: 1311
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: An example of Gordon Surface based upon OCC

Postby Chris_G » Mon Nov 12, 2018 8:25 am

microelly2 wrote:
Sun Nov 11, 2018 10:33 pm
You have to flip the direction of one rib curve
I am pretty sure the algorithm is supposed to take care of curve orientation by itself.
I have introduced several bugs in my python port.
But I'm afraid I'll gave great difficulties to find them.
User avatar
hammax
Posts: 1089
Joined: Thu Jan 19, 2017 5:03 pm
Location: Ammersee

Re: An example of Gordon Surface based upon OCC

Postby hammax » Mon Nov 12, 2018 4:08 pm

… there is no source from where you get the JoinCurves and therefore no possibility to correct/flip them.
But if you use interpolated curves from the endpoints of the JoinCurves in equal directions
the GordonSurface does not twist.

twisted_2.PNG
twisted_2.PNG (29.86 KiB) Viewed 576 times
Attachments
twisted_2.FCStd
FC.18.15169
(32.24 KiB) Downloaded 30 times
Last edited by hammax on Tue Nov 13, 2018 6:02 am, edited 1 time in total.
User avatar
GlouGlou
Posts: 2125
Joined: Sun Apr 05, 2015 9:02 am
Location: La Rochelle, France

Re: An example of Gordon Surface based upon OCC

Postby GlouGlou » Mon Nov 12, 2018 8:00 pm

@hammax: You just swapped guides with profiles. :D
User avatar
GlouGlou
Posts: 2125
Joined: Sun Apr 05, 2015 9:02 am
Location: La Rochelle, France

Re: An example of Gordon Surface based upon OCC

Postby GlouGlou » Mon Nov 12, 2018 8:02 pm

Chris_G wrote:
Mon Nov 12, 2018 8:25 am
I am pretty sure the algorithm is supposed to take care of curve orientation by itself.
With not to do that manually with a option?
...
I finally change the direction of a sketch and the gordon came right. ;)
And able to finish this Rhino model (or something looking like ;) )
https://form2fab.com/wp-content/uploads ... ique_4.jpg
Attachments
Capture.PNG
Capture.PNG (262.99 KiB) Viewed 541 times
gordonRight.FCStd
(13.99 KiB) Downloaded 28 times
Capture.PNG
Capture.PNG (20.41 KiB) Viewed 551 times
User avatar
hammax
Posts: 1089
Joined: Thu Jan 19, 2017 5:03 pm
Location: Ammersee

Re: An example of Gordon Surface based upon OCC

Postby hammax » Wed Nov 14, 2018 6:44 am

… I see new features updated for GordonSurface in the CurvesWB.
My trial was to use FrenetTN for Sketcher planes creating new profiles on existing profiles.

twisted_3.PNG
twisted_3.PNG (52.07 KiB) Viewed 516 times
Attachments
twisted_3.FCStd
FC.18.15190
(42.93 KiB) Downloaded 28 times
User avatar
Chris_G
Posts: 1311
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: An example of Gordon Surface based upon OCC

Postby Chris_G » 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: