materials dict file defines things twice which could lead to problems

A forum to discuss the implementation of a good Materials system in FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

materials dict file defines things twice which could lead to problems

Post by bernd »

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

Re: units are defined twice which could lead to problems

Post by bernd »

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

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

Post by bernd »

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

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

Post by bernd »

git commit 0000732 fixes the duplicate unit definition
Post Reply