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!
User avatar
Vincent B
Veteran
Posts: 4713
Joined: Sun Apr 05, 2015 9:02 am
Location: La Rochelle, France

Re: An example of Gordon Surface based upon OCC

Post by Vincent B »

oh, you're right, the gordon make it. :shock: thanks
Attachments
Capture.PNG
Capture.PNG (63.91 KiB) Viewed 2966 times
montagdude
Posts: 54
Joined: Tue Jan 08, 2019 9:04 pm

Re: An example of Gordon Surface based upon OCC

Post by montagdude »

I have been looking for something just like this. Thank you so much for your work! Just a few notes:
  1. Using the FreeCAD 0.17 64-bit Linux AppImage, I get an error like this: 'module' object has no attribute 'matmul.' Apparently, the numpy version packaged with FreeCAD doesn't have matmul. I implemented my own version of matmul instead, and then it worked.
  2. Is there any way to control the tolerance of the edge curve interpolation? For my use, I need to be able to create closed solids from surfaces using the Part shape builder. I tried changing the Tol2 D and Tol3 D properties of the Gordon surface, which did cause it to be recomputed, but no matter what I was not able to create a valid closed solid (and it didn't seem like the process was taking any longer either), so I'm not sure if those controls actually do anything.
  3. I have a lot of experience with numerical methods and Python and C++ programming, but very little experience with FreeCAD scripting (I'm just getting started). Is there anything I can do to help improve these tools?
User avatar
Chris_G
Veteran
Posts: 2579
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: An example of Gordon Surface based upon OCC

Post by Chris_G »

montagdude wrote: Tue Jan 08, 2019 9:20 pm Using the FreeCAD 0.17 64-bit Linux AppImage, I get an error like this: 'module' object has no attribute 'matmul.' Apparently, the numpy version packaged with FreeCAD doesn't have matmul. I implemented my own version of matmul instead, and then it worked.
Hi,
Since this workbench is experimental, I must admit that I don't pay much attention about compatibility with the various FC versions.
I only work with current master.
montagdude wrote: Tue Jan 08, 2019 9:20 pm Is there any way to control the tolerance of the edge curve interpolation? For my use, I need to be able to create closed solids from surfaces using the Part shape builder. I tried changing the Tol2 D and Tol3 D properties of the Gordon surface, which did cause it to be recomputed, but no matter what I was not able to create a valid closed solid (and it didn't seem like the process was taking any longer either), so I'm not sure if those controls actually do anything.
The Gordon surface tool is a python port of a C++ tool. There were several hardcoded tolerances in the C++ source code. I was hoping I could reduce these to the 2 properties of the FC object. I am not sure anymore it is a good idea. And I am not sure Tol2D is really used anywhere.
Tol3D however, is used at the beginning of the computation, to detect the curve intersections.
In my personal experiment, I was able to build valid solids with these surfaces. Would you have some example files to test, please.
montagdude wrote: Tue Jan 08, 2019 9:20 pm I have a lot of experience with numerical methods and Python and C++ programming, but very little experience with FreeCAD scripting (I'm just getting started). Is there anything I can do to help improve these tools?
I am not a skilled coder, and this python port has been a real challenge for me. The resulting source code is quite a mess. I am lacking time, but I have several things on my TODO list concerning this tool :
- remove all the commented C++ source code
- remove or comment most of the debug commands (it way too much verbose currently)
- think about the various tolerance values, and expose the needed ones to the user

The Curves Workbench repo : https://github.com/tomate44/CurvesWB
The files are :
- BSplineAlgorithms.py
- BSplineApproxInterp.py
- curve_network_sorter.py
- gordon.py
- gordonFP.py (the FreeCAD FeaturePython object)

Be aware that working on my code is probably not a pleasing experience :oops:
montagdude
Posts: 54
Joined: Tue Jan 08, 2019 9:04 pm

Re: An example of Gordon Surface based upon OCC

Post by montagdude »

Chris_G wrote: Wed Jan 09, 2019 10:48 amHi,
Since this workbench is experimental, I must admit that I don't pay much attention about compatibility with the various FC versions.
I only work with current master.
No problem, that's what I figured. Anyway, this seems to be the only compatibility issue.
Chris_G wrote: Wed Jan 09, 2019 10:48 amThe Gordon surface tool is a python port of a C++ tool. There were several hardcoded tolerances in the C++ source code. I was hoping I could reduce these to the 2 properties of the FC object. I am not sure anymore it is a good idea. And I am not sure Tol2D is really used anywhere.
Tol3D however, is used at the beginning of the computation, to detect the curve intersections.
In my personal experiment, I was able to build valid solids with these surfaces. Would you have some example files to test, please.
Thanks for the info. I will play with that some more and post an example if I can't get it to work.
Chris_G wrote: Wed Jan 09, 2019 10:48 amI am not a skilled coder, and this python port has been a real challenge for me. The resulting source code is quite a mess. I am lacking time, but I have several things on my TODO list concerning this tool :
- remove all the commented C++ source code
- remove or comment most of the debug commands (it way too much verbose currently)
- think about the various tolerance values, and expose the needed ones to the user

The Curves Workbench repo : https://github.com/tomate44/CurvesWB
The files are :
- BSplineAlgorithms.py
- BSplineApproxInterp.py
- curve_network_sorter.py
- gordon.py
- gordonFP.py (the FreeCAD FeaturePython object)
Thanks for the info. I will take a look through there when I get a chance.
Chris_G wrote: Wed Jan 09, 2019 10:48 amBe aware that working on my code is probably not a pleasing experience :oops:
I'm sure you are too humble.
User avatar
Vincent B
Veteran
Posts: 4713
Joined: Sun Apr 05, 2015 9:02 am
Location: La Rochelle, France

Re: An example of Gordon Surface based upon OCC

Post by Vincent B »

Can't make the gordon.
The green group doesn't touch themselves. Every red curve touches the greens.
Any idea?
What about told 3D do actually?
Attachments
Capture.PNG
Capture.PNG (21.42 KiB) Viewed 2778 times
User avatar
Chris_G
Veteran
Posts: 2579
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: An example of Gordon Surface based upon OCC

Post by Chris_G »

Your curves won't work for Gordon surfaces.
You need some curves that have a grid pattern.
Each curve of a group (guides or profiles) must intersect ALL the curves of the other group.
Each red curve must intersect all the green curves.
Each green curve must intersect all the red curves.
Grid_pattern_2.jpeg
Grid_pattern_2.jpeg (55.35 KiB) Viewed 2772 times
User avatar
hammax
Veteran
Posts: 1985
Joined: Thu Jan 19, 2017 5:03 pm
Location: Ammersee DE

Re: An example of Gordon Surface based upon OCC

Post by hammax »

… until now I didn't believe, that this would be possible.
But there is a way to form a complex hull out of gordon surface with a minimum of frames and stringers.
Maybe more frames could deliver a "smoother" or better controllable shape????

GlouHull.png
GlouHull.png (59.5 KiB) Viewed 2716 times
Attachments
GlouHull.FCStd
FC.18.15639
(340.26 KiB) Downloaded 140 times
LLuoss
Posts: 17
Joined: Mon Apr 29, 2019 6:41 am

Re: An example of Gordon Surface based upon OCC

Post by LLuoss »

microelly2 wrote: Fri Jul 13, 2018 7:38 am
freecad-heini-1 wrote: Thu Jul 12, 2018 7:22 pm Whow Thomas, very nice. Please can you try to create a gordon surface with m experiments to design the tide-bottle in Freecad:
tide_bottle_gordon.fcstd
I had to model the circle and the ellipse as beziers,
here are the sketches and curves
bp_829.png
and here the surface
bp_830.png
Hi,I'm thinking if this model can be implemented with python code?Could you give me an example?Thank you very much. Looking forward to your reply
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 »

LLuoss wrote: Thu Aug 29, 2019 9:29 am
microelly2 wrote: Fri Jul 13, 2018 7:38 am
freecad-heini-1 wrote: Thu Jul 12, 2018 7:22 pm Whow Thomas, very nice. Please can you try to create a gordon surface with m experiments to design the tide-bottle in Freecad:
tide_bottle_gordon.fcstd
I had to model the circle and the ellipse as beziers,
here are the sketches and curves
bp_829.png
and here the surface
bp_830.png
Hi,I'm thinking if this model can be implemented with python code?Could you give me an example?Thank you very much. Looking forward to your reply
Have a look at the nurbs workbench. Threre are some classes where I implement sketcher python objects.
CAD&amia
Posts: 6
Joined: Wed Dec 14, 2022 7:20 am

Re: An example of Gordon Surface based upon OCC

Post by CAD&amia »

hammax wrote: Tue Jan 15, 2019 5:10 pm … until now I didn't believe, that this would be possible.
But there is a way to form a complex hull out of gordon surface with a minimum of frames and stringers.
Maybe more frames could deliver a "smoother" or better controllable shape????


GlouHull.png
Dear Hammax,
Thank you for your post.
I'm trying to reproduce your Gordon surface by :
1) deleting the your Gordon surface
2) selecting the frame group
3) with Ctrl key selecting the Stringers group.
4) hitting the Gordon Icon
the function display Computing Gordon Surface.... for ages... at 33%, then nothing happen.
Thank you for your advices.
Post Reply