Gmsh extruded mesh from imported step file

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
Dnalor01
Posts: 5
Joined: Wed Aug 31, 2022 7:23 am

Gmsh extruded mesh from imported step file

Post by Dnalor01 »

Hi,
I am new in Freecad and, inspired from Tutorial "https://www.youtube.com/watch?v=vz5KZ4mNtB0" in which a pin geometry made with Freecad is then imported in Gmsh and an extruded mesh is done, I try to make an extruded mesh in a Freecad simplified part like in this Tutorial.
Here attached is the "simple_Pin_Freecad.zip" project. It contains the Freecad model which is a circle in the YZ plane (Sketch001) which is swept along a path (Sketch in the XY plane) made of a straight line and a half-circle (see Freecad_model.JPG).
The whole Body is then exported as a step file in Gmsh where I would like to make an extruded mesh, as explained in the Tutorial (the .geo Gmsh file is also included in the here attached Freecad project).
Unfortunately the mesh is only extruded in the straight line but not in the curved half-circle line (see Gmsh_model.JPG).
It would be very kind if somebody could give me some help elements in order to fix this problem so to get a whole extruded mesh.
Thanks in advance
Roland
Attachments
Gmsh_model.JPG
Gmsh_model.JPG (177.6 KiB) Viewed 1623 times
Freecad_model.JPG
Freecad_model.JPG (296.98 KiB) Viewed 1623 times
simple_Pin_Freecad.zip
(23.16 KiB) Downloaded 26 times
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: Gmsh extruded mesh from imported step file

Post by chrisb »

Moved from Help forum.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
NewJoker
Veteran
Posts: 3014
Joined: Sun Oct 11, 2020 7:49 pm

Re: Gmsh extruded mesh from imported step file

Post by NewJoker »

You may have to change the input values since your geometry has a different size than the one in the tutorial. Adjust not only the parameters in the .geo file but also the settings in Tools --> Options --> Mesh. Make sure that "Recombine all triangular meshes" is checked to avoid generating tetrahedrons.

You can also ask this question in the issues section of the Gmsh GitLab repository. Just be ready for a cold welcome there.
Dnalor01
Posts: 5
Joined: Wed Aug 31, 2022 7:23 am

Re: Gmsh extruded mesh from imported step file

Post by Dnalor01 »

Hi, thank you for your answer.
First what do you mean by "you have to change the input values" ? Indeed I gave other dimensions than in the tutorial and made a simplified geometry just for the test ok?
Secondly in the Freecad view (see the "Freecad_model.JPG" screen copy) the message "Recompute failed! Please check report view" appears in the report view.
Could this perhaps make that, after importing in Gmsh, the extruded mesh fails?
Thanks to give me your opinion about this, since this seems so easy in the tutorial and I don't understand why this does not work in my simple example...
Thanks in advance for your help and we keep us informed.
Roland
User avatar
NewJoker
Veteran
Posts: 3014
Joined: Sun Oct 11, 2020 7:49 pm

Re: Gmsh extruded mesh from imported step file

Post by NewJoker »

Dnalor01 wrote: Wed Aug 31, 2022 5:11 pm First what do you mean by "you have to change the input values" ? Indeed I gave other dimensions than in the tutorial and made a simplified geometry just for the test ok?
It seems that you used the same values for Gmsh operations as the ones used in the tutorial. Since your geometry is different, the values should be adjusted for it. Not necessarily those related to the number of elements in a particular direction but rather those associated with element size.

Dnalor01 wrote: Wed Aug 31, 2022 5:11 pm Secondly in the Freecad view (see the "Freecad_model.JPG" screen copy) the message "Recompute failed! Please check report view" appears in the report view.
I don't see any issue like that when I open your .FCStd file. The additive pipe feature is built correctly.
Dnalor01
Posts: 5
Joined: Wed Aug 31, 2022 7:23 am

Re: Gmsh extruded mesh from imported step file

Post by Dnalor01 »

Thank you, I will see that and keep you informed for the values to enter.
Concerning the "recompute failed" message it appears when applying the sweep command on Freecad. I don't know if it can be accepted or not when then exporting to Gmsh. What do you think about that?
Thanks in advance
Dnalor01
Posts: 5
Joined: Wed Aug 31, 2022 7:23 am

Re: Gmsh extruded mesh from imported step file

Post by Dnalor01 »

Hi,
In addition to my former post, here attached is again the simple_pin Freecad project and also a screen capture when trying to make a sweeping of the circle Sketch001 along the path Sketch.
As you can see the sweeping works only for the straight line( Edge 1) of Sketch but not for the curved half-circle (Edge 2) and the report view shows the error message "Recompute failed".
It would be very kind if you could take a look at this and help me to fix this problem.
Thanks in advance

My Freecad version:

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.29177 (Git)
Build type: Release
Branch: releases/FreeCAD-0-20
Hash: 68e337670e227889217652ddac593c93b5e8dc94
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.2
Locale: French/France (fr_FR)
Attachments
Simple_Pin.PNG
Simple_Pin.PNG (287.17 KiB) Viewed 1419 times
simple_pin_freecad.FCStd
(9.68 KiB) Downloaded 19 times
User avatar
NewJoker
Veteran
Posts: 3014
Joined: Sun Oct 11, 2020 7:49 pm

Re: Gmsh extruded mesh from imported step file

Post by NewJoker »

It seems to be caused by incorrect constraints in the sketch that represents the path. Instead of applying block constraint, use standard approach with coincident, tangent and dimension constraints (maybe also other types).
Dnalor01
Posts: 5
Joined: Wed Aug 31, 2022 7:23 am

Re: Gmsh extruded mesh from imported step file

Post by Dnalor01 »

Hi, as you suggested it I remade the sketch001 path with standart coincident, tangent and dimensions constraints in Freecad, but unfortunetely it still failed when trying to make an extruded mesh in Gmsh.
It would be very kind of you if you could try on your side to make this extruded mesh in Gmsh from the Freecad exported "simple_pin_freecad-Body.step" file which is here attached with alsos the Freecad project file.
Many thanks in advance for your help and efforts and wee keep us informed.
Attachments
simple_pin_freecad-Body.step
(8.92 KiB) Downloaded 20 times
simple_pin_freecad.FCStd
(11.04 KiB) Downloaded 19 times
Post Reply