Displacement factor under 1?

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
User avatar
pablogil
Posts: 882
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Displacement factor under 1?

Post by pablogil »

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

Re: Displacement factor under 1?

Post by bernd »

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

Re: Displacement factor under 1?

Post by bernd »

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

Re: Displacement factor under 1?

Post by bernd »

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 ...
Post Reply