FEM FemMesh2Mesh: Difference between revisions
(formatting fixes) |
(Docnav) |
||
(11 intermediate revisions by 3 users not shown) | |||
Line 4: | Line 4: | ||
<!--T:9--> |
<!--T:9--> |
||
{{Docnav |
{{Docnav |
||
|[[FEM_MeshGroup|FEM mesh group]] |
|||
|[[FEM_CreateNodesSet|Nodes set]] |
|||
|[[FEM_SolverCalculixCxxtools|Solver CalculiX Standard]] |
|[[FEM_SolverCalculixCxxtools|Solver CalculiX Standard]] |
||
|[[FEM_Workbench|FEM]] |
|[[FEM_Workbench|FEM]] |
||
|IconL= |
|IconL=FEM_MeshGroup.svg |
||
|IconR=FEM_SolverCalculixCxxtools.svg |
|IconR=FEM_SolverCalculixCxxtools.svg |
||
|IconC=Workbench_FEM.svg |
|IconC=Workbench_FEM.svg |
||
Line 23: | Line 23: | ||
<!--T:7--> |
<!--T:7--> |
||
This tool converts surfaces of 3D elements of a selected FEM mesh to mesh |
This tool converts surfaces of 3D elements of a selected FEM mesh to mesh or converts 2D FEM mesh to mesh. Internally, it picks FEM mesh element faces that are unique (not shared by two elements) and uses them to create faces of a mesh. Optionally, it can be used to save a deformed mesh. This is done by adding the displacement of the FEM results to the mesh nodes (the scale of the displacement can be set using Python). |
||
==Usage== <!--T:4--> |
==Usage== <!--T:4--> |
||
Line 36: | Line 36: | ||
== Scripting == <!--T:13--> |
== Scripting == <!--T:13--> |
||
<!--T:15--> |
|||
'''Note''': The parameter ''scale'' was {{Version| |
'''Note''': The parameter ''scale'' was {{Version|0.21}}. For older versions of FreeCAD omit it from your code. |
||
<!--T:17--> |
|||
When you just require the displacement scale factor, check your mesh object name and the scale factor in the following code: |
|||
⚫ | |||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
⚫ | |||
⚫ | |||
import FreeCAD as App |
|||
mesh_obj = FEMMeshGmsh # the name of your mesh object |
|||
scale = 5 # displacement scale factor |
|||
out_mesh = femmesh.femmesh2mesh.femmesh_2_mesh(FreeCAD.ActiveDocument.mesh_obj.FemMesh, FreeCAD.ActiveDocument.CCX_Results, scale) |
|||
import Mesh |
import Mesh |
||
⚫ | |||
Mesh.show(Mesh.Mesh(out_mesh)) |
|||
}} |
|||
<translate> |
|||
⚫ | |||
⚫ | |||
⚫ | |||
fem_mesh = doc.Box_Mesh.FemMesh |
|||
</translate> |
|||
⚫ | |||
{{Code|code= |
|||
⚫ | |||
⚫ | |||
⚫ | |||
fem_mesh = fc_file.getObject("Box_Mesh").FemMesh # do not remove the _ |
|||
⚫ | |||
scale = 1 # displacement scale factor |
scale = 1 # displacement scale factor |
||
from femmesh import femmesh2mesh |
|||
out_mesh = femmesh2mesh.femmesh_2_mesh(fem_mesh, result, scale) |
out_mesh = femmesh2mesh.femmesh_2_mesh(fem_mesh, result, scale) |
||
import Mesh |
|||
Mesh.show(Mesh.Mesh(out_mesh)) |
Mesh.show(Mesh.Mesh(out_mesh)) |
||
}} |
}} |
||
Line 71: | Line 62: | ||
<!--T:10--> |
<!--T:10--> |
||
{{Docnav |
{{Docnav |
||
|[[FEM_MeshGroup|FEM mesh group]] |
|||
|[[FEM_CreateNodesSet|Nodes set]] |
|||
|[[FEM_SolverCalculixCxxtools|Solver CalculiX Standard]] |
|[[FEM_SolverCalculixCxxtools|Solver CalculiX Standard]] |
||
|[[FEM_Workbench|FEM]] |
|[[FEM_Workbench|FEM]] |
||
|IconL= |
|IconL=FEM_MeshGroup.svg |
||
|IconR=FEM_SolverCalculixCxxtools.svg |
|IconR=FEM_SolverCalculixCxxtools.svg |
||
|IconC=Workbench_FEM.svg |
|IconC=Workbench_FEM.svg |
Latest revision as of 10:12, 2 March 2024
FEM FemMesh2Mesh |
Menu location |
---|
Mesh → FEM mesh to mesh |
Workbenches |
FEM |
Default shortcut |
None |
Introduced in version |
- |
See also |
FEM tutorial |
Description
This tool converts surfaces of 3D elements of a selected FEM mesh to mesh or converts 2D FEM mesh to mesh. Internally, it picks FEM mesh element faces that are unique (not shared by two elements) and uses them to create faces of a mesh. Optionally, it can be used to save a deformed mesh. This is done by adding the displacement of the FEM results to the mesh nodes (the scale of the displacement can be set using Python).
Usage
- Select a FEM mesh object.
- Optionally also select the FEM results.
- There are several ways to invoke the command:
- Press the FEM mesh to mesh button.
- Select the Mesh → FEM mesh to mesh option from the menu.
Scripting
Note: The parameter scale was introduced in version 0.21. For older versions of FreeCAD omit it from your code.
The cantilever example:
from os.path import join
import FreeCAD as App
import Mesh
from femmesh import femmesh2mesh
path = join(App.getResourceDir(), "examples", "FemCalculixCantilever3D.FCStd")
doc = App.openDocument(path)
fem_mesh = doc.Box_Mesh.FemMesh
result = doc.CCX_Results
scale = 1 # displacement scale factor
out_mesh = femmesh2mesh.femmesh_2_mesh(fem_mesh, result, scale)
Mesh.show(Mesh.Mesh(out_mesh))
FEM
- Materials: Solid, Fluid, Nonlinear mechanical, Reinforced (concrete); Material editor
- Element geometry: Beam (1D), Beam rotation (1D), Shell (2D), Fluid flow (1D)
Constraints
- Electromagnetic: Electrostatic potential, Current density, Magnetization
- Geometrical: Plane rotation, Section print, Transform
- Mechanical: Fixed, Displacement, Contact, Tie, Spring, Force, Pressure, Centrif, Self weight
- Thermal: Initial temperature, Heat flux, Temperature, Body heat source
- Overwrite Constants: Constant vacuum permittivity
- Solve: CalculiX Standard, Elmer, Mystran, Z88; Equations: Deformation, Elasticity, Electrostatic, Electricforce, Magnetodynamic, Magnetodynamic 2D, Flow, Flux, Heat; Solver: Solver control, Solver run
- Results: Purge, Show; Postprocessing: Apply changes, Pipeline from result, Warp filter, Scalar clip filter, Function cut filter, Region clip filter, Contours filter, Line clip filter, Stress linearization plot, Data at point clip filter, Filter function plane, Filter function sphere, Filter function cylinder, Filter function box
- Additional: Preferences; FEM Install, FEM Mesh, FEM Solver, FEM CalculiX, FEM Concrete; FEM Element Types
User documentation
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Start, Surface, TechDraw, Test Framework, Web
- Hubs: User hub, Power users hub, Developer hub