materials dict file defines things twice which could lead to problems

A forum to discuss the implementation of a good Materials system in FreeCAD
User avatar
bernd
Posts: 8477
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

materials dict file defines things twice which could lead to problems

Postby bernd » Sat Feb 02, 2019 10:32 pm

Units:

The units are defined twice, once for the FreeCAD unit system in https://github.com/FreeCAD/FreeCAD/blob ... #L460-L491 and once for the material editor in https://github.com/FreeCAD/FreeCAD/blob ... opDict.xml

I they do not match this causes problems. See issue #3781 and https://forum.freecadweb.org/viewtopic. ... 70#p278080 which will hopefully be fixed in https://github.com/FreeCAD/FreeCAD/pull/1944

the mismatch ...
https://github.com/FreeCAD/FreeCAD/blob ... t.cpp#L487
https://github.com/FreeCAD/FreeCAD/blob ... ct.xml#L66


I may open a new ticket once issue #3781 is closed in the regard if there would be some possibility to get the unit definition out of the system py Python, which would mean we could remove them from the xml file.

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

Re: units are defined twice which could lead to problems

Postby bernd » Mon Feb 11, 2019 11:33 pm

Material Properties:

they are once defined in the mat card template file: https://github.com/FreeCAD/FreeCAD/blob ... LATE.FCMat and another time for the material editor in: https://github.com/FreeCAD/FreeCAD/blob ... opDict.xml

The wiki even says something different from both ... Material
User avatar
bernd
Posts: 8477
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: materials dict file defines things twice which could lead to problems

Postby bernd » Wed Feb 13, 2019 6:04 am

for reference ... I am working on this ...

In the regard of material properties ... They are defined on three places in the code and on the wiki

- https://github.com/FreeCAD/FreeCAD/blob ... opDict.xml
- https://github.com/FreeCAD/FreeCAD/blob ... LATE.FCMat
- https://github.com/FreeCAD/FreeCAD/blob ... ls/headers
- Material

of course they all are different ... :shock: :o :(
User avatar
bernd
Posts: 8477
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: materials dict file defines things twice which could lead to problems

Postby bernd » Sun Feb 17, 2019 9:10 pm

git commit 0000732 fixes the duplicate unit definition