Question concerning the VTK file format

About the development of the FEM module/workbench.

Moderator: bernd

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

Re: Question concerning the VTK file format

Postby bernd » Tue Mar 12, 2019 6:54 pm

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
Posts: 10806
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Question concerning the VTK file format

Postby bernd » Tue Mar 12, 2019 6:57 pm

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

Re: Question concerning the VTK file format

Postby thschrader » Tue Mar 12, 2019 9:11 pm

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 421 times
User avatar
bernd
Posts: 10806
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Question concerning the VTK file format

Postby bernd » Tue Mar 12, 2019 10:06 pm

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
Posts: 1792
Joined: Sun Jan 27, 2019 3:21 am

Re: Question concerning the VTK file format

Postby uwestoehr » Wed Mar 13, 2019 12:03 am

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
Posts: 8417
Joined: Thu Jan 05, 2017 9:03 pm

Re: Question concerning the VTK file format

Postby Kunda1 » Thu Mar 14, 2019 3:32 pm

Good point from usability standpoint.
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
bernd
Posts: 10806
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Question concerning the VTK file format

Postby bernd » Thu Mar 14, 2019 10:15 pm

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
Posts: 1792
Joined: Sun Jan 27, 2019 3:21 am

Re: Question concerning the VTK file format

Postby uwestoehr » Thu Mar 14, 2019 11:11 pm

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