collection of material issues

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
bernd
Veteran
Posts: 12536
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: collection of material issues

Post by bernd »

issue #2866

The problem is, the material editor does change the material properties to the value shown in the input field, even if the value is not edited by the user. The design of the treeview should be improved in this regard.
User avatar
bernd
Veteran
Posts: 12536
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: collection of material issues

Post by bernd »

git commit 1b8244580e4a it does not fix the source of the problem but it improve the situation a lot.
User avatar
bernd
Veteran
Posts: 12536
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: collection of material issues

Post by bernd »

It works for the user defined properties for a simple reason. A text edit widget is used. Thus everything could be inserted and the widget is not smart at all. No help with the unit nothing. What is entered is accepted.
User avatar
uwestoehr
Veteran
Posts: 4264
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

Re: collection of material issues

Post by uwestoehr »

Many thanks!

I recompiled the latest master and here the issue is still that the dot "." in the values is ignored. The issue is definitely not that the dot is taken wrongly as thousands separator, it is treated as not existing.
This is my system:

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.25275 (Git)
Build type: Release
Branch: master
Hash: f20e29a04c1a539217eb7ef081b94d9526823e15
Python version: 3.8.6+
Qt version: 5.15.1
Coin version: 4.0.1
OCC version: 7.5.0
Locale: German/Germany (de_DE)

When I find time, I can try to have a look but you know that I am no Pythionist but a C++ guy ;) so I cannot promise I'll find the cause. (I need a debugger but don't know how to debug Python scripts).
User avatar
bernd
Veteran
Posts: 12536
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: collection of material issues

Post by bernd »

uwestoehr wrote: Thu Jul 15, 2021 3:20 pm When I find time, I can try to have a look but you know that I am no Pythionist but a C++ guy ;)
I did not know. I have some minor Gui issues in the FreeCAD VTK PostProcessing which I am not able to solve. Would you help with them? They are very small but one needs to understand the C++ Gui code, which I did not in the time range I used for it.

cheers bernd
User avatar
uwestoehr
Veteran
Posts: 4264
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

Re: collection of material issues

Post by uwestoehr »

bernd wrote: Fri Jul 16, 2021 10:05 am I have some minor Gui issues in the FreeCAD VTK PostProcessing which I am not able to solve. Would you help with them? They are very small but one needs to understand the C++ Gui code, which I did not in the time range I used for it.
I can try to have a look.
By the way, the FEM dialogs are on my ToDo list too because every FEM constraint dialog behaves different and that annoyed me when I need to be quick.
However, my spare time is limited at the moment. I will send you a message when I have time so that you describe me the VTK issue.
User avatar
uwestoehr
Veteran
Posts: 4264
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

Re: collection of material issues

Post by uwestoehr »

Back to the topic: The main bug with the material card handling is indeed that it does not take the locale setting into account.

I have German locale and therefore the comma is the decimal separator. The FCMat files store the values with the dot as decimal separator and the material card handling does not take this into account.

Here is a material card where I used the comma as decimal separator:
Östrogen-Comma.zip
(521 Bytes) Downloaded 34 times

With this everything works fine - clicking on a value in the material card dialog does not change anything.

With the same material card which uses dot as decimal separator, the material card dialog is almost unusable for practical work:
Östrogen-Dot.zip
(523 Bytes) Downloaded 34 times

Bernd, you as a Pythionist, could you please have a look if the dot <-> comma change is either simply not yet implemented or if there is a bug?
User avatar
uwestoehr
Veteran
Posts: 4264
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

Re: collection of material issues

Post by uwestoehr »

Bernd, could you already find time to have a look?

This is a severe issue for all users whose locale uses comma as decimal separator.

To test, all you do it to start FreeCAD with a locale so that you see comma as decimal separator in the FC dialogs. Here an example:
screencast how the bug can be triggered
screencast how the bug can be triggered
qJOc5Cy2Sj.gif (95.75 KiB) Viewed 1336 times

This is my test file I used in the screencast:
FEM-Material-test.FCStd
test file
(197.47 KiB) Downloaded 26 times
This is the error message I got in the above screencast:

Code: Select all

17:23:38 Traceback (most recent call last):
17:23:38    File "D:\FreeCAD-build\Mod\Fem\femtaskpanels\task_material_common.py", line 591, in pr_changed
17:23:38      self.update_material_property(
17:23:38    File "D:\FreeCAD-build\Mod\Fem\femtaskpanels\task_material_common.py", line 548, in update_material_property
17:23:38      value = float(inputfield_text)
17:23:38  ValueError: could not convert string to float: '0,200'
User avatar
uwestoehr
Veteran
Posts: 4264
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

Re: collection of material issues

Post by uwestoehr »

uwestoehr wrote: Sun Aug 08, 2021 3:26 pm Here an example
I could fix this issue and made a tentative PR:
https://github.com/FreeCAD/FreeCAD/pull/4956

My Python knowledge is rudimentary, can you therefore please check if this is correct?
User avatar
bernd
Veteran
Posts: 12536
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: collection of material issues

Post by bernd »

I am on the way. There migth be a better solution if a quantity is inside. Instead float() try ().Value like here

https://github.com/FreeCAD/FreeCAD/blob ... eometry.py

line 57 and 57
Post Reply