↑top

FreeCAD: How to create meshes from a solid?

Update: May 22, 2021
FreeCAD 0.19
  1. Create new documentNew Document icon and create a shape to be meshed.

    Fig. Creates a shape
    Creates a shape
  2. Switch workbench to Mesh Design wrokbenchMeshDesign Workbench.

  3. Select the shape in model tree and run "Mesh from shape"Mesh from shape icon to show a dialog box as following. Then select the mesher in the tabs of the dialog box and set each parameter.

    Fig. Dialog box for Tessellation
    Dialog box for Tessellation

    Mesher that can be used are "Standard", "Mefisto", "Netgen" and "gmsh". Meshes to be created and the parameters of each mesher are as follow.

    • Standard

      ParameterBehavior
      Surface deviationIf this parameter is smaller, meshes becomes finer.
      Angular deviationIf this parameter is smaller, meshes becomes finer.
      Relative surface deviationCreate meshes depending on edge length.
      Apply face colors to meshSet shape color to the mesh.
      Define segments by face colorSet segments to meshes depending on shape colors.
      MeshingStandard1
      Surface deviation=0.1
      MeshingStandard2
      Surface deviation=0.01
    • Mefisto

      ParameterBehavior
      Maximum Edge lengthMaximum edge length. If this parameter is smaller, meshes becomes finer.
      MeshingMefisto1
      Maximum Edge length=10.0
      MeshingMefisto2
      Maximum Edge length=5.0
      MeshingMefisto3
      Maximum Edge length=2.0
    • Netgen

      ParameterBehavior
      FinenessDegree of mesh fineness. If you want to customize parameters, select "User defined".
      Mesh size gradingIf this parameter is smaller, meshes becomes finer. A value in the range of 0.1-1.
      Element per edgeIf this parameter is larger, meshes becomes finer. A value in the range of 0.1-1.
      Element per curvature radiusIf this parameter is larger, meshes becomes finer. A value in the range of 0.2-10.
      Optimize surfaceWhether optimization of surface shape will be done.
      Second order elementsWhether second order elments will be generated.
      Quad dominantWhether meshes will be arranged like hexahedral.
      MeshingNetgen1
      Mesh size grading=0.3
      Element per edge=1.0
      Element per curvature radius=2.0
      MeshingNetgen2
      Mesh size grading=0.1
      Element per edge=3.0
      Element per curvature radius=5.0
      MeshingNetgen3
      Mesh size grading=0.3
      Element per edge=5.0
      Element per curvature radius=10.0
      MeshingNetgen4
      Enable second order elements
      MeshingNetgen5
      Enable quad dominant
    • Gmsh

      For gmsh mesher, you should specify the Gmsh executable to be used at first.

      Set the [Path] of the dialog box to the executable file in the FreeCAD installation folder (for example, "C:¥Program Files¥FreeCAD 0.19¥bin¥gmsh.exe" by default on Windows) or the executable file downloaded from the Gmsh download site.

      Fig. Gmsh path setting
      Gmsh path setting
      ParameterBehavior
      MeshingMeshing method (Adaptive, Delaunay, etc.).
      Max element sizeMaximum mesh size. The smaller the size, the finer the mesh. Automatically set to 0.
      Min element sizeMinimum mesh size. The smaller the size, the finer the mesh. Automatically set to 0.
      AngleThe angle threshold used to divide surfaces.
      MeshingGmsh1
      Meshing=Automatic
      Max element size=0 (=Auto)
      MeshingGmsh2
      Meshing=Automatic
      Max element size=5 mm
  4. Set paramters in the dialog box and click OK to create mesh.

  5. Select the meshed solid on model tree and type space key to hide it. Then select [View]-[Draw style]-[Wireframe] in menu bar to set 3D view wireframe display mode. Now you can see the generated mesh clearly.

    Fig. Wireframe display mode
    Wireframe display mode
  6. If the mesh has no problem, select it in the model tree and export it with "Export mesh"Export mesh icon.

    Fig. Dialog box for mesh exporting
    Dialog box for mesh exporting

    Following formats can be used for exporting.

    • Binary STL (*.stl)
    • ASCII STL (*.stl)
    • ASCII STL (*.ast)
    • Binary Mesh (*.bms)
    • Alias Mesh (*.obj)
    • Simple Model Format (*.smf)
    • Object File Format (*.off)
    • Inventor V2.1 ascii (*.iv)
    • X3D Extensible 3D (*.x3d)
    • Compressed X3D (*.x3dz)
    • WebGL/X3D (*.xhtml)
    • Stanford Polygon (*.ply)
    • VRML V2.0 (*.wrl *.vrml)
    • Compressed VRML V2.0 (*.wrz)
    • Nastran (*.nas *.bdf)
    • Python module file (*.py)
    • Asymptote Format (*.asy)

References