Question concerning the VTK file format

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Question concerning the VTK file format

Post by bernd »

ok here the Python code for exporting on windows ...

Code: Select all

doc = FreeCAD.open(FreeCAD.ConfigGet("AppHomePath") + 'data/examples/FemCalculixCantilever3D.FCStd')

doc.Box_Mesh.FemMesh.write("C:/Users/Public/mesh.vtk")

import Fem
Fem.writeResult( "C:/Users/Public/result_and_resultmesh.vtk", doc.CalculiX_static_results)


with the gui it works a follows ...

- open 3D FEM cantilever
- select the mesh object "Box_Mesh" --> export to "FEM mesh formats" --> mesh.vtk --> exports the mesh into a vtk mesh
- if you select the result_mesh and do the same than the result mesh will be exported only, no results
- select the result object "CalculiX_static_results" --> export to "FEM result VTK" --> result_and_resultmesh.vtk --> exports the result_mesh and the results into a vtk file

bernd
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Question concerning the VTK file format

Post by bernd »

issue #3628 is an issue for export vtk to vtk
thschrader
Veteran
Posts: 3129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Question concerning the VTK file format

Post by thschrader »

Ok, a little calculation.
Bernd/Uwe, can you tell me which part of the model tree I can export to vtk-format?
I still use the the frd-to-vtk-tool from user mamah.
https://forum.freecadweb.org/viewtopic. ... 4&start=10
vtk_export.JPG
vtk_export.JPG (56.57 KiB) Viewed 1486 times
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Question concerning the VTK file format

Post by bernd »

bernd wrote: Tue Mar 12, 2019 6:54 pm with the gui it works a follows ...

- open 3D FEM cantilever
- select the mesh object "Box_Mesh" --> export to "FEM mesh formats" --> mesh.vtk --> exports the mesh into a vtk mesh
- if you select the result_mesh and do the same than the result mesh will be exported only, no results
- select the result object "CalculiX_static_results" --> export to "FEM result VTK" --> result_and_resultmesh.vtk --> exports the result_mesh and the results into a vtk file
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Question concerning the VTK file format

Post by uwestoehr »

bernd wrote: Tue Mar 12, 2019 6:54 pm - select the result object "CalculiX_static_results" --> export to "FEM result VTK" --> result_and_resultmesh.vtk --> exports the result_mesh and the results into a vtk file
Here I see the problem that could be avoided:
- I selected "CalculiX_static_results" but did not choose "FEM result VTK" but "FEM mesh formats"

Yes, a result is no mesh, however in the export dialog these 2 entries are above each other so one can quickly make a mistake. The problem is that the user don't get any info. He exports but nothing will in fact be exported. No file will be written and he doesn't get info that nothing was output.
If possible, if the user selected a result object either the export to mesh option won't be available or he gets the info that the selection is not compatible with the selected object
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Question concerning the VTK file format

Post by Kunda1 »

Good point from usability standpoint.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Question concerning the VTK file format

Post by bernd »

uwestoehr wrote: Wed Mar 13, 2019 12:03 am Yes, a result is no mesh, however in the export dialog these 2 entries are above each other so one can quickly make a mistake. The problem is that the user don't get any info. He exports but nothing will in fact be exported. No file will be written and he doesn't get info that nothing was output.
If possible, if the user selected a result object either the export to mesh option won't be available or he gets the info that the selection is not compatible with the selected object
feel free to make an issue and assign it to me
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Question concerning the VTK file format

Post by uwestoehr »

bernd wrote: Thu Mar 14, 2019 10:15 pm feel free to make an issue and assign it to me
Done: issue #3906
Post Reply