FreeCAD / FreeCAD

This is the official source code of FreeCAD, a free and opensource multiplatform 3D parametric modeler.
https://www.freecad.org
Other
21.31k stars 4.15k forks source link

[Feature Request] Displacement magnitude activated by default in the default results pipeline in FEM #9477

Open FEA-eng opened 1 year ago

FEA-eng commented 1 year ago

Is there an existing request for this?

Forums discussion

https://forum.freecad.org/viewtopic.php?t=77149

Subproject(s) affected?

FEM

Idea description

With the new improvements introduced by @donovaly, the results pipeline is automatically created after running an analysis which is great. However, what is shown is a confusing legend with no color map displayed on the model. Thus, I would suggest making the following small change - setting Field in that automatically created results pipeline settings to Displacement (Vector: Magnitude) or Displacement Magnitude (that's what that sole legend shows) instead of None by default. This way the user would see the results right after solving an analysis which is much less confusing than what is currently displayed.

Anything else?

No response

Code of Conduct

FEA-eng commented 1 year ago

Would it be sufficient to add obj.ViewObject.Field = 'Displacement Magnitude' after obj.ViewObject.DisplayMode = "Surface" in ObjectsFem.py ? I can't build FreeCAD from source so I don't know if it's enough. It would be great to have this improvement in 0.21.

luzpaz commented 1 year ago

@FEA-eng have you tested it ? You can edit the FEM python code realtime and test

FEA-eng commented 1 year ago

@luzpaz Do you mean adding it to the source code in Visual Studio and running some bug checks? The problem is that I'm unable to compile FreeCAD from the source code (original or modified) because of a ton of errors and I don't have enough experience and time to fix them. But if there's another way to test whether this change works then I will be glad to give it a try.

luzpaz commented 1 year ago

@FEA-eng if you're on Linux and the code you want to test is in python:

  1. Download the FreeCAD dev build AppImage (https://github.com/FreeCAD/FreeCAD-Bundle/releases/tag/weekly-builds)
  2. Unpack it (https://wiki.freecad.org/AppImage#Unpacking_AppImages)
  3. Find the specific python file
  4. Modify the file, and test the changes by triggering the expanded AppImage (https://wiki.freecad.org/AppImage#Modifying_AppImages)
FEA-eng commented 1 year ago

@luzpaz Unfortunately, I only have Windows. I guess that there's no such procedure for that OS, right?

luzpaz commented 1 year ago

Maybe @donovaly knows?

FEA-eng commented 1 year ago

@luzpaz I prepared a virtual Ubuntu machine and tested this small change based on your instruction. It works as expected so I made a PR: https://github.com/FreeCAD/FreeCAD/pull/10569

luzpaz commented 1 year ago

Nice work! JFYI, https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue

FEA-eng commented 1 year ago

Nice work! JFYI, https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue

Thanks. I guess that they should add "solves" to this list. I changed it to "resolves" ;-)

Now I hope that someone will merge this. It shows some failed checks but I guess that it's not a fault of the code change. I added just a single line of code, after all. And tested that it works.

Should I keep updating the branch?

maxwxyz commented 1 year ago

Is it possible to hide the automatically created Result Pipelines? When multiple results are expected (e.g. Eigenmodes, multiple timesteps) 10+ Pipeline results are created and activated by default. I now have to manually select each pipeline in the tree and hide it. Also, when I delete a pipeline before hiding it, the pipeline is gone but visible in the 3D view and cannot be hidden again.