collection of Clip filter bugs

About the development of the FEM module/workbench.

Moderator: bernd

wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: collection of Clip filter bugs

Post by wmayer »

This was my fix https://github.com/FreeCAD/FreeCAD/commit/ceb5a3da
but it does not work anymore.
It's not a good fix anyway because it's totally superfluous to regenerate the whole geometry after changing the transparency. Instead you only have to touch the face set node. This is because transparency is directly handled by SoIndexedFaceSet.
I bisected and this commit introduced the regression that the transparency for filters does no longer work for me:
The difficulty is to decide when to use the user requested transparency and when to use the transparency from the color bar settings. So, we could define that if transparency property is changed by the user (i.e a value > 0%) it will take precedence over the value coming from the color bar or alternatively the maximum value will be used.

But even when undoing the changes of git commit e437893e99 the transparency for the pipeline object is not fixed. I guess the problem is that the SoMaterial node isn't changed because when exporting the object in .iv format then the transparency value isn't modified, i.e. it's 0.

EDIT: The transparency is ignored if Field is set to None. This is true for pipeline and clipped objects.
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: collection of Clip filter bugs

Post by wmayer »

uwestoehr wrote: Fri Apr 15, 2022 8:37 pm This was my fix https://github.com/FreeCAD/FreeCAD/commit/ceb5a3da
but it does not work anymore.
This caused the regression that if Field is set to None the transparency wasn't set. So, I reverted most of the changes and fixed it the right way.
I bisected and this commit introduced the regression that the transparency for filters does no longer work for me:
I have changed it to use the maximum transparency from user set transparency and from what the color bar delivers as this IMO is the most sensible way.

Then in ViewProviderFemPostObject::update3D() the range of the color bar was always overridden that made it impossible to set in the color bar and keep it like that. Now only changing the Field property will reset the color bar range again.

git commit 5822568566

What remains is the problem with the double-click on the one project file.
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: collection of Clip filter bugs

Post by wmayer »

wmayer wrote: Sat Apr 16, 2022 12:40 pm What remains is the problem with the double-click on the one project file.
The odd thing with Electrostaticsplane-bug.FCStd is that the object is called SolverElmer but it uses the icon of the Calculix solver.
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: collection of Clip filter bugs

Post by wmayer »

For some reason the SolverElmer object lost its reference to the Python proxy object.

Code: Select all

App.ActiveDocument.SolverElmer.Proxy # is None
To fix it you have to:
  • Open the file Mod/Fem/femsolver/elmer/solver.py
  • Change the __init__ method of Proxy to

    Code: Select all

        def __init__(self, obj):
            super(Proxy, self).__init__(obj)
    
  • Save the changes
  • Start FreeCAD and load the project file
  • Execute this Python code

    Code: Select all

    from femsolver.elmer.solver import Proxy
    App.ActiveDocument.SolverElmer.Proxy=Proxy(App.ActiveDocument.SolverElmer)
    from femsolver.elmer.solver import ViewProxy
    App.ActiveDocument.SolverElmer.ViewObject.Proxy=ViewProxy(App.ActiveDocument.SolverElmer.ViewObject)
    
  • Undo the changes in solver.py
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: collection of Clip filter bugs

Post by uwestoehr »

wmayer wrote: Sat Apr 16, 2022 12:40 pm This caused the regression that if Field is set to None the transparency wasn't set.
Hmm, it fixes that the transparency was at least set at all. The problem was that there was a loop between WriteTransparency() and update3D().
wmayer wrote: Sat Apr 16, 2022 12:40 pm So, I reverted most of the changes and fixed it the right way.
Thanks! I can confirm it works now for filters and pipelines.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: collection of Clip filter bugs

Post by uwestoehr »

wmayer wrote: Sat Apr 16, 2022 2:16 pm To fix it you have to:...
The interesting point is why the issue happened. All my real-life simulations using Elmer are still OK. it only happened for the 2 exampe files I uploaded to GitHub.
Therefore I think, let's postpone this for now.

FC 0.20 is close to be ready, there is now only one known crash left in the surface WB and yesterday I triggered the LibPack development.

Many thanks for all your great work :D and patience with me ;)

I am now away from my development PCs - holiday :)
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: collection of Clip filter bugs

Post by wmayer »

Hmm, it fixes that the transparency was at least set at all.
The way how it was before the transparency was set too but the rendering wasn't updated. Touching the SoIndexedFaceset node fixes it.
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: collection of Clip filter bugs

Post by wmayer »

uwestoehr wrote: Sat Apr 16, 2022 2:25 pm The interesting point is why the issue happened.
In FEM there took place many restructures of the Python modules and you had a rather old project. When opening the Document.xml file then the Proxy property of the SolverElmer is saved like this:

Code: Select all

                <Property name="Proxy" type="App::PropertyPythonObject">
                    <Python value="bnVsbA==" encoded="yes" json="yes"/>
                </Property>
while when it's fixed it looks like this:

Code: Select all

                <Property name="Proxy" type="App::PropertyPythonObject">
                    <Python value="e30=" encoded="yes" module="femsolver.elmer.solver" class="Proxy"/>
                </Property>
It should be checked if with femtools/migrate_app.py old project files can be supported.

EDIT: It's not possible because the decoded values are None, "" or 1. So, at some point the information was lost.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: collection of Clip filter bugs

Post by uwestoehr »

wmayer wrote: Sat Apr 16, 2022 3:53 pm In FEM there took place many restructures of the Python modules and you had a rather old project.
Thanks. I see now that I opened my file with FC 0.19 and saved it. Then I reopened and saved with FC 0.20/master. This explains it.
Post Reply