An example of Gordon Surface based upon OCC
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
Re: An example of Gordon Surface based upon OCC
oh, you're right, the gordon make it. thanks
- Attachments
-
- Capture.PNG (63.91 KiB) Viewed 2987 times
-
- Posts: 54
- Joined: Tue Jan 08, 2019 9:04 pm
Re: An example of Gordon Surface based upon OCC
I have been looking for something just like this. Thank you so much for your work! Just a few notes:
- 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.
- 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.
- 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?
Re: An example of Gordon Surface based upon OCC
Hi,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.
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.
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.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.
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.
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 :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?
- 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
-
- Posts: 54
- Joined: Tue Jan 08, 2019 9:04 pm
Re: An example of Gordon Surface based upon OCC
No problem, that's what I figured. Anyway, this seems to be the only compatibility issue.
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 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 take a look through there when I get a chance.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)
I'm sure you are too humble.
Re: An example of Gordon Surface based upon OCC
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?
The green group doesn't touch themselves. Every red curve touches the greens.
Any idea?
What about told 3D do actually?
- Attachments
-
- Capture.PNG (21.42 KiB) Viewed 2799 times
Re: An example of Gordon Surface based upon OCC
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.
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.
Re: An example of Gordon Surface based upon OCC
… 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????
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????
- Attachments
-
- GlouHull.FCStd
- FC.18.15639
- (340.26 KiB) Downloaded 141 times
Re: An example of Gordon Surface based upon OCC
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 replymicroelly2 wrote: ↑Fri Jul 13, 2018 7:38 amI had to model the circle and the ellipse as beziers,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
here are the sketches and curves
bp_829.png
and here the surface
bp_830.png
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: An example of Gordon Surface based upon OCC
Have a look at the nurbs workbench. Threre are some classes where I implement sketcher python objects.LLuoss wrote: ↑Thu Aug 29, 2019 9:29 amHi,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 replymicroelly2 wrote: ↑Fri Jul 13, 2018 7:38 amI had to model the circle and the ellipse as beziers,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
here are the sketches and curves
bp_829.png
and here the surface
bp_830.png
Re: An example of Gordon Surface based upon OCC
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.