FEM post processing pipeline with scalar value export .obj .stl

About the development of the FEM module/workbench.

Moderator: bernd

Figyi
Posts: 1
Joined: Wed May 08, 2019 11:54 pm

FEM post processing pipeline with scalar value export .obj .stl

Post by Figyi »

Hi There! Is possible the post-process scalarclip convert or export to stl, obj, or other mesh?

https://drive.google.com/file/d/1L93rn6 ... p=drivesdk

Best Regards!
chrisb
Veteran
Posts: 54177
Joined: Tue Mar 17, 2015 9:14 am

Re: FEM post processing pipeline with scalar value export .obj .stl

Post by chrisb »

Hi Figyi, welcome to the forum.
Isn't that the common non FEM export of objects to STL?

Besides, you should use a screenshot tool, they are readily available for all OSs. Those screenshot images are usually of perfect quality while being much smaller than an image of a modern camera or smartphone.
If you want to show 3D view only you even can use the FreeCAD builtin tool Menu->Tools->Save picture.
The images can be attached directly to the post, which makes it easier to read. It is appreciated if you crop the image to what you really want to show.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
UR_
Veteran
Posts: 1355
Joined: Tue Jan 03, 2017 8:42 pm

Re: FEM post processing pipeline with scalar value export .obj .stl

Post by UR_ »

Sorry, I think some workarounds are necessary to achieve this, :(
(because FreeCAD FEM has no surface filter and .stl is a surface only file format)

Workflow (cantilever 3D example from FreeCAD's start page)
- after calculation by ccx you get among others the result file: Box_Mesh.frd
- now this is converted to Box_Mesh-mmh.vtk using this utility: https://forum.freecadweb.org/viewtopic. ... 10#p184850
- now this vtk-file is loaded into Paraview and your clip filter is applied
- additionally a surface filter is needed to delete inner geometry

Annotation 2019-05-09 082859.png
Annotation 2019-05-09 082859.png (8.22 KiB) Viewed 1748 times

- saving as stl delivers desired file

canticlip.stl
(131.12 KiB) Downloaded 36 times
Annotation 2019-05-09 083607.png
Annotation 2019-05-09 083607.png (23.29 KiB) Viewed 1748 times
Annotation 2019-05-09 083929.png
Annotation 2019-05-09 083929.png (105.28 KiB) Viewed 1748 times
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: FEM post processing pipeline with scalar value export .obj .stl

Post by ickby »

That would be a nice addition to the freecad postprocessing pipeline, it should be pretty easy to implement.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: FEM post processing pipeline with scalar value export .obj .stl

Post by bernd »

ickby wrote: Thu May 09, 2019 7:29 am That would be a nice addition to the freecad postprocessing pipeline, it should be pretty easy to implement.
depends. If one knows C++ is should be pretty easy, but since ATM there is no access to the pipline data by Python this is possible in C++ only AFAIK.

It is like the export of a vtk pipeline to vtk. This needs to be implemented in C++ too.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: FEM post processing pipeline with scalar value export .obj .stl

Post by bernd »

UR_ wrote: Thu May 09, 2019 6:46 am - now this is converted to Box_Mesh-mmh.vtk using this utility: [url]https://forum.freecadweb.org/viewtopic. ... it=mmh.vtk&
This could be done from within FreeCAD too. AFAIK FreeCAD 0.19 exports all needed results to vtk, or do you miss some results if they are exported from FreeCAD to vtk.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: FEM post processing pipeline with scalar value export .obj .stl

Post by Kunda1 »

bernd wrote: Thu May 09, 2019 10:43 am
ickby wrote: Thu May 09, 2019 7:29 am That would be a nice addition to the freecad postprocessing pipeline, it should be pretty easy to implement.
depends. If one knows C++ is should be pretty easy, but since ATM there is no access to the pipline data by Python this is possible in C++ only AFAIK.

It is like the export of a vtk pipeline to vtk. This needs to be implemented in C++ too.
Shall we open a FR?
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
UR_
Veteran
Posts: 1355
Joined: Tue Jan 03, 2017 8:42 pm

Re: FEM post processing pipeline with scalar value export .obj .stl

Post by UR_ »

bernd wrote: Thu May 09, 2019 10:45 am ... AFAIK FreeCAD 0.19 exports all needed results to vtk...
:ok_hand:
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: FEM post processing pipeline with scalar value export .obj .stl

Post by ickby »

Shall we open a FR?
Actually I think the feature request should be to expose the vtk pipeline to python. I never did id as VTK was always build with Qt5 and FreeCAD with Qt4, hence "import vtk" crashed, but now it should work with qt5 build (it does with the windows installer of 0.18.1) and hence making it python extensible should be doable... and could enhance development of the post-processing significantly!
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: FEM post processing pipeline with scalar value export .obj .stl

Post by bernd »

ickby wrote: Thu May 09, 2019 11:36 am
Shall we open a FR?
Actually I think the feature request should be to expose the vtk pipeline to python. I never did id as VTK was always build with Qt5 and FreeCAD with Qt4, hence "import vtk" crashed, but now it should work with qt5 build (it does with the windows installer of 0.18.1) and hence making it python extensible should be doable... and could enhance development of the post-processing significantly!
+1

Just for my understanding. This would mean we gone use the python bindings of VTK and do not write our own ones like for SMESH.
Post Reply