Mesh FromPartShape: Difference between revisions

From FreeCAD Documentation
(more updates for FC 0.18)
Line 24: Line 24:


<!--T:8-->
<!--T:8-->
You can change these settings:
Surface deviation: If this number is smaller the mesh becomes finer. Smallest value is 0,001.
* {{MenuCommand|Surface deviation}}: Maximal surface deviation of the mesh from the object
* {{MenuCommand|Angular deviation}}: Maximal angular deviation of the mesh cells
* {{MenuCommand|Relative surface deviation}}: If checked, ??
* {{MenuCommand|Apply face colors to mesh}}: If checked, the mesh will get the face colors of the object
* {{MenuCommand|Define segments by face colors}}: If checked, ??


<!--T:14-->
<!--T:14-->
Line 33: Line 38:


<!--T:10-->
<!--T:10-->
Maximum edge length: If this number is smaller the mesh becomes finer. Smallest value is 0,000.
{{MenuCommand|Maximum edge length}}: If this number is smaller the mesh becomes finer. Smallest value is 0,000.


<!--T:15-->
<!--T:15-->

Revision as of 20:47, 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

You can change these settings:

  • Surface deviation: Maximal surface deviation of the mesh from the object
  • Angular deviation: Maximal angular deviation of the mesh cells
  • Relative surface deviation: If checked, ??
  • Apply face colors to mesh: If checked, the mesh will get the face colors of the object
  • Define segments by face colors: If checked, ??

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