Quad Mesh

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Quad Mesh

Post by microelly2 »

At the moment I see only a small number of methods in the mesh wb,
I need more power to handle large data sets without render functionality.

Are there already fast methods available in FreeCAD from Python to create quad meshes from triangulated meshes?

what of the methods described in
Quad-Mesh Generation and Processing: a survey
David Bommes 1, Bruno Lévy 2, Nico Pietroni 3, Enrico Puppo 4, Claudio Silva 5;7, Marco Tarini 6, Denis Zorin 7

are ready to use in the current FreeCAD?

thanks for some tipps that can show me the direction to go.

EDIT: Example from maya
Image
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Quad Mesh

Post by looo »

gmsh has implemented some algorithms: http://gmsh.info/doc/preprints/gmsh_quad_preprint.pdf
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Quad Mesh

Post by microelly2 »

looo wrote:gmsh has implemented some algorithms: http://gmsh.info/doc/preprints/gmsh_quad_preprint.pdf
thank you for that link.
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Quad Mesh

Post by HoWil »

Hi Microelly2,

Are you "only" interested in 2D-meshing or could this be extended to 3D?

If so maybe you could contribute your work to FEM-wb.

BR,
HoWil
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Quad Mesh

Post by microelly2 »

HoWil wrote:Hi Microelly2,

Are you "only" interested in 2D-meshing or could this be extended to 3D?
If so maybe you could contribute your work to FEM-wb.

BR,
HoWil
I look for a way to get CAD model from non CAD data sources: 2D Images and 3D scanned point clouds. So nurbs, quadmeshes, Voronoi, Delaunay, voxels are on my way. I think there will be useful ideas for 3D segmentations too. At the moment I do a lot of performance tests on large datasets to see how to handle them inside FreeCAD in short time.

My solution of quad mehs for today is a scipy Rbf Interolation. Meantime I get good results for linear, cubic and thin plate interpolation.
https://www.youtube.com/watch?v=6ly86bF0sUc
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Quad Mesh

Post by bernd »

microelly2 wrote:
looo wrote:gmsh has implemented some algorithms: http://gmsh.info/doc/preprints/gmsh_quad_preprint.pdf
thank you for that link.
+1 I have been trying to make quad and hexa meshes with GMSH many times but failed ...

@microelly2:
FreeCAD 0.17 FEM has a GMSH mesh object and the mesh algorithm can be adjusted. New parameter could be added easily. But as I wrote I failed to make a hexa mesh.
fandaL
Posts: 440
Joined: Thu Jul 24, 2014 8:29 am

Re: Quad Mesh

Post by fandaL »

EDIT: Example from maya
hmmm, attractive topic...
bernd wrote:
microelly2 wrote:
looo wrote:gmsh has implemented some algorithms: http://gmsh.info/doc/preprints/gmsh_quad_preprint.pdf
thank you for that link.
+1 I have been trying to make quad and hexa meshes with GMSH many times but failed ...

@microelly2:
FreeCAD 0.17 FEM has a GMSH mesh object and the mesh algorithm can be adjusted. New parameter could be added easily. But as I wrote I failed to make a hexa mesh.
Did you failed to create any quad mesh?
Surprisingly it is not (only) about setting meshing algorithm but it seems that quads are created from triangles by option "Recombine all triangular meshes" which you find in gmsh at Tools/Options/Mesh/General. If you trigger this option, gmsh generates quads. Try also to change "Blossom" to "Standard" which influences quads.

The parameters are mentioned in 11th example http://gmsh.info/doc/texinfo/#t11_002egeo as

Code: Select all

// To generate quadrangles instead of triangles, we can simply add
Recombine Surface{100};
I tried to add this into (nowadays yet) old GMSH macro "Custom gmsh options" line but without any influence.

There is also
// If we'd had several surfaces, we could have used 'Recombine Surface "*";'.
// Yet another way would be to specify the global option "Mesh.RecombineAll =
// 1;".
I have not much clue how exactly GMSH interacts with FreeCAD, but global option is yet coded in FemGmshTools.py
https://github.com/FreeCAD/FreeCAD/blob ... #L358-L361
After ommiting if condition (only to test if it does something)

Code: Select all

#if hasattr(self.mesh_obj, 'RecombineAll') and self.mesh_obj.RecombineAll is True:
geo.write("//recombine\n")
geo.write("Mesh.RecombineAll = 1;\n")
geo.write("\n") 
FreeCAD generates quad meshes on surfaces ;) except that makes mess on volumes...
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Quad Mesh

Post by bernd »

Quad surface meshes could be made with FreeCAD FEM GMSH mesh. Just activate the recombine in Property editor change to 2D mesh.
fandaL wrote:FreeCAD generates quad meshes on surfaces ;) except that makes mess on volumes...
Thats exact the problem. I have not been able to make a valid hex mesh
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Quad Mesh

Post by bernd »

tried this again ...

- set "Recombine All" to True
- set "Recombination Allgorithm" to Blossum full-quad"

Works gread for first order meshes. Quad4 faces are meshed by Gmsh. But it fails for second order meshes. The quadratic edges will be meshed but the faces are linear. The file is attached. Use print mesh info. The quad8 mesh test has 25 nodes.

Anyone an idea how to get the quad8 faces?

quad_tests.FCStd
(10.02 KiB) Downloaded 100 times

screen.png
screen.png (78.8 KiB) Viewed 4085 times

screen1.png
screen1.png (125.76 KiB) Viewed 4075 times
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Quad Mesh

Post by bernd »

works gret with holes too ... for quad4 ...

quad_tests_with_holes.FCStd
(36.51 KiB) Downloaded 98 times

screen.png
screen.png (133.9 KiB) Viewed 4086 times

screen1.png
screen1.png (154.77 KiB) Viewed 4082 times
Post Reply