Quad Mesh

Need help, or want to share a macro? Post here!
User avatar
microelly2
Posts: 4239
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Quad Mesh

Postby microelly2 » Mon Jan 30, 2017 8:26 am

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
looo
Posts: 2467
Joined: Mon Nov 11, 2013 5:29 pm

Re: Quad Mesh

Postby looo » Mon Jan 30, 2017 12:39 pm

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

Re: Quad Mesh

Postby microelly2 » Mon Jan 30, 2017 1:01 pm

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

Re: Quad Mesh

Postby HoWil » Mon Jan 30, 2017 8:31 pm

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
Posts: 4239
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Quad Mesh

Postby microelly2 » Mon Jan 30, 2017 9:55 pm

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
Posts: 7532
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Quad Mesh

Postby bernd » Tue Jan 31, 2017 7:08 am

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: 324
Joined: Thu Jul 24, 2014 8:29 am

Re: Quad Mesh

Postby fandaL » Tue Jan 31, 2017 12:29 pm

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
Posts: 7532
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Quad Mesh

Postby bernd » Tue Jan 31, 2017 4:45 pm

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