Mesh FromPartShape: Difference between revisions

From FreeCAD Documentation
(Marked this version for translation)
(update for FC 0.18)
Line 16: Line 16:
<br />
<br />
Just selecting {{KEY| Meshes}} → {{KEY|[[Image:Mesh_Mesh_from_Shape.svg|32px]] Create Mesh from shape...}} will give you an additional menu to choose your shape to mesh
Just selecting {{KEY| Meshes}} → {{KEY|[[Image:Mesh_Mesh_from_Shape.svg|32px]] Create Mesh from shape...}} will give you an additional menu to choose your shape to mesh



<!--T:13-->
<!--T:13-->
'''Standard Mesher'''
===Standard Mesher===


<!--T:7-->
<!--T:7-->
Line 26: Line 25:
<!--T:8-->
<!--T:8-->
Surface deviation: If this number is smaller the mesh becomes finer. Smallest value is 0,001.
Surface deviation: If this number is smaller the mesh becomes finer. Smallest value is 0,001.



<!--T:14-->
<!--T:14-->
'''Mefisto Mesher'''
===Mefisto Mesher===


<!--T:9-->
<!--T:9-->
Line 36: Line 34:
<!--T:10-->
<!--T:10-->
Maximum edge length: If this number is smaller the mesh becomes finer. Smallest value is 0,000.
Maximum edge length: If this number is smaller the mesh becomes finer. Smallest value is 0,000.



<!--T:15-->
<!--T:15-->
'''Netgen Mesher'''
===Netgen Mesher===


<!--T:11-->
<!--T:11-->
Line 46: Line 43:
<!--T:12-->
<!--T:12-->
You can choose between mesh being:
You can choose between mesh being:
*Very coarse
*{{MenuCommand|Very coarse}}
*Coarse
*{{MenuCommand|Coarse}}
*Moderate
*{{MenuCommand|Moderate}}
*Fine
*{{MenuCommand|Fine}}
*Very fine
*{{MenuCommand|Very fine}}
*{{MenuCommand|User defined}}<br />For Mesh being "user defined" you can set these values:<br />{{MenuCommand|Mesh size grading}} : If this parameter is smaller, mesh becomes finer. A value in the range of 0.1-1.<br />{{MenuCommand|Element per edge}} : If this parameter is larger, mesh becomes finer. A value in the range of 0.2-10.<br />{{MenuCommand|Element per curvature radius}} : If this parameter is larger, mesh becomes finer. A value in the range of 0.2-10.
*User defined

<br />
For Mesh being "user defined" you can set these values:
**Mesh size grading : If this parameter is smaller, mesh becomes finer. A value in the range of 0.1-10.
**Element per edge : If this parameter is larger, mesh becomes finer. A value in the range of 0.1-10.
**Element per curvature radius : If this parameter is larger, mesh becomes finer. A value in the range of 0.1-10.
<br />
For every main option you can also choose:
For every main option you can also choose:
*Optimize surface : Whether optimization of surface shape will be done.
*{{MenuCommand|Optimize surface}} : Whether optimization of surface shape will be done.
*Second order elements:Whether second order elments will be generated.
*{{MenuCommand|Second order elements}} Whether second order elments will be generated.
*Quad dominant:Whether meshes will be arranged like hexahedral.
*{{MenuCommand|Quad dominant}} Whether meshes will be arranged like hexahedral.


== Scripting == <!--T:5-->
== Scripting == <!--T:5-->

Revision as of 20:34, 10 March 2019

Mesh MeshFromShape‏‎

Menu location
Meshes → Create Mesh from Shape
Workbenches
Mesh
Default shortcut
None
Introduced in version
-
See also
None

Introduction

This command creates a mesh from a shape object.

Use

  1. Select the shape object.
  2. Choose Meshes Create Mesh from shape... from the top menu.
  3. A menu will ask for the mesher to use and the appropriate values for the mesher


Just selecting Meshes Create Mesh from shape... will give you an additional menu to choose your shape to mesh

Standard Mesher

Surface deviation: If this number is smaller the mesh becomes finer. Smallest value is 0,001.

Mefisto Mesher

Maximum edge length: If this number is smaller the mesh becomes finer. Smallest value is 0,000.

Netgen Mesher

You can choose between mesh being:

  • Very coarse
  • Coarse
  • Moderate
  • Fine
  • Very fine
  • User defined
    For Mesh being "user defined" you can set these values:
    Mesh size grading : If this parameter is smaller, mesh becomes finer. A value in the range of 0.1-1.
    Element per edge : If this parameter is larger, mesh becomes finer. A value in the range of 0.2-10.
    Element per curvature radius : If this parameter is larger, mesh becomes finer. A value in the range of 0.2-10.

For every main option you can also choose:

  • Optimize surface : Whether optimization of surface shape will be done.
  • Second order elements Whether second order elments will be generated.
  • Quad dominant Whether meshes will be arranged like hexahedral.

Scripting

This tool can be used in macros and from the Python console by using the following function:

MeshPart.meshFromShape(Shape=Shape, MaxLength=520)

Example:

import FreeCAD, Draft, Arch, Mesh, MeshPart

Line = Draft.makeWire([FreeCAD.Vector(0, 0, 0),FreeCAD.Vector(2000, 2000, 0)])
Wall = Arch.makeWall(Line, width=150, height=3000)
FreeCAD.ActiveDocument.recompute()

Shape = Wall.Shape.copy(False)
Shape.Placement = Wall.getGlobalPlacement()

mesh_obj = FreeCAD.ActiveDocument.addObject("Mesh::Feature", "Mesh")
mesh_obj.Mesh = MeshPart.meshFromShape(Shape=Shape, MaxLength=520)
mesh_obj.ViewObject.DisplayMode = "Flat Lines"

Notes