Displacement factor under 1?

About the development of the FEM module/workbench.

Moderator: bernd

pablogil
Posts: 733
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Displacement factor under 1?

Postby pablogil » Wed Nov 09, 2016 9:28 am

Hi,

I find sometimes that the Displacement minimum factor under "Results" task dialog, which is just 1, is too much to graphically show a small displacement... would it be possible to adjust the factor as, for instance, something like 0,001?

Thank you
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
User avatar
bernd
Posts: 8043
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Displacement factor under 1?

Postby bernd » Wed Nov 09, 2016 1:59 pm

pablogil wrote:I find sometimes that the Displacement minimum factor under "Results" task dialog, which is just 1, is too much to graphically show a small displacement... would it be possible to adjust the factor as, for instance, something like 0,001?
By python easily …

- start FreeCAD
- Load Start WB
- Load 3D FEM example
- Activate analysis and run analysis
- run the following python code

Code: Select all

mesh_obj = App.ActiveDocument.getObject("Box_Mesh")
result_obj =  App.ActiveDocument.getObject("CalculiX_static_results")

mesh_obj.ViewObject.setNodeDisplacementByVectors(result_obj.NodeNumbers, result_obj.DisplacementVectors)
mesh_obj.ViewObject.applyDisplacement(0.1)

by GUI, not at the moment ... I may have a look at this.
User avatar
bernd
Posts: 8043
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Displacement factor under 1?

Postby bernd » Tue May 30, 2017 9:37 pm

more result scripting ...

Code: Select all

# set stress color
mesh_obj = App.ActiveDocument.getObject("Box_Mesh")
result_obj = App.ActiveDocument.getObject("CalculiX_static_results")
mesh_obj.ViewObject.setNodeColorByScalars(result_obj.NodeNumbers, result_obj.StressValues)

Code: Select all

# reset stress color
mesh_obj.ViewObject.NodeColor = {}
mesh_obj.ViewObject.ElementColor = {}
mesh_obj.ViewObject.setNodeColorByScalars()
User avatar
bernd
Posts: 8043
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Displacement factor under 1?

Postby bernd » Fri Dec 14, 2018 6:43 am

small hint for the result scripting above ... use the result mesh not the analysis mesh. I may add the result scripting code to the wiki ...