From 902af79514d7e5f6a422dbd292a775ef9ae7484b Mon Sep 17 00:00:00 2001 From: David Carter Date: Thu, 14 Sep 2023 22:52:48 -0400 Subject: [PATCH] Material: Material handling enhancements Rework of the material handling system. This first part concntrates on a rework of the material cards. Rather than use a fixed list of possible properties, properties can be defined separately in their own files and mixed to provide a complete list of possible properties. Properties can be inherited. The cards then provide values for the properties. These can also be inherited allowing for small changes in cards as required. The new property definitions are more extensive than previously. 2 and 3 dimensional arrays of properties can be defined. Values are obtained by calling an API instead of reading from a dictionary. For compatibility, a Python dictionary of values can be obtained similar to how it was done previously, but this is considered a deprecated API and won't support the newer advanced features. The editor is completely reworked. It will be able to edit older format material cards, but can only save them in the new format. For testing during the development phase, a system preference can specifiy wether the old or new material editors are to be used. This option will be removed before release. --- .../runCPPTests/runAllTests/action.yml | 7 + CMakeLists.txt | 1 + cMake/FreeCAD_Helpers/SetupLibYaml.cmake | 11 + src/Mod/Fem/Gui/AppFemGui.cpp | 115 +-- src/Mod/Fem/Gui/CMakeLists.txt | 33 +- src/Mod/Material/App/AppMaterial.cpp | 76 ++ src/Mod/Material/App/CMakeLists.txt | 99 ++ src/Mod/Material/App/Exceptions.h | 154 +++ src/Mod/Material/App/FolderTree.h | 87 ++ src/Mod/Material/App/MaterialConfigLoader.cpp | 396 ++++++++ src/Mod/Material/App/MaterialConfigLoader.h | 81 ++ src/Mod/Material/App/MaterialLibrary.cpp | 168 ++++ src/Mod/Material/App/MaterialLibrary.h | 95 ++ src/Mod/Material/App/MaterialLoader.cpp | 445 +++++++++ src/Mod/Material/App/MaterialLoader.h | 129 +++ src/Mod/Material/App/MaterialManager.cpp | 273 ++++++ src/Mod/Material/App/MaterialManager.h | 85 ++ src/Mod/Material/App/MaterialManagerPy.xml | 51 + .../Material/App/MaterialManagerPyImpl.cpp | 204 ++++ src/Mod/Material/App/MaterialPy.xml | 161 +++ src/Mod/Material/App/MaterialPyImpl.cpp | 395 ++++++++ src/Mod/Material/App/MaterialValue.cpp | 243 +++++ src/Mod/Material/App/MaterialValue.h | 187 ++++ src/Mod/Material/App/Materials.cpp | 914 ++++++++++++++++++ src/Mod/Material/App/Materials.h | 334 +++++++ src/Mod/Material/App/Model.cpp | 116 +++ src/Mod/Material/App/Model.h | 297 ++++++ src/Mod/Material/App/ModelLibrary.cpp | 114 +++ src/Mod/Material/App/ModelLibrary.h | 100 ++ src/Mod/Material/App/ModelLoader.cpp | 417 ++++++++ src/Mod/Material/App/ModelLoader.h | 130 +++ src/Mod/Material/App/ModelManager.cpp | 172 ++++ src/Mod/Material/App/ModelManager.h | 85 ++ src/Mod/Material/App/ModelManagerPy.xml | 41 + src/Mod/Material/App/ModelManagerPyImpl.cpp | 163 ++++ src/Mod/Material/App/ModelPropertyPy.xml | 54 ++ src/Mod/Material/App/ModelPropertyPyImpl.cpp | 101 ++ src/Mod/Material/App/ModelPy.xml | 85 ++ src/Mod/Material/App/ModelPyImpl.cpp | 172 ++++ src/Mod/Material/App/ModelUuids.h | 73 ++ src/Mod/Material/App/PreCompiled.cpp | 24 + src/Mod/Material/App/PreCompiled.h | 67 ++ src/Mod/Material/App/trim.h | 81 ++ src/Mod/Material/CMakeLists.txt | 388 ++++---- src/Mod/Material/FluidMaterial/Air.FCMat | 24 - src/Mod/Material/FluidMaterial/Argon.FCMat | 24 - .../FluidMaterial/Carbon_dioxide.FCMat | 24 - src/Mod/Material/FluidMaterial/Nitrogen.FCMat | 24 - src/Mod/Material/FluidMaterial/None.FCMat | 15 - src/Mod/Material/FluidMaterial/Readme.md | 31 - src/Mod/Material/FluidMaterial/Water.FCMat | 26 - src/Mod/Material/Gui/AppMatGui.cpp | 105 ++ src/Mod/Material/Gui/Array2D.cpp | 158 +++ src/Mod/Material/Gui/Array2D.h | 68 ++ src/Mod/Material/Gui/Array2D.ui | 92 ++ src/Mod/Material/Gui/Array3D.cpp | 198 ++++ src/Mod/Material/Gui/Array3D.h | 67 ++ src/Mod/Material/Gui/Array3D.ui | 104 ++ src/Mod/Material/Gui/ArrayDelegate.cpp | 184 ++++ src/Mod/Material/Gui/ArrayDelegate.h | 75 ++ src/Mod/Material/Gui/ArrayModel.cpp | 466 +++++++++ src/Mod/Material/Gui/ArrayModel.h | 139 +++ src/Mod/Material/Gui/CMakeLists.txt | 106 ++ src/Mod/Material/Gui/Command.cpp | 83 ++ .../Gui/DlgSettingsMaterial.cpp} | 28 +- .../Gui/DlgSettingsMaterial.h} | 20 +- .../Gui/DlgSettingsMaterial.ui} | 59 +- src/Mod/Material/Gui/MaterialDelegate.cpp | 466 +++++++++ src/Mod/Material/Gui/MaterialDelegate.h | 87 ++ src/Mod/Material/Gui/MaterialSave.cpp | 314 ++++++ src/Mod/Material/Gui/MaterialSave.h | 81 ++ src/Mod/Material/Gui/MaterialSave.ui | 133 +++ src/Mod/Material/Gui/MaterialsEditor.cpp | 905 +++++++++++++++++ src/Mod/Material/Gui/MaterialsEditor.h | 131 +++ src/Mod/Material/Gui/MaterialsEditor.ui | 288 ++++++ src/Mod/Material/Gui/ModelSelect.cpp | 545 +++++++++++ src/Mod/Material/Gui/ModelSelect.h | 109 +++ src/Mod/Material/Gui/ModelSelect.ui | 197 ++++ src/Mod/Material/Gui/PreCompiled.cpp | 24 + src/Mod/Material/Gui/PreCompiled.h | 77 ++ src/Mod/Material/Gui/Resources/Material.qrc | 10 + .../Gui/Resources/icons/MaterialWorkbench.svg | 128 +++ .../Gui/Resources/icons/Materials_Edit.svg | 128 +++ .../Resources/icons/preferences-material.svg | 128 +++ .../Gui/Resources/icons/preview-rendered.svg | 65 ++ .../Gui/Resources/icons/preview-vector.svg | 157 +++ .../Material/Gui/Resources/icons/table.svg | 77 ++ .../Gui/Resources/translations/Material.ts | 85 ++ src/Mod/Material/Init.py | 2 + src/Mod/Material/InitGui.py | 4 + src/Mod/Material/Material.py | 135 --- src/Mod/Material/MaterialEditor.py | 109 ++- src/Mod/Material/MaterialGlobal.h | 46 + src/Mod/Material/Resources/Material.qrc | 1 + .../Materials/Appearance/Aluminum.FCMat | 15 + .../Materials/Appearance/Brass.FCMat | 15 + .../Materials/Appearance/Bronze.FCMat | 15 + .../Materials/Appearance/Chrome.FCMat | 15 + .../Materials/Appearance/Copper.FCMat | 15 + .../Appearance/DefaultAppearance.FCMat | 15 + .../Materials/Appearance/Emerald.FCMat | 15 + .../Resources/Materials/Appearance/Gold.FCMat | 15 + .../Resources/Materials/Appearance/Jade.FCMat | 15 + .../Materials/Appearance/Metalized.FCMat | 15 + .../Materials/Appearance/NeonGNC.FCMat | 15 + .../Materials/Appearance/NeonPHC.FCMat | 15 + .../Materials/Appearance/Obsidian.FCMat | 15 + .../Materials/Appearance/Pewter.FCMat | 15 + .../Materials/Appearance/Plaster.FCMat | 15 + .../Materials/Appearance/Plastic.FCMat | 15 + .../Resources/Materials/Appearance/Ruby.FCMat | 15 + .../Materials/Appearance/Satin.FCMat | 15 + .../Materials/Appearance/ShinyPlastic.FCMat | 15 + .../Materials/Appearance/Silver.FCMat | 15 + .../Materials/Appearance/Steel.FCMat | 15 + .../Materials/Appearance/Stone.FCMat | 15 + .../Materials/FluidMaterial/Air.FCMat | 25 + .../Materials/FluidMaterial/Argon.FCMat | 25 + .../FluidMaterial/Carbon_dioxide.FCMat | 25 + .../Materials/FluidMaterial/Nitrogen.FCMat | 25 + .../Materials/FluidMaterial/None.FCMat | 16 + .../Materials/FluidMaterial/Water.FCMat | 26 + .../Aggregate/Concrete-EN-C35_45.FCMat | 23 + .../Aggregate/Concrete-Generic.FCMat | 25 + .../Aggregate/Reinforcement-FIB-B500.FCMat | 16 + .../StandardMaterial/Carbon/Graphite.FCMat | 32 + .../Glass/Glass-E-GlassFibre.FCMat | 18 + .../Glass/Glass-Generic.FCMat | 23 + .../Glass/Glass-S2-GlassFibre.FCMat | 18 + .../Metal/Alloys/Invar-Generic.FCMat | 27 + .../Metal/Aluminum/AlMg3F24.FCMat | 31 + .../Metal/Aluminum/AlMgSi1F31.FCMat | 31 + .../Metal/Aluminum/AlZn4-5Mg1F35.FCMat | 29 + .../Metal/Aluminum/Aluminum-6061-T6.FCMat | 28 + .../Metal/Aluminum/Aluminum-Generic.FCMat | 31 + .../Metal/Copper/Copper-Generic.FCMat | 32 + .../Metal/Iron/Iron-Generic.FCMat | 32 + .../Metal/Steel/CalculiX-Steel.FCMat | 25 + .../Metal/Steel/Steel-15CrNi6.FCMat | 30 + .../Metal/Steel/Steel-17CrNiMo6.FCMat | 29 + .../Metal/Steel/Steel-1C22.FCMat | 30 + .../Metal/Steel/Steel-1C35.FCMat | 30 + .../Metal/Steel/Steel-1C45.FCMat | 30 + .../Metal/Steel/Steel-1C60.FCMat | 30 + .../Metal/Steel/Steel-20NiCrMo2.FCMat | 29 + .../Metal/Steel/Steel-28Mn6.FCMat | 29 + .../Metal/Steel/Steel-2C10.FCMat | 29 + .../Metal/Steel/Steel-30CrNiMo8.FCMat | 29 + .../Metal/Steel/Steel-34CrNiMo6.FCMat | 29 + .../Metal/Steel/Steel-36CrNiMo4.FCMat | 29 + .../Metal/Steel/Steel-36NiCrMo16.FCMat | 29 + .../Metal/Steel/Steel-3C15.FCMat | 29 + .../Metal/Steel/Steel-3C22.FCMat | 29 + .../Metal/Steel/Steel-3C35.FCMat | 29 + .../Metal/Steel/Steel-3V45.FCMat | 29 + .../Metal/Steel/Steel-C10.FCMat | 29 + .../Metal/Steel/Steel-C15.FCMat | 29 + .../Metal/Steel/Steel-C22E.FCMat | 29 + .../Metal/Steel/Steel-C25E.FCMat | 29 + .../Metal/Steel/Steel-C30E.FCMat | 29 + .../Metal/Steel/Steel-C40E.FCMat | 29 + .../Metal/Steel/Steel-C50E.FCMat | 29 + .../Metal/Steel/Steel-C55E.FCMat | 29 + .../Metal/Steel/Steel-C60E.FCMat | 29 + .../Metal/Steel/Steel-E295-GC.FCMat | 29 + .../Metal/Steel/Steel-E295.FCMat | 29 + .../Metal/Steel/Steel-E335-GC.FCMat | 29 + .../Metal/Steel/Steel-E335.FCMat | 29 + .../Metal/Steel/Steel-E360-GC.FCMat | 29 + .../Metal/Steel/Steel-E360.FCMat | 29 + .../Metal/Steel/Steel-EN-GJL-100.FCMat | 28 + .../Metal/Steel/Steel-EN-GJL-150.FCMat | 29 + .../Metal/Steel/Steel-EN-GJL-200.FCMat | 29 + .../Metal/Steel/Steel-EN-GJL-250.FCMat | 29 + .../Metal/Steel/Steel-EN-GJL-300.FCMat | 29 + .../Metal/Steel/Steel-EN-GJL-350.FCMat | 29 + .../Metal/Steel/Steel-EN-GJMB-350-10.FCMat | 29 + .../Metal/Steel/Steel-EN-GJMB-550-4.FCMat | 29 + .../Metal/Steel/Steel-EN-GJMB-650-2.FCMat | 29 + .../Metal/Steel/Steel-EN-GJMW-350-4.FCMat | 28 + .../Metal/Steel/Steel-EN-GJMW-360-12.FCMat | 29 + .../Metal/Steel/Steel-EN-GJMW-400-5.FCMat | 29 + .../Metal/Steel/Steel-EN-GJMW-450-7.FCMat | 29 + .../Metal/Steel/Steel-EN-GJS-400-15.FCMat | 29 + .../Metal/Steel/Steel-EN-GJS-500-7.FCMat | 29 + .../Metal/Steel/Steel-EN-GJS-600-3.FCMat | 29 + .../Metal/Steel/Steel-EN-GJS-700-2.FCMat | 29 + .../Metal/Steel/Steel-EN-GJS-800-1.FCMat | 29 + .../Metal/Steel/Steel-G16Mn5.FCMat | 29 + .../Metal/Steel/Steel-G200.FCMat | 29 + .../Metal/Steel/Steel-G20Mn5.FCMat | 29 + .../Metal/Steel/Steel-G230.FCMat | 29 + .../Metal/Steel/Steel-G260.FCMat | 29 + .../Metal/Steel/Steel-G300.FCMat | 29 + .../Metal/Steel/Steel-G30Mn5.FCMat | 29 + .../Metal/Steel/Steel-Generic.FCMat | 28 + .../Metal/Steel/Steel-S185.FCMat | 29 + .../Metal/Steel/Steel-S235JO.FCMat | 29 + .../Metal/Steel/Steel-S235JR.FCMat | 29 + .../Metal/Steel/Steel-S235JRG1.FCMat | 29 + .../Metal/Steel/Steel-S260NC.FCMat | 29 + .../Metal/Steel/Steel-S275JO.FCMat | 29 + .../Metal/Steel/Steel-S275JR.FCMat | 29 + .../Metal/Steel/Steel-S275N.FCMat | 29 + .../Metal/Steel/Steel-S335JO.FCMat | 29 + .../Metal/Steel/Steel-S335JR.FCMat | 29 + .../Metal/Steel/Steel-S335N.FCMat | 29 + .../Metal/Steel/Steel-S340MC.FCMat | 29 + .../Metal/Steel/Steel-S355J2G3.FCMat | 29 + .../Metal/Steel/Steel-S380MC.FCMat | 29 + .../Metal/Steel/Steel-S420MC.FCMat | 29 + .../Metal/Steel/Steel-S420N.FCMat | 29 + .../Metal/Steel/Steel-S460MC.FCMat | 29 + .../Metal/Steel/Steel-S460N.FCMat | 29 + .../Metal/Steel/Steel-S500MC.FCMat | 29 + .../Metal/Steel/Steel-S550MC.FCMat | 29 + .../Metal/Steel/Steel-S690MC.FCMat | 29 + .../Metal/Steel/Steel-St-37-2K.FCMat | 29 + .../Metal/Steel/Steel-St-E-255.FCMat | 29 + .../Metal/Steel/Steel-St-E-315.FCMat | 29 + .../Metal/Steel/Steel-St-E-380.FCMat | 29 + .../Metal/Steel/Steel-St-E-460.FCMat | 29 + .../Metal/Steel/Steel-St-E-500.FCMat | 29 + .../Metal/Steel/Steel-X2CrNiMoN17-13-3.FCMat | 29 + .../Metal/Steel/Steel-X2CrNiN24-4.FCMat | 29 + .../Metal/Steel/Steel-X39CrMo17-1.FCMat | 29 + .../Metal/Steel/Steel-X3CrNiMo13-14.FCMat | 29 + .../Metal/Steel/Steel-X5CrNi18-10.FCMat | 29 + .../Metal/Steel/Steel-X5CrNiMo17-12-2.FCMat | 29 + .../Metal/Steel/Steel-X6CrNiTi18-10.FCMat | 29 + .../Metal/Titanium/Ti-6Al-4V.FCMat | 31 + .../Thermoplast/ABS-Generic.FCMat | 26 + .../Thermoplast/Acrylic-Glass-Generic.FCMat | 28 + .../Thermoplast/PA6-Generic.FCMat | 23 + .../Thermoplast/PET-Generic.FCMat | 24 + .../Thermoplast/PLA-Generic.FCMat | 26 + .../Thermoplast/PP-Generic.FCMat | 23 + .../Thermoplast/PTFE-Generic.FCMat | 23 + .../Thermoplast/PVC-Generic.FCMat | 21 + .../StandardMaterial/Wood/Wood-Generic.FCMat | 20 + .../Models/Architectural/Architectural.yml | 69 ++ .../Material/Resources/Models/Costs/Costs.yml | 47 + .../Electromagnetic/Electromagnetic.yml | 45 + .../Material/Resources/Models/Fluid/Fluid.yml | 51 + .../Resources/Models/Legacy/Father.yml | 36 + .../Models/Legacy/MaterialStandard.yml | 46 + .../Resources/Models/Mechanical/Density.yml | 34 + .../Models/Mechanical/HypotheticalExample.yml | 41 + .../Mechanical/IsotropicLinearElastic.yml | 51 + .../Models/Mechanical/LinearElastic.yml | 81 ++ .../Models/Mechanical/OgdenYld2004p18.yml | 65 ++ .../Mechanical/OrthotropicLinearElastic.yml | 76 ++ .../Models/Rendering/AdvancedRendering.yml | 42 + .../Models/Rendering/BasicRendering.yml | 59 ++ .../Models/Rendering/TextureRendering.yml | 42 + .../Models/Rendering/VectorRendering.yml | 59 ++ .../Resources/Models/Thermal/Thermal.yml | 47 + .../{ => Resources/ui}/materials-editor.ui | 0 .../StandardMaterial/ABS-Generic.FCMat | 26 - .../Acrylic-Glass-Generic.FCMat | 29 - .../Material/StandardMaterial/AlMg3F24.FCMat | 28 - .../StandardMaterial/AlMgSi1F31.FCMat | 28 - .../StandardMaterial/AlZn4-5Mg1F35.FCMat | 26 - .../StandardMaterial/Aluminum-6061-T6.FCMat | 24 - .../StandardMaterial/Aluminum-Generic.FCMat | 26 - .../StandardMaterial/CalculiX-Steel.FCMat | 20 - .../StandardMaterial/Concrete-EN-C35_45.FCMat | 20 - .../StandardMaterial/Concrete-Generic.FCMat | 20 - .../StandardMaterial/Copper-Generic.FCMat | 27 - .../StandardMaterial/Glass-E-GlassFibre.FCMat | 18 - .../StandardMaterial/Glass-Generic.FCMat | 23 - .../Glass-S2-GlassFibre.FCMat | 18 - .../Material/StandardMaterial/Graphite.FCMat | 33 - .../StandardMaterial/Invar-Generic.FCMat | 25 - .../StandardMaterial/Iron-Generic.FCMat | 26 - src/Mod/Material/StandardMaterial/None.FCMat | 16 - .../StandardMaterial/PA6-Generic.FCMat | 25 - .../StandardMaterial/PET-Generic.FCMat | 26 - .../StandardMaterial/PLA-Generic.FCMat | 26 - .../StandardMaterial/PP-Generic.FCMat | 25 - .../StandardMaterial/PTFE-Generic.FCMat | 25 - .../StandardMaterial/PVC-Generic.FCMat | 23 - src/Mod/Material/StandardMaterial/Readme.txt | 23 - .../Reinforcement-FIB-B500.FCMat | 15 - .../StandardMaterial/Steel-15CrNi6.FCMat | 28 - .../StandardMaterial/Steel-17CrNiMo6.FCMat | 27 - .../StandardMaterial/Steel-1C22.FCMat | 29 - .../StandardMaterial/Steel-1C35.FCMat | 28 - .../StandardMaterial/Steel-1C45.FCMat | 28 - .../StandardMaterial/Steel-1C60.FCMat | 28 - .../StandardMaterial/Steel-20NiCrMo2.FCMat | 27 - .../StandardMaterial/Steel-28Mn6.FCMat | 26 - .../StandardMaterial/Steel-2C10.FCMat | 26 - .../StandardMaterial/Steel-30CrNiMo8.FCMat | 27 - .../StandardMaterial/Steel-34CrNiMo6.FCMat | 27 - .../StandardMaterial/Steel-36CrNiMo4.FCMat | 27 - .../StandardMaterial/Steel-36NiCrMo16.FCMat | 27 - .../StandardMaterial/Steel-3C15.FCMat | 26 - .../StandardMaterial/Steel-3C22.FCMat | 26 - .../StandardMaterial/Steel-3C35.FCMat | 26 - .../StandardMaterial/Steel-3V45.FCMat | 26 - .../Material/StandardMaterial/Steel-C10.FCMat | 26 - .../Material/StandardMaterial/Steel-C15.FCMat | 26 - .../StandardMaterial/Steel-C22E.FCMat | 26 - .../StandardMaterial/Steel-C25E.FCMat | 26 - .../StandardMaterial/Steel-C30E.FCMat | 26 - .../StandardMaterial/Steel-C40E.FCMat | 26 - .../StandardMaterial/Steel-C50E.FCMat | 26 - .../StandardMaterial/Steel-C55E.FCMat | 26 - .../StandardMaterial/Steel-C60E.FCMat | 26 - .../StandardMaterial/Steel-E295-GC.FCMat | 26 - .../StandardMaterial/Steel-E295.FCMat | 26 - .../StandardMaterial/Steel-E335-GC.FCMat | 26 - .../StandardMaterial/Steel-E335.FCMat | 26 - .../StandardMaterial/Steel-E360-GC.FCMat | 26 - .../StandardMaterial/Steel-E360.FCMat | 26 - .../StandardMaterial/Steel-EN-GJL-100.FCMat | 26 - .../StandardMaterial/Steel-EN-GJL-150.FCMat | 27 - .../StandardMaterial/Steel-EN-GJL-200.FCMat | 27 - .../StandardMaterial/Steel-EN-GJL-250.FCMat | 26 - .../StandardMaterial/Steel-EN-GJL-300.FCMat | 27 - .../StandardMaterial/Steel-EN-GJL-350.FCMat | 27 - .../Steel-EN-GJMB-350-10.FCMat | 27 - .../Steel-EN-GJMB-550-4.FCMat | 27 - .../Steel-EN-GJMB-650-2.FCMat | 27 - .../Steel-EN-GJMW-350-4.FCMat | 26 - .../Steel-EN-GJMW-360-12.FCMat | 27 - .../Steel-EN-GJMW-400-5.FCMat | 27 - .../Steel-EN-GJMW-450-7.FCMat | 27 - .../Steel-EN-GJS-400-15.FCMat | 27 - .../StandardMaterial/Steel-EN-GJS-500-7.FCMat | 27 - .../StandardMaterial/Steel-EN-GJS-600-3.FCMat | 27 - .../StandardMaterial/Steel-EN-GJS-700-2.FCMat | 27 - .../StandardMaterial/Steel-EN-GJS-800-1.FCMat | 27 - .../StandardMaterial/Steel-G16Mn5.FCMat | 27 - .../StandardMaterial/Steel-G200.FCMat | 27 - .../StandardMaterial/Steel-G20Mn5.FCMat | 27 - .../StandardMaterial/Steel-G230.FCMat | 27 - .../StandardMaterial/Steel-G260.FCMat | 26 - .../StandardMaterial/Steel-G300.FCMat | 26 - .../StandardMaterial/Steel-G30Mn5.FCMat | 26 - .../StandardMaterial/Steel-Generic.FCMat | 23 - .../StandardMaterial/Steel-S185.FCMat | 27 - .../StandardMaterial/Steel-S235JO.FCMat | 26 - .../StandardMaterial/Steel-S235JR.FCMat | 27 - .../StandardMaterial/Steel-S235JRG1.FCMat | 27 - .../StandardMaterial/Steel-S260NC.FCMat | 27 - .../StandardMaterial/Steel-S275JO.FCMat | 26 - .../StandardMaterial/Steel-S275JR.FCMat | 27 - .../StandardMaterial/Steel-S275N.FCMat | 26 - .../StandardMaterial/Steel-S335JO.FCMat | 26 - .../StandardMaterial/Steel-S335JR.FCMat | 26 - .../StandardMaterial/Steel-S335N.FCMat | 26 - .../StandardMaterial/Steel-S340MC.FCMat | 27 - .../StandardMaterial/Steel-S355J2G3.FCMat | 26 - .../StandardMaterial/Steel-S380MC.FCMat | 27 - .../StandardMaterial/Steel-S420MC.FCMat | 27 - .../StandardMaterial/Steel-S420N.FCMat | 26 - .../StandardMaterial/Steel-S460MC.FCMat | 27 - .../StandardMaterial/Steel-S460N.FCMat | 26 - .../StandardMaterial/Steel-S500MC.FCMat | 27 - .../StandardMaterial/Steel-S550MC.FCMat | 27 - .../StandardMaterial/Steel-S690MC.FCMat | 27 - .../StandardMaterial/Steel-St-37-2K.FCMat | 27 - .../StandardMaterial/Steel-St-E-255.FCMat | 26 - .../StandardMaterial/Steel-St-E-315.FCMat | 26 - .../StandardMaterial/Steel-St-E-380.FCMat | 26 - .../StandardMaterial/Steel-St-E-460.FCMat | 26 - .../StandardMaterial/Steel-St-E-500.FCMat | 26 - .../Steel-X2CrNiMoN17-13-3.FCMat | 27 - .../StandardMaterial/Steel-X2CrNiN24-4.FCMat | 26 - .../StandardMaterial/Steel-X39CrMo17-1.FCMat | 26 - .../Steel-X3CrNiMo13-14.FCMat | 26 - .../StandardMaterial/Steel-X5CrNi18-10.FCMat | 27 - .../Steel-X5CrNiMo17-12-2.FCMat | 27 - .../Steel-X6CrNiTi18-10.FCMat | 27 - .../Material/StandardMaterial/TEMPLATE.FCMat | 210 ---- .../Material/StandardMaterial/Ti-6Al-4V.FCMat | 29 - .../StandardMaterial/Tools/FCMat2csv.sh | 35 - .../StandardMaterial/Tools/Materials.csv | 114 --- .../StandardMaterial/Tools/Materials.ods | Bin 24814 -> 0 bytes .../Material/StandardMaterial/Tools/README | 42 - .../Material/StandardMaterial/Tools/headers | 53 - .../StandardMaterial/Tools/make_FCMats.sh | 71 -- .../StandardMaterial/Tools/make_ods.sh | 27 - .../Tools/new_material_header | 5 - .../StandardMaterial/Wood-Generic.FCMat | 18 - src/Mod/Material/TestMaterialsApp.py | 236 +++++ src/Mod/Material/importFCMat.py | 106 +- .../Material/materialtools/MaterialModels.py | 163 ++++ .../materialtools/Tools/ConvertFCMat.py | 292 ++++++ src/Mod/Material/materialtools/cardutils.py | 198 +++- tests/CMakeLists.txt | 50 +- tests/src/Mod/CMakeLists.txt | 1 + tests/src/Mod/Material/App/CMakeLists.txt | 6 + tests/src/Mod/Material/App/Model.cpp | 125 +++ tests/src/Mod/Material/CMakeLists.txt | 15 + 397 files changed, 19222 insertions(+), 4312 deletions(-) create mode 100644 cMake/FreeCAD_Helpers/SetupLibYaml.cmake create mode 100644 src/Mod/Material/App/AppMaterial.cpp create mode 100644 src/Mod/Material/App/CMakeLists.txt create mode 100644 src/Mod/Material/App/Exceptions.h create mode 100644 src/Mod/Material/App/FolderTree.h create mode 100644 src/Mod/Material/App/MaterialConfigLoader.cpp create mode 100644 src/Mod/Material/App/MaterialConfigLoader.h create mode 100644 src/Mod/Material/App/MaterialLibrary.cpp create mode 100644 src/Mod/Material/App/MaterialLibrary.h create mode 100644 src/Mod/Material/App/MaterialLoader.cpp create mode 100644 src/Mod/Material/App/MaterialLoader.h create mode 100644 src/Mod/Material/App/MaterialManager.cpp create mode 100644 src/Mod/Material/App/MaterialManager.h create mode 100644 src/Mod/Material/App/MaterialManagerPy.xml create mode 100644 src/Mod/Material/App/MaterialManagerPyImpl.cpp create mode 100644 src/Mod/Material/App/MaterialPy.xml create mode 100644 src/Mod/Material/App/MaterialPyImpl.cpp create mode 100644 src/Mod/Material/App/MaterialValue.cpp create mode 100644 src/Mod/Material/App/MaterialValue.h create mode 100644 src/Mod/Material/App/Materials.cpp create mode 100644 src/Mod/Material/App/Materials.h create mode 100644 src/Mod/Material/App/Model.cpp create mode 100644 src/Mod/Material/App/Model.h create mode 100644 src/Mod/Material/App/ModelLibrary.cpp create mode 100644 src/Mod/Material/App/ModelLibrary.h create mode 100644 src/Mod/Material/App/ModelLoader.cpp create mode 100644 src/Mod/Material/App/ModelLoader.h create mode 100644 src/Mod/Material/App/ModelManager.cpp create mode 100644 src/Mod/Material/App/ModelManager.h create mode 100644 src/Mod/Material/App/ModelManagerPy.xml create mode 100644 src/Mod/Material/App/ModelManagerPyImpl.cpp create mode 100644 src/Mod/Material/App/ModelPropertyPy.xml create mode 100644 src/Mod/Material/App/ModelPropertyPyImpl.cpp create mode 100644 src/Mod/Material/App/ModelPy.xml create mode 100644 src/Mod/Material/App/ModelPyImpl.cpp create mode 100644 src/Mod/Material/App/ModelUuids.h create mode 100644 src/Mod/Material/App/PreCompiled.cpp create mode 100644 src/Mod/Material/App/PreCompiled.h create mode 100644 src/Mod/Material/App/trim.h delete mode 100644 src/Mod/Material/FluidMaterial/Air.FCMat delete mode 100644 src/Mod/Material/FluidMaterial/Argon.FCMat delete mode 100644 src/Mod/Material/FluidMaterial/Carbon_dioxide.FCMat delete mode 100644 src/Mod/Material/FluidMaterial/Nitrogen.FCMat delete mode 100644 src/Mod/Material/FluidMaterial/None.FCMat delete mode 100644 src/Mod/Material/FluidMaterial/Readme.md delete mode 100644 src/Mod/Material/FluidMaterial/Water.FCMat create mode 100644 src/Mod/Material/Gui/AppMatGui.cpp create mode 100644 src/Mod/Material/Gui/Array2D.cpp create mode 100644 src/Mod/Material/Gui/Array2D.h create mode 100644 src/Mod/Material/Gui/Array2D.ui create mode 100644 src/Mod/Material/Gui/Array3D.cpp create mode 100644 src/Mod/Material/Gui/Array3D.h create mode 100644 src/Mod/Material/Gui/Array3D.ui create mode 100644 src/Mod/Material/Gui/ArrayDelegate.cpp create mode 100644 src/Mod/Material/Gui/ArrayDelegate.h create mode 100644 src/Mod/Material/Gui/ArrayModel.cpp create mode 100644 src/Mod/Material/Gui/ArrayModel.h create mode 100644 src/Mod/Material/Gui/CMakeLists.txt create mode 100644 src/Mod/Material/Gui/Command.cpp rename src/Mod/{Fem/Gui/DlgSettingsFemMaterialImp.cpp => Material/Gui/DlgSettingsMaterial.cpp} (81%) rename src/Mod/{Fem/Gui/DlgSettingsFemMaterialImp.h => Material/Gui/DlgSettingsMaterial.h} (81%) rename src/Mod/{Fem/Gui/DlgSettingsFemMaterial.ui => Material/Gui/DlgSettingsMaterial.ui} (82%) create mode 100644 src/Mod/Material/Gui/MaterialDelegate.cpp create mode 100644 src/Mod/Material/Gui/MaterialDelegate.h create mode 100644 src/Mod/Material/Gui/MaterialSave.cpp create mode 100644 src/Mod/Material/Gui/MaterialSave.h create mode 100644 src/Mod/Material/Gui/MaterialSave.ui create mode 100644 src/Mod/Material/Gui/MaterialsEditor.cpp create mode 100644 src/Mod/Material/Gui/MaterialsEditor.h create mode 100644 src/Mod/Material/Gui/MaterialsEditor.ui create mode 100644 src/Mod/Material/Gui/ModelSelect.cpp create mode 100644 src/Mod/Material/Gui/ModelSelect.h create mode 100644 src/Mod/Material/Gui/ModelSelect.ui create mode 100644 src/Mod/Material/Gui/PreCompiled.cpp create mode 100644 src/Mod/Material/Gui/PreCompiled.h create mode 100644 src/Mod/Material/Gui/Resources/Material.qrc create mode 100644 src/Mod/Material/Gui/Resources/icons/MaterialWorkbench.svg create mode 100644 src/Mod/Material/Gui/Resources/icons/Materials_Edit.svg create mode 100644 src/Mod/Material/Gui/Resources/icons/preferences-material.svg create mode 100644 src/Mod/Material/Gui/Resources/icons/preview-rendered.svg create mode 100644 src/Mod/Material/Gui/Resources/icons/preview-vector.svg create mode 100644 src/Mod/Material/Gui/Resources/icons/table.svg create mode 100644 src/Mod/Material/Gui/Resources/translations/Material.ts delete mode 100644 src/Mod/Material/Material.py create mode 100644 src/Mod/Material/MaterialGlobal.h create mode 100644 src/Mod/Material/Resources/Materials/Appearance/Aluminum.FCMat create mode 100644 src/Mod/Material/Resources/Materials/Appearance/Brass.FCMat create mode 100644 src/Mod/Material/Resources/Materials/Appearance/Bronze.FCMat create mode 100644 src/Mod/Material/Resources/Materials/Appearance/Chrome.FCMat create mode 100644 src/Mod/Material/Resources/Materials/Appearance/Copper.FCMat create mode 100644 src/Mod/Material/Resources/Materials/Appearance/DefaultAppearance.FCMat create mode 100644 src/Mod/Material/Resources/Materials/Appearance/Emerald.FCMat create mode 100644 src/Mod/Material/Resources/Materials/Appearance/Gold.FCMat create mode 100644 src/Mod/Material/Resources/Materials/Appearance/Jade.FCMat create mode 100644 src/Mod/Material/Resources/Materials/Appearance/Metalized.FCMat create mode 100644 src/Mod/Material/Resources/Materials/Appearance/NeonGNC.FCMat create mode 100644 src/Mod/Material/Resources/Materials/Appearance/NeonPHC.FCMat create mode 100644 src/Mod/Material/Resources/Materials/Appearance/Obsidian.FCMat create mode 100644 src/Mod/Material/Resources/Materials/Appearance/Pewter.FCMat create mode 100644 src/Mod/Material/Resources/Materials/Appearance/Plaster.FCMat create mode 100644 src/Mod/Material/Resources/Materials/Appearance/Plastic.FCMat create mode 100644 src/Mod/Material/Resources/Materials/Appearance/Ruby.FCMat create mode 100644 src/Mod/Material/Resources/Materials/Appearance/Satin.FCMat create mode 100644 src/Mod/Material/Resources/Materials/Appearance/ShinyPlastic.FCMat create mode 100644 src/Mod/Material/Resources/Materials/Appearance/Silver.FCMat create mode 100644 src/Mod/Material/Resources/Materials/Appearance/Steel.FCMat create mode 100644 src/Mod/Material/Resources/Materials/Appearance/Stone.FCMat create mode 100644 src/Mod/Material/Resources/Materials/FluidMaterial/Air.FCMat create mode 100644 src/Mod/Material/Resources/Materials/FluidMaterial/Argon.FCMat create mode 100644 src/Mod/Material/Resources/Materials/FluidMaterial/Carbon_dioxide.FCMat create mode 100644 src/Mod/Material/Resources/Materials/FluidMaterial/Nitrogen.FCMat create mode 100644 src/Mod/Material/Resources/Materials/FluidMaterial/None.FCMat create mode 100644 src/Mod/Material/Resources/Materials/FluidMaterial/Water.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Aggregate/Concrete-EN-C35_45.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Aggregate/Concrete-Generic.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Aggregate/Reinforcement-FIB-B500.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Carbon/Graphite.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Glass/Glass-E-GlassFibre.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Glass/Glass-Generic.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Glass/Glass-S2-GlassFibre.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Alloys/Invar-Generic.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Aluminum/AlMg3F24.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Aluminum/AlMgSi1F31.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Aluminum/AlZn4-5Mg1F35.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Aluminum/Aluminum-6061-T6.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Aluminum/Aluminum-Generic.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Copper/Copper-Generic.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Iron/Iron-Generic.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/CalculiX-Steel.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-15CrNi6.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-17CrNiMo6.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-1C22.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-1C35.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-1C45.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-1C60.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-20NiCrMo2.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-28Mn6.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-2C10.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-30CrNiMo8.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-34CrNiMo6.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-36CrNiMo4.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-36NiCrMo16.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-3C15.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-3C22.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-3C35.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-3V45.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C10.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C15.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C22E.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C25E.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C30E.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C40E.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C50E.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C55E.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C60E.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E295-GC.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E295.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E335-GC.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E335.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E360-GC.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E360.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-100.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-150.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-200.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-250.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-300.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-350.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMB-350-10.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMB-550-4.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMB-650-2.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMW-350-4.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMW-360-12.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMW-400-5.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMW-450-7.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-400-15.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-500-7.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-600-3.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-700-2.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-800-1.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G16Mn5.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G200.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G20Mn5.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G230.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G260.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G300.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G30Mn5.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-Generic.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S185.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S235JO.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S235JR.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S235JRG1.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S260NC.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S275JO.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S275JR.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S275N.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S335JO.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S335JR.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S335N.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S340MC.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S355J2G3.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S380MC.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S420MC.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S420N.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S460MC.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S460N.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S500MC.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S550MC.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S690MC.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-37-2K.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-255.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-315.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-380.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-460.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-500.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X2CrNiMoN17-13-3.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X2CrNiN24-4.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X39CrMo17-1.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X3CrNiMo13-14.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X5CrNi18-10.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X5CrNiMo17-12-2.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X6CrNiTi18-10.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Titanium/Ti-6Al-4V.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/ABS-Generic.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/Acrylic-Glass-Generic.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PA6-Generic.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PET-Generic.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PLA-Generic.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PP-Generic.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PTFE-Generic.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PVC-Generic.FCMat create mode 100644 src/Mod/Material/Resources/Materials/StandardMaterial/Wood/Wood-Generic.FCMat create mode 100644 src/Mod/Material/Resources/Models/Architectural/Architectural.yml create mode 100644 src/Mod/Material/Resources/Models/Costs/Costs.yml create mode 100644 src/Mod/Material/Resources/Models/Electromagnetic/Electromagnetic.yml create mode 100644 src/Mod/Material/Resources/Models/Fluid/Fluid.yml create mode 100644 src/Mod/Material/Resources/Models/Legacy/Father.yml create mode 100644 src/Mod/Material/Resources/Models/Legacy/MaterialStandard.yml create mode 100644 src/Mod/Material/Resources/Models/Mechanical/Density.yml create mode 100644 src/Mod/Material/Resources/Models/Mechanical/HypotheticalExample.yml create mode 100644 src/Mod/Material/Resources/Models/Mechanical/IsotropicLinearElastic.yml create mode 100644 src/Mod/Material/Resources/Models/Mechanical/LinearElastic.yml create mode 100644 src/Mod/Material/Resources/Models/Mechanical/OgdenYld2004p18.yml create mode 100644 src/Mod/Material/Resources/Models/Mechanical/OrthotropicLinearElastic.yml create mode 100644 src/Mod/Material/Resources/Models/Rendering/AdvancedRendering.yml create mode 100644 src/Mod/Material/Resources/Models/Rendering/BasicRendering.yml create mode 100644 src/Mod/Material/Resources/Models/Rendering/TextureRendering.yml create mode 100644 src/Mod/Material/Resources/Models/Rendering/VectorRendering.yml create mode 100644 src/Mod/Material/Resources/Models/Thermal/Thermal.yml rename src/Mod/Material/{ => Resources/ui}/materials-editor.ui (100%) delete mode 100644 src/Mod/Material/StandardMaterial/ABS-Generic.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Acrylic-Glass-Generic.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/AlMg3F24.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/AlMgSi1F31.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/AlZn4-5Mg1F35.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Aluminum-6061-T6.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Aluminum-Generic.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/CalculiX-Steel.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Concrete-EN-C35_45.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Concrete-Generic.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Copper-Generic.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Glass-E-GlassFibre.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Glass-Generic.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Glass-S2-GlassFibre.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Graphite.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Invar-Generic.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Iron-Generic.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/None.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/PA6-Generic.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/PET-Generic.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/PLA-Generic.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/PP-Generic.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/PTFE-Generic.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/PVC-Generic.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Readme.txt delete mode 100644 src/Mod/Material/StandardMaterial/Reinforcement-FIB-B500.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-15CrNi6.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-17CrNiMo6.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-1C22.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-1C35.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-1C45.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-1C60.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-20NiCrMo2.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-28Mn6.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-2C10.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-30CrNiMo8.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-34CrNiMo6.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-36CrNiMo4.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-36NiCrMo16.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-3C15.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-3C22.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-3C35.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-3V45.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-C10.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-C15.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-C22E.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-C25E.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-C30E.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-C40E.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-C50E.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-C55E.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-C60E.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-E295-GC.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-E295.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-E335-GC.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-E335.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-E360-GC.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-E360.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-EN-GJL-100.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-EN-GJL-150.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-EN-GJL-200.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-EN-GJL-250.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-EN-GJL-300.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-EN-GJL-350.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-EN-GJMB-350-10.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-EN-GJMB-550-4.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-EN-GJMB-650-2.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-EN-GJMW-350-4.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-EN-GJMW-360-12.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-EN-GJMW-400-5.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-EN-GJMW-450-7.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-EN-GJS-400-15.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-EN-GJS-500-7.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-EN-GJS-600-3.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-EN-GJS-700-2.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-EN-GJS-800-1.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-G16Mn5.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-G200.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-G20Mn5.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-G230.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-G260.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-G300.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-G30Mn5.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-Generic.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-S185.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-S235JO.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-S235JR.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-S235JRG1.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-S260NC.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-S275JO.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-S275JR.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-S275N.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-S335JO.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-S335JR.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-S335N.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-S340MC.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-S355J2G3.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-S380MC.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-S420MC.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-S420N.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-S460MC.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-S460N.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-S500MC.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-S550MC.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-S690MC.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-St-37-2K.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-St-E-255.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-St-E-315.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-St-E-380.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-St-E-460.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-St-E-500.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-X2CrNiMoN17-13-3.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-X2CrNiN24-4.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-X39CrMo17-1.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-X3CrNiMo13-14.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-X5CrNi18-10.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-X5CrNiMo17-12-2.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/Steel-X6CrNiTi18-10.FCMat delete mode 100644 src/Mod/Material/StandardMaterial/TEMPLATE.FCMat delete mode 100755 src/Mod/Material/StandardMaterial/Ti-6Al-4V.FCMat delete mode 100755 src/Mod/Material/StandardMaterial/Tools/FCMat2csv.sh delete mode 100644 src/Mod/Material/StandardMaterial/Tools/Materials.csv delete mode 100644 src/Mod/Material/StandardMaterial/Tools/Materials.ods delete mode 100644 src/Mod/Material/StandardMaterial/Tools/README delete mode 100644 src/Mod/Material/StandardMaterial/Tools/headers delete mode 100755 src/Mod/Material/StandardMaterial/Tools/make_FCMats.sh delete mode 100755 src/Mod/Material/StandardMaterial/Tools/make_ods.sh delete mode 100644 src/Mod/Material/StandardMaterial/Tools/new_material_header delete mode 100644 src/Mod/Material/StandardMaterial/Wood-Generic.FCMat create mode 100644 src/Mod/Material/TestMaterialsApp.py create mode 100644 src/Mod/Material/materialtools/MaterialModels.py create mode 100644 src/Mod/Material/materialtools/Tools/ConvertFCMat.py create mode 100644 tests/src/Mod/Material/App/CMakeLists.txt create mode 100644 tests/src/Mod/Material/App/Model.cpp create mode 100644 tests/src/Mod/Material/CMakeLists.txt diff --git a/.github/workflows/actions/runCPPTests/runAllTests/action.yml b/.github/workflows/actions/runCPPTests/runAllTests/action.yml index a52adbd355..bdb434c220 100644 --- a/.github/workflows/actions/runCPPTests/runAllTests/action.yml +++ b/.github/workflows/actions/runCPPTests/runAllTests/action.yml @@ -47,6 +47,13 @@ runs: testCommand: ${{ inputs.builddir }}/tests/Tests_run --gtest_output=json:${{ inputs.reportdir }}core_gtest_results.json testLogFile: ${{ inputs.reportdir }}core_gtest_test_log.txt testName: Core + - name: C++ Material tests + id: material + uses: ./.github/workflows/actions/runCPPTests/runSingleTest + with: + testCommand: ${{ inputs.builddir }}/tests/Material_tests_run --gtest_output=json:${{ inputs.reportdir }}material_gtest_results.json + testLogFile: ${{ inputs.reportdir }}material_gtest_test_log.txt + testName: Material - name: C++ Mesh tests id: mesh uses: ./.github/workflows/actions/runCPPTests/runSingleTest diff --git a/CMakeLists.txt b/CMakeLists.txt index d1536fbc72..6e25357391 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,6 +51,7 @@ CheckInterModuleDependencies() FreeCADLibpackChecks() SetupDoxygen() SetupLibFmt() +SetupYamlCpp() if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER) SetupPython() SetupPCL() diff --git a/cMake/FreeCAD_Helpers/SetupLibYaml.cmake b/cMake/FreeCAD_Helpers/SetupLibYaml.cmake new file mode 100644 index 0000000000..3b6d1a37af --- /dev/null +++ b/cMake/FreeCAD_Helpers/SetupLibYaml.cmake @@ -0,0 +1,11 @@ +macro(SetupYamlCpp) +# -------------------------------- YamlCpp -------------------------------- + + find_package(yaml-cpp REQUIRED) + if(NOT yaml-cpp_FOUND) + message(FATAL_ERROR "==================\n" + "YamlCpp not found.\n" + "==================\n") + endif(NOT yaml-cpp_FOUND) + +endmacro(SetupYamlCpp) diff --git a/src/Mod/Fem/Gui/AppFemGui.cpp b/src/Mod/Fem/Gui/AppFemGui.cpp index d1dd8acf3f..1dd5e7a730 100644 --- a/src/Mod/Fem/Gui/AppFemGui.cpp +++ b/src/Mod/Fem/Gui/AppFemGui.cpp @@ -34,7 +34,6 @@ #include "DlgSettingsFemGeneralImp.h" #include "DlgSettingsFemGmshImp.h" #include "DlgSettingsFemInOutVtkImp.h" -#include "DlgSettingsFemMaterialImp.h" #include "DlgSettingsFemMystranImp.h" #include "DlgSettingsFemZ88Imp.h" #include "PropertyFemMeshItem.h" @@ -108,81 +107,85 @@ PyMOD_INIT_FUNC(FemGui) // clang-format off // addition objects - FemGui::Workbench ::init(); + FemGui::Workbench ::init(); - FemGui::ViewProviderFemAnalysis ::init(); - FemGui::ViewProviderFemAnalysisPython ::init(); + FemGui::ViewProviderFemAnalysis ::init(); + FemGui::ViewProviderFemAnalysisPython ::init(); - FemGui::ViewProviderFemConstraint ::init(); - FemGui::ViewProviderFemConstraintPython ::init(); + FemGui::ViewProviderFemConstraint ::init(); + FemGui::ViewProviderFemConstraintPython ::init(); - FemGui::ViewProviderFemConstraintOnBoundary ::init(); - FemGui::ViewProviderFemConstraintBearing ::init(); - FemGui::ViewProviderFemConstraintContact ::init(); - FemGui::ViewProviderFemConstraintDisplacement ::init(); - FemGui::ViewProviderFemConstraintFixed ::init(); - FemGui::ViewProviderFemConstraintFluidBoundary ::init(); - FemGui::ViewProviderFemConstraintForce ::init(); - FemGui::ViewProviderFemConstraintGear ::init(); - FemGui::ViewProviderFemConstraintHeatflux ::init(); - FemGui::ViewProviderFemConstraintInitialTemperature ::init(); - FemGui::ViewProviderFemConstraintPlaneRotation ::init(); - FemGui::ViewProviderFemConstraintPressure ::init(); - FemGui::ViewProviderFemConstraintPulley ::init(); - FemGui::ViewProviderFemConstraintTemperature ::init(); - FemGui::ViewProviderFemConstraintTransform ::init(); - FemGui::ViewProviderFemConstraintSpring ::init(); + FemGui::ViewProviderFemConstraintOnBoundary ::init(); + FemGui::ViewProviderFemConstraintBearing ::init(); + FemGui::ViewProviderFemConstraintContact ::init(); + FemGui::ViewProviderFemConstraintDisplacement ::init(); + FemGui::ViewProviderFemConstraintFixed ::init(); + FemGui::ViewProviderFemConstraintFluidBoundary ::init(); + FemGui::ViewProviderFemConstraintForce ::init(); + FemGui::ViewProviderFemConstraintGear ::init(); + FemGui::ViewProviderFemConstraintHeatflux ::init(); + FemGui::ViewProviderFemConstraintInitialTemperature ::init(); + FemGui::ViewProviderFemConstraintPlaneRotation ::init(); + FemGui::ViewProviderFemConstraintPressure ::init(); + FemGui::ViewProviderFemConstraintPulley ::init(); + FemGui::ViewProviderFemConstraintTemperature ::init(); + FemGui::ViewProviderFemConstraintTransform ::init(); + FemGui::ViewProviderFemConstraintSpring ::init(); - FemGui::ViewProviderFemMesh ::init(); - FemGui::ViewProviderFemMeshPython ::init(); - FemGui::ViewProviderFemMeshShape ::init(); - FemGui::ViewProviderFemMeshShapeNetgen ::init(); - FemGui::PropertyFemMeshItem ::init(); + FemGui::ViewProviderFemMesh ::init(); + FemGui::ViewProviderFemMeshPython ::init(); + FemGui::ViewProviderFemMeshShape ::init(); + FemGui::ViewProviderFemMeshShapeNetgen ::init(); + FemGui::PropertyFemMeshItem ::init(); - FemGui::ViewProviderSetElements ::init(); - FemGui::ViewProviderSetFaces ::init(); - FemGui::ViewProviderSetGeometry ::init(); - FemGui::ViewProviderSetNodes ::init(); + FemGui::ViewProviderSetElements ::init(); + FemGui::ViewProviderSetFaces ::init(); + FemGui::ViewProviderSetGeometry ::init(); + FemGui::ViewProviderSetNodes ::init(); - FemGui::ViewProviderSolver ::init(); - FemGui::ViewProviderSolverPython ::init(); + FemGui::ViewProviderSolver ::init(); + FemGui::ViewProviderSolverPython ::init(); - FemGui::ViewProviderResult ::init(); - FemGui::ViewProviderResultPython ::init(); + FemGui::ViewProviderResult ::init(); + FemGui::ViewProviderResultPython ::init(); #ifdef FC_USE_VTK - FemGui::ViewProviderFemPostObject ::init(); - FemGui::ViewProviderFemPostPipeline ::init(); - FemGui::ViewProviderFemPostClip ::init(); - FemGui::ViewProviderFemPostContours ::init(); - FemGui::ViewProviderFemPostCut ::init(); - FemGui::ViewProviderFemPostDataAlongLine ::init(); - FemGui::ViewProviderFemPostDataAtPoint ::init(); - FemGui::ViewProviderFemPostScalarClip ::init(); - FemGui::ViewProviderFemPostWarpVector ::init(); + FemGui::ViewProviderFemPostObject ::init(); + FemGui::ViewProviderFemPostPipeline ::init(); + FemGui::ViewProviderFemPostClip ::init(); + FemGui::ViewProviderFemPostContours ::init(); + FemGui::ViewProviderFemPostCut ::init(); + FemGui::ViewProviderFemPostDataAlongLine ::init(); + FemGui::ViewProviderFemPostDataAtPoint ::init(); + FemGui::ViewProviderFemPostScalarClip ::init(); + FemGui::ViewProviderFemPostWarpVector ::init(); - FemGui::ViewProviderFemPostFunction ::init(); - FemGui::ViewProviderFemPostFunctionProvider ::init(); - FemGui::ViewProviderFemPostBoxFunction ::init(); - FemGui::ViewProviderFemPostCylinderFunction ::init(); - FemGui::ViewProviderFemPostPlaneFunction ::init(); - FemGui::ViewProviderFemPostSphereFunction ::init(); + FemGui::ViewProviderFemPostFunction ::init(); + FemGui::ViewProviderFemPostFunctionProvider ::init(); + FemGui::ViewProviderFemPostBoxFunction ::init(); + FemGui::ViewProviderFemPostCylinderFunction ::init(); + FemGui::ViewProviderFemPostPlaneFunction ::init(); + FemGui::ViewProviderFemPostSphereFunction ::init(); #endif - // register preferences pages on FEM, the order here will be the order of the tabs in pref widget - new Gui::PrefPageProducer(QT_TRANSLATE_NOOP("QObject", "FEM")); + // register preferences pages on FEM, the order here will be the order of the tabs in pref + // widget + new Gui::PrefPageProducer( + QT_TRANSLATE_NOOP("QObject", "FEM")); new Gui::PrefPageProducer(QT_TRANSLATE_NOOP("QObject", "FEM")); new Gui::PrefPageProducer(QT_TRANSLATE_NOOP("QObject", "FEM")); new Gui::PrefPageProducer(QT_TRANSLATE_NOOP("QObject", "FEM")); - new Gui::PrefPageProducer(QT_TRANSLATE_NOOP("QObject", "FEM")); + new Gui::PrefPageProducer( + QT_TRANSLATE_NOOP("QObject", "FEM")); new Gui::PrefPageProducer(QT_TRANSLATE_NOOP("QObject", "FEM")); - new Gui::PrefPageProducer(QT_TRANSLATE_NOOP("QObject", "FEM")); // register preferences pages on Import-Export - new Gui::PrefPageProducer(QT_TRANSLATE_NOOP("QObject", "Import-Export")); - new Gui::PrefPageProducer(QT_TRANSLATE_NOOP("QObject", "Import-Export")); + new Gui::PrefPageProducer( + QT_TRANSLATE_NOOP("QObject", "Import-Export")); + new Gui::PrefPageProducer( + QT_TRANSLATE_NOOP("QObject", "Import-Export")); // add resources and reloads the translators loadFemResource(); diff --git a/src/Mod/Fem/Gui/CMakeLists.txt b/src/Mod/Fem/Gui/CMakeLists.txt index 625c85150f..af0fb7fcd6 100755 --- a/src/Mod/Fem/Gui/CMakeLists.txt +++ b/src/Mod/Fem/Gui/CMakeLists.txt @@ -1,8 +1,8 @@ - # Many warnings caused by vtk if(CMAKE_COMPILER_IS_CLANGXX) add_compile_options(-Wno-pedantic) # needed for vtk headers - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.0) + + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.0) add_compile_options(-Wno-inconsistent-missing-override) endif() elseif(CMAKE_COMPILER_IS_GNUCXX) @@ -15,12 +15,10 @@ else(MSVC) add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H) endif(MSVC) - if(BUILD_FEM_NETGEN) add_definitions(-DFCWithNetgen) endif(BUILD_FEM_NETGEN) - include_directories( ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/src @@ -37,18 +35,15 @@ include_directories( link_directories(${OCC_LIBRARY_DIR}) link_directories(${SMESH_LIB_PATH}) - set(FemGui_LIBS Fem FreeCADGui PartGui ) - generate_from_xml(ViewProviderFemMeshPy) generate_from_xml(ViewProviderFemPostPipelinePy) - SET(Python_SRCS ViewProviderFemMeshPy.xml ViewProviderFemMeshPyImp.cpp @@ -57,7 +52,6 @@ SET(Python_SRCS ) SOURCE_GROUP("Python" FILES ${Python_SRCS}) - set(FemGui_UIC_SRCS DlgSettingsFemCcx.ui DlgSettingsFemElmer.ui @@ -65,7 +59,6 @@ set(FemGui_UIC_SRCS DlgSettingsFemGeneral.ui DlgSettingsFemGmsh.ui DlgSettingsFemInOutVtk.ui - DlgSettingsFemMaterial.ui DlgSettingsFemMystran.ui DlgSettingsFemZ88.ui TaskCreateNodeSet.ui @@ -88,6 +81,7 @@ set(FemGui_UIC_SRCS TaskAnalysisInfo.ui TaskDriver.ui ) + if(BUILD_FEM_VTK) set(FemGui_UIC_SRCS ${FemGui_UIC_SRCS} @@ -126,9 +120,6 @@ SET(FemGui_DLG_SRCS DlgSettingsFemInOutVtk.ui DlgSettingsFemInOutVtkImp.cpp DlgSettingsFemInOutVtkImp.h - DlgSettingsFemMaterial.ui - DlgSettingsFemMaterialImp.cpp - DlgSettingsFemMaterialImp.h DlgSettingsFemMystran.ui DlgSettingsFemMystranImp.cpp DlgSettingsFemMystranImp.h @@ -186,14 +177,13 @@ SET(FemGui_DLG_SRCS ) SOURCE_GROUP("Constraint-Dialogs" FILES ${FemGui_DLG_SRCS}) -set (Fem_TR_QRC ${CMAKE_CURRENT_BINARY_DIR}/Resources/Fem_translation.qrc) +set(Fem_TR_QRC ${CMAKE_CURRENT_BINARY_DIR}/Resources/Fem_translation.qrc) qt_find_and_add_translation(QM_SRCS "Resources/translations/*_*.ts" ${CMAKE_CURRENT_BINARY_DIR}/Resources/translations) qt_create_resource_file(${Fem_TR_QRC} ${QM_SRCS}) qt_add_resources(FemResource_SRCS Resources/Fem.qrc ${Fem_TR_QRC}) SOURCE_GROUP("Resources" FILES ${FemResource_SRCS}) - SET(FemGui_SRCS_ViewProvider ViewProviderFemMesh.cpp ViewProviderFemMesh.h @@ -254,7 +244,6 @@ SET(FemGui_SRCS_ViewProvider ) SOURCE_GROUP("ViewProvider" FILES ${FemGui_SRCS_ViewProvider}) - SET(FemGui_SRCS_TaskBoxes TaskObjectName.ui TaskObjectName.cpp @@ -272,6 +261,7 @@ SET(FemGui_SRCS_TaskBoxes TaskTetParameter.cpp TaskTetParameter.h ) + if(BUILD_FEM_VTK) SET(FemGui_SRCS_TaskBoxes ${FemGui_SRCS_TaskBoxes} @@ -291,8 +281,8 @@ if(BUILD_FEM_VTK) TaskPostWarpVector.ui ) endif(BUILD_FEM_VTK) -SOURCE_GROUP("Task_Boxes" FILES ${FemGui_SRCS_TaskBoxes}) +SOURCE_GROUP("Task_Boxes" FILES ${FemGui_SRCS_TaskBoxes}) SET(FemGui_SRCS_TaskDlg TaskDlgCreateNodeSet.h @@ -304,7 +294,6 @@ SET(FemGui_SRCS_TaskDlg ) SOURCE_GROUP("Task_Dialogs" FILES ${FemGui_SRCS_TaskDlg}) - SET(FemGui_SRCS_Module AppFemGui.cpp AppFemGuiPy.cpp @@ -325,7 +314,6 @@ SET(FemGui_SRCS_Module ) SOURCE_GROUP("Module" FILES ${FemGui_SRCS_Module}) - if(BUILD_FEM_VTK) SET(FemGui_SRCS_Post ViewProviderFemPostObject.h @@ -336,11 +324,10 @@ if(BUILD_FEM_VTK) ViewProviderFemPostFunction.cpp ViewProviderFemPostFilter.h ViewProviderFemPostFilter.cpp - ) + ) SOURCE_GROUP("PostObjects" FILES ${FemGui_SRCS_Post}) endif(BUILD_FEM_VTK) - SET(FemGui_SRCS ${Python_SRCS} ${FemGui_DLG_SRCS} @@ -365,13 +352,10 @@ SET(FemGuiIcon_SVG add_library(FemGui SHARED ${FemGui_SRCS} ${FemGuiIcon_SVG}) target_link_libraries(FemGui ${FemGui_LIBS} ${VTK_LIBRARIES}) - fc_copy_sources(FemGui "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Fem" ${FemGuiIcon_SVG}) - INSTALL(FILES ${FemGuiIcon_SVG} DESTINATION "${CMAKE_INSTALL_DATADIR}/Mod/Fem/Resources/icons") - # Python modules ui files, they are copied as they are, thus the need not to be added to Fem.qrc # see https://forum.freecad.org/viewtopic.php?f=10&t=25833 SET(FemGuiPythonUI_SRCS @@ -409,10 +393,7 @@ fc_copy_sources(FemPythonUi "${CMAKE_BINARY_DIR}/Mod/Fem" ${FemGuiPythonUI_SRCS} INSTALL(FILES ${FemGuiPythonUI_SRCS} DESTINATION Mod/Fem/Resources/ui) - - SET_BIN_DIR(FemGui FemGui /Mod/Fem) SET_PYTHON_PREFIX_SUFFIX(FemGui) - INSTALL(TARGETS FemGui DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/src/Mod/Material/App/AppMaterial.cpp b/src/Mod/Material/App/AppMaterial.cpp new file mode 100644 index 0000000000..2f0ed8a40f --- /dev/null +++ b/src/Mod/Material/App/AppMaterial.cpp @@ -0,0 +1,76 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License (LGPL) * + * as published by the Free Software Foundation; either version 2 of * + * the License, or (at your option) any later version. * + * for detail see the LICENCE text file. * + * * + * FreeCAD is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with FreeCAD; if not, write to the Free Software * + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * + * USA * + * * + ***************************************************************************/ + + +#include "PreCompiled.h" +#ifndef _PreComp_ +#endif + +#include +#include +#include + +// #include "Model.h" +#include "MaterialManagerPy.h" +#include "MaterialPy.h" +#include "ModelManagerPy.h" +#include "ModelPropertyPy.h" +#include "ModelPy.h" + +namespace Materials +{ +class Module: public Py::ExtensionModule +{ +public: + Module() + : Py::ExtensionModule("Material") + { + initialize("This module is the Material module.");// register with Python + } + + ~Module() override = default; + +private: +}; + +PyObject* initModule() +{ + return Base::Interpreter().addModule(new Module); +} + +}// namespace Materials + +PyMOD_INIT_FUNC(Material) +{ + PyObject* module = Materials::initModule(); + + Base::Console().Log("Loading Material module... done\n"); + + Base::Interpreter().addType(&Materials::MaterialManagerPy ::Type, module, "MaterialManager"); + Base::Interpreter().addType(&Materials::MaterialPy ::Type, module, "Material"); + Base::Interpreter().addType(&Materials::ModelManagerPy ::Type, module, "ModelManager"); + Base::Interpreter().addType(&Materials::ModelPropertyPy ::Type, module, "ModelProperty"); + Base::Interpreter().addType(&Materials::ModelPy ::Type, module, "Model"); + + PyMOD_Return(module); +} diff --git a/src/Mod/Material/App/CMakeLists.txt b/src/Mod/Material/App/CMakeLists.txt new file mode 100644 index 0000000000..21258ea53a --- /dev/null +++ b/src/Mod/Material/App/CMakeLists.txt @@ -0,0 +1,99 @@ +if(MSVC) + add_definitions(-DFCAppMaterial -DHAVE_ACOSH -DHAVE_ASINH -DHAVE_ATANH) +else(MSVC) + add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H) +endif(MSVC) + +add_definitions(-DYAML_CPP_STATIC_DEFINE) + +include_directories( + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}/src + ${CMAKE_SOURCE_DIR}/src + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${Boost_INCLUDE_DIRS} + ${PYTHON_INCLUDE_DIRS} + ${XercesC_INCLUDE_DIRS} + ${ZLIB_INCLUDE_DIR} + ${YAML_CPP_INCLUDE_DIR} +) +link_directories(${YAML_CPP_LIBRARY_DIR}) + +set(Material_LIBS + ${Boost_LIBRARIES} + FreeCADApp +) + +include_directories( + ${QtConcurrent_INCLUDE_DIRS} +) +list(APPEND Material_LIBS + ${QtConcurrent_LIBRARIES} + ${YAML_CPP_LIBRARIES} +) + +generate_from_xml(MaterialManagerPy) +generate_from_xml(MaterialPy) +generate_from_xml(ModelManagerPy) +generate_from_xml(ModelPropertyPy) +generate_from_xml(ModelPy) + +SET(Python_SRCS + Exceptions.h + MaterialManagerPy.xml + MaterialManagerPyImpl.cpp + MaterialPy.xml + MaterialPyImpl.cpp + ModelManagerPy.xml + ModelManagerPyImpl.cpp + ModelPropertyPy.xml + ModelPropertyPyImpl.cpp + ModelPy.xml + ModelPyImpl.cpp +) +SOURCE_GROUP("Python" FILES ${Python_SRCS}) + +SET(Material_SRCS + ${Python_SRCS} + AppMaterial.cpp + FolderTree.h + MaterialConfigLoader.cpp + MaterialConfigLoader.h + MaterialLibrary.cpp + MaterialLibrary.h + MaterialLoader.cpp + MaterialLoader.h + MaterialManager.cpp + MaterialManager.h + Materials.cpp + Materials.h + MaterialValue.cpp + MaterialValue.h + Model.cpp + Model.h + ModelLibrary.cpp + ModelLibrary.h + ModelLoader.cpp + ModelLoader.h + ModelManager.cpp + ModelManager.h + ModelUuids.h + PreCompiled.cpp + PreCompiled.h + trim.h +) + +if(FREECAD_USE_PCH) + add_definitions(-D_PreComp_) + GET_MSVC_PRECOMPILED_SOURCE("PreCompiled.cpp" PCH_SRCS ${Material_SRCS}) + ADD_MSVC_PRECOMPILED_HEADER(Material PreCompiled.h PreCompiled.cpp PCH_SRCS) +endif(FREECAD_USE_PCH) + +add_library(Material SHARED ${Material_SRCS}) +target_link_libraries(Material ${Material_LIBS}) + +SET_BIN_DIR(Material Material /Mod/Material) +SET_PYTHON_PREFIX_SUFFIX(Material) + +INSTALL(TARGETS Material DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/src/Mod/Material/App/Exceptions.h b/src/Mod/Material/App/Exceptions.h new file mode 100644 index 0000000000..3a70f7260e --- /dev/null +++ b/src/Mod/Material/App/Exceptions.h @@ -0,0 +1,154 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATERIAL_EXCEPTIONS_H +#define MATERIAL_EXCEPTIONS_H + +#include +#include + +namespace Materials +{ + +class Uninitialized: public Base::Exception +{ +public: + Uninitialized() + {} + explicit Uninitialized(const char* msg) + { + this->setMessage(msg); + } + ~Uninitialized() throw() override = default; +}; + +class ModelNotFound: public Base::Exception +{ +public: + ModelNotFound() + {} + explicit ModelNotFound(const char* msg) + { + this->setMessage(msg); + } + ~ModelNotFound() throw() override = default; +}; + +class MaterialNotFound: public Base::Exception +{ +public: + MaterialNotFound() + {} + explicit MaterialNotFound(const char* msg) + { + this->setMessage(msg); + } + ~MaterialNotFound() throw() override = default; +}; + +class PropertyNotFound: public Base::Exception +{ +public: + PropertyNotFound() + {} + explicit PropertyNotFound(const char* msg) + { + this->setMessage(msg); + } + ~PropertyNotFound() throw() override = default; +}; + +class LibraryNotFound: public Base::Exception +{ +public: + LibraryNotFound() + {} + explicit LibraryNotFound(const char* msg) + { + this->setMessage(msg); + } + ~LibraryNotFound() throw() override = default; +}; + +class InvalidModel: public Base::Exception +{ +public: + InvalidModel() + {} + explicit InvalidModel(const char* msg) + { + this->setMessage(msg); + } + ~InvalidModel() throw() override = default; +}; + +class InvalidRow: public Base::Exception +{ +public: + InvalidRow() + {} + explicit InvalidRow(char* msg) + { + this->setMessage(msg); + } + ~InvalidRow() throw() override = default; +}; + +class InvalidColumn: public Base::Exception +{ +public: + InvalidColumn() + {} + explicit InvalidColumn(char* msg) + { + this->setMessage(msg); + } + ~InvalidColumn() throw() override = default; +}; + +class InvalidIndex: public Base::Exception +{ +public: + InvalidIndex() + {} + explicit InvalidIndex(char* msg) + { + this->setMessage(msg); + } + ~InvalidIndex() throw() override = default; +}; + +class UnknownValueType: public Base::Exception +{ +public: + UnknownValueType() + {} + explicit UnknownValueType(char* msg) + { + this->setMessage(msg); + } + ~UnknownValueType() throw() override = default; +}; + +}// namespace Materials + +#endif// MATERIAL_EXCEPTIONS_H diff --git a/src/Mod/Material/App/FolderTree.h b/src/Mod/Material/App/FolderTree.h new file mode 100644 index 0000000000..779f1ee0ec --- /dev/null +++ b/src/Mod/Material/App/FolderTree.h @@ -0,0 +1,87 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATERIAL_FOLDERTREE_H +#define MATERIAL_FOLDERTREE_H + +#include +#include + +namespace Materials +{ + +template +class FolderTreeNode +{ +public: + enum NodeType + { + DataNode, + FolderNode + }; + + FolderTreeNode() + {} + virtual ~FolderTreeNode() = default; + + NodeType getType(void) const + { + return _type; + } + void setType(NodeType type) + { + _type = type; + } + + const std::map*>* getFolder(void) const + { + return _folder; + } + std::map*>* getFolder(void) + { + return _folder; + } + const T* getData(void) const + { + return _data; + } + + void setFolder(std::map*>* folder) + { + setType(FolderNode); + _folder = folder; + } + void setData(const T* data) + { + setType(DataNode); + _data = data; + } + +private: + NodeType _type; + std::map*>* _folder; + const T* _data; +}; + +}// namespace Materials + +#endif// MATERIAL_FOLDERTREE_H diff --git a/src/Mod/Material/App/MaterialConfigLoader.cpp b/src/Mod/Material/App/MaterialConfigLoader.cpp new file mode 100644 index 0000000000..4796c83100 --- /dev/null +++ b/src/Mod/Material/App/MaterialConfigLoader.cpp @@ -0,0 +1,396 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" +#ifndef _PreComp_ +#include +#include +#include +#endif + +#include + +#include +#include +#include + + +#include "MaterialConfigLoader.h" +#include "MaterialLoader.h" +#include "Model.h" +#include "ModelUuids.h" + + +using namespace Materials; + +MaterialConfigLoader::MaterialConfigLoader() +{} + +bool MaterialConfigLoader::isConfigStyle(const QString& path) +{ + std::ifstream infile(path.toStdString()); + + // Check the first 2 lines for a ";" + for (int i = 0; i < 2; i++) { + std::string line; + if (!std::getline(infile, line)) { + return false; + } + if (line.at(0) != ';') { + return false; + } + } + + return true; +} + +QString MaterialConfigLoader::getAuthorAndLicense(const QString& path) +{ + std::ifstream infile(path.toStdString()); + QString noAuthor; + + // Skip the first line + std::string line; + if (!std::getline(infile, line)) { + return noAuthor; + } + + // The second line has it in a comment + if (!std::getline(infile, line)) { + return noAuthor; + } + std::size_t found = line.find(";"); + if (found != std::string::npos) { + return QString::fromStdString(trim_copy(line.substr(found + 1))); + } + + return noAuthor; +} + +void MaterialConfigLoader::addVectorRendering(const QSettings& fcmat, Material* finalModel) +{ + QString sectionFillPattern = value(fcmat, "VectorRendering/SectionFillPattern", ""); + QString sectionLinewidth = value(fcmat, "VectorRendering/SectionLinewidth", ""); + QString sectionColor = value(fcmat, "VectorRendering/SectionColor", ""); + QString viewColor = value(fcmat, "VectorRendering/ViewColor", ""); + QString viewFillPattern = value(fcmat, "VectorRendering/ViewFillPattern", ""); + QString viewLinewidth = value(fcmat, "VectorRendering/ViewLinewidth", ""); + + if (sectionFillPattern.length() + sectionLinewidth.length() + sectionColor.length() + + viewColor.length() + viewFillPattern.length() + viewLinewidth.length() + > 0) { + finalModel->addAppearance(ModelUUID_Rendering_Vector); + } + + // Now add the data + setAppearanceValue(finalModel, "SectionFillPattern", sectionFillPattern); + setAppearanceValue(finalModel, "SectionLinewidth", sectionLinewidth); + setAppearanceValue(finalModel, "SectionColor", sectionColor); + setAppearanceValue(finalModel, "ViewColor", viewColor); + setAppearanceValue(finalModel, "ViewFillPattern", viewFillPattern); + setAppearanceValue(finalModel, "ViewLinewidth", viewLinewidth); +} + +void MaterialConfigLoader::addRendering(const QSettings& fcmat, Material* finalModel) +{ + QString ambientColor = value(fcmat, "Rendering/AmbientColor", ""); + QString diffuseColor = value(fcmat, "Rendering/DiffuseColor", ""); + QString emissiveColor = value(fcmat, "Rendering/EmissiveColor", ""); + QString shininess = value(fcmat, "Rendering/Shininess", ""); + QString specularColor = value(fcmat, "Rendering/SpecularColor", ""); + QString transparency = value(fcmat, "Rendering/Transparency", ""); + QString texturePath = value(fcmat, "Rendering/TexturePath", ""); + QString textureScaling = value(fcmat, "Rendering/TextureScaling", ""); + QString fragmentShader = value(fcmat, "Rendering/FragmentShader", ""); + QString vertexShader = value(fcmat, "Rendering/VertexShader", ""); + + // Check which model we need + bool useTexture = false; + bool useAdvanced = false; + bool useBasic = false; + if (texturePath.length() + textureScaling.length() > 0) { + useTexture = true; + } + if (fragmentShader.length() + vertexShader.length() > 0) { + useAdvanced = true; + } + if (ambientColor.length() + diffuseColor.length() + emissiveColor.length() + shininess.length() + + specularColor.length() + transparency.length() + > 0) { + useBasic = true; + } + + if (useAdvanced) { + finalModel->addAppearance(ModelUUID_Rendering_Advanced); + } + else if (useTexture) { + finalModel->addAppearance(ModelUUID_Rendering_Texture); + } + else if (useBasic) { + finalModel->addAppearance(ModelUUID_Rendering_Basic); + } + + // Now add the data + setAppearanceValue(finalModel, "AmbientColor", ambientColor); + setAppearanceValue(finalModel, "DiffuseColor", diffuseColor); + setAppearanceValue(finalModel, "EmissiveColor", emissiveColor); + setAppearanceValue(finalModel, "Shininess", shininess); + setAppearanceValue(finalModel, "SpecularColor", specularColor); + setAppearanceValue(finalModel, "Transparency", transparency); + setAppearanceValue(finalModel, "TexturePath", texturePath); + setAppearanceValue(finalModel, "TextureScaling", textureScaling); + setAppearanceValue(finalModel, "FragmentShader", fragmentShader); + setAppearanceValue(finalModel, "VertexShader", vertexShader); +} + +void MaterialConfigLoader::addCosts(const QSettings& fcmat, Material* finalModel) +{ + QString productURL = value(fcmat, "Cost/ProductURL", ""); + QString specificPrice = value(fcmat, "Cost/SpecificPrice", ""); + QString vendor = value(fcmat, "Cost/Vendor", ""); + + if (productURL.length() + specificPrice.length() + vendor.length() > 0) { + finalModel->addPhysical(ModelUUID_Costs_Default); + } + + // Now add the data + setPhysicalValue(finalModel, "ProductURL", productURL); + setPhysicalValue(finalModel, "SpecificPrice", specificPrice); + setPhysicalValue(finalModel, "Vendor", vendor); +} + +void MaterialConfigLoader::addArchitectural(const QSettings& fcmat, Material* finalModel) +{ + QString color = value(fcmat, "Architectural/Color", ""); + QString environmentalEfficiencyClass = + value(fcmat, "Architectural/EnvironmentalEfficiencyClass", ""); + QString executionInstructions = value(fcmat, "Architectural/ExecutionInstructions", ""); + QString finish = value(fcmat, "Architectural/Finish", ""); + QString fireResistanceClass = value(fcmat, "Architectural/FireResistanceClass", ""); + QString model = value(fcmat, "Architectural/Model", ""); + QString soundTransmissionClass = value(fcmat, "Architectural/SoundTransmissionClass", ""); + QString unitsPerQuantity = value(fcmat, "Architectural/UnitsPerQuantity", ""); + + if (color.length() + environmentalEfficiencyClass.length() + executionInstructions.length() + + finish.length() + fireResistanceClass.length() + model.length() + + soundTransmissionClass.length() + unitsPerQuantity.length() + > 0) { + finalModel->addPhysical(ModelUUID_Architectural_Default); + } + + // Now add the data + setPhysicalValue(finalModel, "Color", color); + setPhysicalValue(finalModel, "EnvironmentalEfficiencyClass", environmentalEfficiencyClass); + setPhysicalValue(finalModel, "ExecutionInstructions", executionInstructions); + setPhysicalValue(finalModel, "Finish", finish); + setPhysicalValue(finalModel, "FireResistanceClass", fireResistanceClass); + setPhysicalValue(finalModel, "Model", model); + setPhysicalValue(finalModel, "SoundTransmissionClass", soundTransmissionClass); + setPhysicalValue(finalModel, "UnitsPerQuantity", unitsPerQuantity); +} + +void MaterialConfigLoader::addElectromagnetic(const QSettings& fcmat, Material* finalModel) +{ + QString relativePermittivity = value(fcmat, "Electromagnetic/RelativePermittivity", ""); + QString electricalConductivity = value(fcmat, "Electromagnetic/ElectricalConductivity", ""); + QString relativePermeability = value(fcmat, "Electromagnetic/RelativePermeability", ""); + + if (relativePermittivity.length() + electricalConductivity.length() + + relativePermeability.length() + > 0) { + finalModel->addPhysical(ModelUUID_Electromagnetic_Default); + } + + // Now add the data + setPhysicalValue(finalModel, "RelativePermittivity", relativePermittivity); + setPhysicalValue(finalModel, "ElectricalConductivity", electricalConductivity); + setPhysicalValue(finalModel, "RelativePermeability", relativePermeability); +} + +void MaterialConfigLoader::addThermal(const QSettings& fcmat, Material* finalModel) +{ + QString specificHeat = value(fcmat, "Thermal/SpecificHeat", ""); + QString thermalConductivity = value(fcmat, "Thermal/ThermalConductivity", ""); + QString thermalExpansionCoefficient = value(fcmat, "Thermal/ThermalExpansionCoefficient", ""); + + if (specificHeat.length() + thermalConductivity.length() + thermalExpansionCoefficient.length() + > 0) { + finalModel->addPhysical(ModelUUID_Thermal_Default); + } + + // Now add the data + setPhysicalValue(finalModel, "SpecificHeat", specificHeat); + setPhysicalValue(finalModel, "ThermalConductivity", thermalConductivity); + setPhysicalValue(finalModel, "ThermalExpansionCoefficient", thermalExpansionCoefficient); +} + +void MaterialConfigLoader::addFluid(const QSettings& fcmat, Material* finalModel) +{ + QString density = value(fcmat, "Fluidic/Density", ""); + QString dynamicViscosity = value(fcmat, "Fluidic/DynamicViscosity", ""); + QString kinematicViscosity = value(fcmat, "Fluidic/KinematicViscosity", ""); + QString prandtlNumber = value(fcmat, "Fluidic/PrandtlNumber", ""); + + // Check which model we need + bool useDensity = false; + bool useFluid = false; + if (density.length() > 0) { + useDensity = true; + } + if (dynamicViscosity.length() + kinematicViscosity.length() + prandtlNumber.length() > 0) { + useFluid = true; + } + + if (useFluid) { + finalModel->addPhysical(ModelUUID_Fluid_Default); + } + else if (useDensity) { + finalModel->addPhysical(ModelUUID_Mechanical_Density); + } + + // Now add the data + setPhysicalValue(finalModel, "Density", density); + setPhysicalValue(finalModel, "DynamicViscosity", dynamicViscosity); + setPhysicalValue(finalModel, "KinematicViscosity", kinematicViscosity); + setPhysicalValue(finalModel, "PrandtlNumber", prandtlNumber); +} + +void MaterialConfigLoader::addMechanical(const QSettings& fcmat, Material* finalModel) +{ + QString density = value(fcmat, "Mechanical/Density", ""); + QString bulkModulus = value(fcmat, "Mechanical/BulkModulus", ""); + QString poissonRatio = value(fcmat, "Mechanical/PoissonRatio", ""); + QString shearModulus = value(fcmat, "Mechanical/ShearModulus", ""); + QString youngsModulus = value(fcmat, "Mechanical/YoungsModulus", ""); + QString angleOfFriction = value(fcmat, "Mechanical/AngleOfFriction", ""); + QString compressiveStrength = value(fcmat, "Mechanical/CompressiveStrength", ""); + QString fractureToughness = value(fcmat, "Mechanical/FractureToughness", ""); + QString ultimateStrain = value(fcmat, "Mechanical/UltimateStrain", ""); + QString ultimateTensileStrength = value(fcmat, "Mechanical/UltimateTensileStrength", ""); + QString yieldStrength = value(fcmat, "Mechanical/YieldStrength", ""); + QString stiffness = value(fcmat, "Mechanical/Stiffness", ""); + + // Check which model we need + bool useDensity = false; + bool useIso = false; + bool useLinearElastic = false; + if (density.length() > 0) { + useDensity = true; + } + if (bulkModulus.length() + poissonRatio.length() + shearModulus.length() + + youngsModulus.length() + > 0) { + useIso = true; + } + if (angleOfFriction.length() + compressiveStrength.length() + fractureToughness.length() + + ultimateStrain.length() + ultimateTensileStrength.length() + yieldStrength.length() + + stiffness.length() + > 0) { + useLinearElastic = true; + } + + if (useLinearElastic) { + finalModel->addPhysical(ModelUUID_Mechanical_LinearElastic); + } + else { + if (useIso) { + finalModel->addPhysical(ModelUUID_Mechanical_IsotropicLinearElastic); + } + if (useDensity) { + finalModel->addPhysical(ModelUUID_Mechanical_Density); + } + } + + // Now add the data + setPhysicalValue(finalModel, "Density", density); + setPhysicalValue(finalModel, "BulkModulus", bulkModulus); + setPhysicalValue(finalModel, "PoissonRatio", poissonRatio); + setPhysicalValue(finalModel, "ShearModulus", shearModulus); + setPhysicalValue(finalModel, "YoungsModulus", youngsModulus); + setPhysicalValue(finalModel, "AngleOfFriction", angleOfFriction); + setPhysicalValue(finalModel, "CompressiveStrength", compressiveStrength); + setPhysicalValue(finalModel, "FractureToughness", fractureToughness); + setPhysicalValue(finalModel, "UltimateStrain", ultimateStrain); + setPhysicalValue(finalModel, "UltimateTensileStrength", ultimateTensileStrength); + setPhysicalValue(finalModel, "YieldStrength", yieldStrength); + setPhysicalValue(finalModel, "Stiffness", stiffness); +} + +Material* MaterialConfigLoader::getMaterialFromPath(const MaterialLibrary& library, + const QString& path) +{ + QString authorAndLicense = getAuthorAndLicense(path); + + QSettings fcmat(path, QSettings::IniFormat); + + // General section + // QString name = value(fcmat, "Name", ""); - always get the name from the filename + QFileInfo filepath(path); + QString name = + filepath.fileName().remove(QString::fromStdString(".FCMat"), Qt::CaseInsensitive); + QString uuid = QUuid::createUuid().toString(QUuid::WithoutBraces); + + QString description = value(fcmat, "Description", ""); + QString sourceReference = value(fcmat, "ReferenceSource", ""); + QString sourceURL = value(fcmat, "SourceURL", ""); + + Material* finalModel = new Material(library, path, uuid, name); + finalModel->setAuthorAndLicense(authorAndLicense); + finalModel->setDescription(description); + finalModel->setReference(sourceReference); + finalModel->setURL(sourceURL); + + QString father = value(fcmat, "Father", ""); + if (father.length() > 0) { + finalModel->addPhysical(ModelUUID_Legacy_Father); + + // Now add the data + setPhysicalValue(finalModel, "Father", father); + } + + QString kindOfMaterial = value(fcmat, "KindOfMaterial", ""); + QString materialNumber = value(fcmat, "MaterialNumber", ""); + QString norm = value(fcmat, "Norm", ""); + QString standardCode = value(fcmat, "StandardCode", ""); + if (kindOfMaterial.length() + materialNumber.length() + norm.length() + standardCode.length() + > 0) { + finalModel->addPhysical(ModelUUID_Legacy_MaterialStandard); + + // Now add the data + setPhysicalValue(finalModel, "KindOfMaterial", kindOfMaterial); + setPhysicalValue(finalModel, "MaterialNumber", materialNumber); + setPhysicalValue(finalModel, "StandardCode", norm);// Norm is the same as StandardCode + setPhysicalValue(finalModel, "StandardCode", standardCode); + } + + // Add the remaining sections + addMechanical(fcmat, finalModel); + addFluid(fcmat, finalModel); + addThermal(fcmat, finalModel); + addElectromagnetic(fcmat, finalModel); + addArchitectural(fcmat, finalModel); + addCosts(fcmat, finalModel); + addRendering(fcmat, finalModel); + addVectorRendering(fcmat, finalModel); + + return finalModel; +} diff --git a/src/Mod/Material/App/MaterialConfigLoader.h b/src/Mod/Material/App/MaterialConfigLoader.h new file mode 100644 index 0000000000..06a923c175 --- /dev/null +++ b/src/Mod/Material/App/MaterialConfigLoader.h @@ -0,0 +1,81 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATERIAL_MATERIALCONFIGLOADER_H +#define MATERIAL_MATERIALCONFIGLOADER_H + +#include +#include +#include + +#include "Materials.h" + +namespace Materials +{ + +class MaterialConfigLoader +{ +public: + MaterialConfigLoader(); + virtual ~MaterialConfigLoader() = default; + + + static bool isConfigStyle(const QString& path); + static Material* getMaterialFromPath(const MaterialLibrary& library, const QString& path); + +private: + static QString + value(const QSettings& fcmat, const std::string& name, const std::string& defaultValue) + { + return fcmat.value(QString::fromStdString(name), QString::fromStdString(defaultValue)) + .toString(); + } + + static void + setPhysicalValue(Material* finalModel, const std::string& name, const QString& value) + { + if (value.length() > 0) { + finalModel->setPhysicalValue(QString::fromStdString(name), value); + } + } + static void + setAppearanceValue(Material* finalModel, const std::string& name, const QString& value) + { + if (value.length() > 0) { + finalModel->setAppearanceValue(QString::fromStdString(name), value); + } + } + + static QString getAuthorAndLicense(const QString& path); + static void addMechanical(const QSettings& fcmat, Material* finalModel); + static void addFluid(const QSettings& fcmat, Material* finalModel); + static void addThermal(const QSettings& fcmat, Material* finalModel); + static void addElectromagnetic(const QSettings& fcmat, Material* finalModel); + static void addArchitectural(const QSettings& fcmat, Material* finalModel); + static void addCosts(const QSettings& fcmat, Material* finalModel); + static void addRendering(const QSettings& fcmat, Material* finalModel); + static void addVectorRendering(const QSettings& fcmat, Material* finalModel); +}; + +}// namespace Materials + +#endif// MATERIAL_MATERIALCONFIGLOADER_H diff --git a/src/Mod/Material/App/MaterialLibrary.cpp b/src/Mod/Material/App/MaterialLibrary.cpp new file mode 100644 index 0000000000..224202d266 --- /dev/null +++ b/src/Mod/Material/App/MaterialLibrary.cpp @@ -0,0 +1,168 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" +#ifndef _PreComp_ +#endif + +#include + +#include "MaterialLibrary.h" +#include "Materials.h" +#include "ModelManager.h" + + +using namespace Materials; + +/* TRANSLATOR Material::Materials */ + +std::map* MaterialLibrary::_materialPathMap = nullptr; + +TYPESYSTEM_SOURCE(Materials::MaterialLibrary, LibraryBase) + +MaterialLibrary::MaterialLibrary() +{ + if (_materialPathMap == nullptr) { + _materialPathMap = new std::map(); + } +} + +MaterialLibrary::MaterialLibrary(const QString& libraryName, + const QString& dir, + const QString& icon, + bool readOnly) + : LibraryBase(libraryName, dir, icon) + , _readOnly(readOnly) +{ + if (_materialPathMap == nullptr) { + _materialPathMap = new std::map(); + } +} + +void MaterialLibrary::createPath(const QString& path) +{ + Q_UNUSED(path) +} + +Material* MaterialLibrary::saveMaterial(Material& material, const QString& path, bool saveAsCopy) +{ + QString filePath = getLocalPath(path); + Base::Console().Log("\tfilePath = '%s'\n", filePath.toStdString().c_str()); + QFile file(filePath); + + // Update UUID if required + // if name changed true + if (material.getName() != file.fileName()) { + material.newUuid(); + } + // if overwrite false having warned the user + // if old format true, but already set + + + QFileInfo info(file); + QDir fileDir(info.path()); + if (!fileDir.exists()) { + if (!fileDir.mkpath(info.path())) { + Base::Console().Error("Unable to create directory path '%s'\n", + info.path().toStdString().c_str()); + } + } + + if (file.open(QIODevice::WriteOnly | QIODevice::Text)) { + QTextStream stream(&file); + stream.setCodec("UTF-8"); + stream.setGenerateByteOrderMark(true); + + // Write the contents + material.setLibrary(*this); + material.setDirectory(getRelativePath(path)); + material.save(stream, saveAsCopy); + } + + return addMaterial(material, path); +} + +Material* MaterialLibrary::addMaterial(const Material& material, const QString& path) +{ + QString filePath = getRelativePath(path); + Material* newMaterial = new Material(material); + newMaterial->setLibrary(*this); + newMaterial->setDirectory(filePath); + + try { + // If there's already a material at that path we'll replace it + Material* old = _materialPathMap->at(filePath); + delete old; + } + catch (const std::out_of_range&) { + } + + (*_materialPathMap)[filePath] = newMaterial; + + return newMaterial; +} + +const Material& MaterialLibrary::getMaterialByPath(const QString& path) const +{ + // Base::Console().Log("MaterialLibrary::getMaterialByPath(%s)\n", path.toStdString().c_str()); + // for (auto itp = _materialPathMap->begin(); itp != _materialPathMap->end(); itp++) { + // Base::Console().Log("\tpath = '%s'\n", itp->first.toStdString().c_str()); + // } + + QString filePath = getRelativePath(path); + try { + Material* material = _materialPathMap->at(filePath); + return *material; + } + catch (std::out_of_range& e) { + throw MaterialNotFound(); + } +} + +const QString MaterialLibrary::getUUIDFromPath(const QString& path) const +{ + QString filePath = getRelativePath(path); + try { + Material* material = _materialPathMap->at(filePath); + return material->getUUID(); + } + catch (std::out_of_range& e) { + throw MaterialNotFound(); + } +} + +TYPESYSTEM_SOURCE(Materials::MaterialExternalLibrary, MaterialLibrary::MaterialLibrary) + +MaterialExternalLibrary::MaterialExternalLibrary() +{} + +MaterialExternalLibrary::MaterialExternalLibrary(const QString& libraryName, + const QString& dir, + const QString& icon, + bool readOnly) + : MaterialLibrary(libraryName, dir, icon, readOnly) +{} + +MaterialExternalLibrary::~MaterialExternalLibrary() +{ + // delete directory; +} diff --git a/src/Mod/Material/App/MaterialLibrary.h b/src/Mod/Material/App/MaterialLibrary.h new file mode 100644 index 0000000000..a247ce6828 --- /dev/null +++ b/src/Mod/Material/App/MaterialLibrary.h @@ -0,0 +1,95 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATERIAL_MATERIALLIBRARY_H +#define MATERIAL_MATERIALLIBRARY_H + +#include +#include +#include +#include + +#include "Model.h" +#include "ModelLibrary.h" + +namespace Materials +{ + +class Material; + +class MaterialsExport MaterialLibrary: public LibraryBase +{ + TYPESYSTEM_HEADER(); + +public: + MaterialLibrary(); + explicit MaterialLibrary(const QString& libraryName, + const QString& dir, + const QString& icon, + bool readOnly = true); + virtual ~MaterialLibrary() = default; + + bool operator==(const MaterialLibrary& library) const + { + return LibraryBase::operator==(library); + } + bool operator!=(const MaterialLibrary& library) const + { + return !operator==(library); + } + const Material& getMaterialByPath(const QString& path) const; + + void createPath(const QString& path); + Material* saveMaterial(Material& material, const QString& path, bool saveAsCopy); + Material* addMaterial(const Material& material, const QString& path); + + bool isReadOnly() const + { + return _readOnly; + } + +protected: + const QString getUUIDFromPath(const QString& path) const; + + bool _readOnly; + static std::map* _materialPathMap; +}; + +class MaterialsExport MaterialExternalLibrary: public MaterialLibrary +{ + TYPESYSTEM_HEADER(); + +public: + MaterialExternalLibrary(); + explicit MaterialExternalLibrary(const QString& libraryName, + const QString& dir, + const QString& icon, + bool readOnly = true); + virtual ~MaterialExternalLibrary(); +}; + +}// namespace Materials + +Q_DECLARE_METATYPE(Materials::MaterialLibrary) +Q_DECLARE_METATYPE(Materials::MaterialExternalLibrary) + +#endif// MATERIAL_MATERIALLIBRARY_H diff --git a/src/Mod/Material/App/MaterialLoader.cpp b/src/Mod/Material/App/MaterialLoader.cpp new file mode 100644 index 0000000000..fd87c4d40c --- /dev/null +++ b/src/Mod/Material/App/MaterialLoader.cpp @@ -0,0 +1,445 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" +#ifndef _PreComp_ +#include +#endif + +#include +#include + +#include +#include + +#include "MaterialConfigLoader.h" +#include "MaterialLoader.h" +#include "Model.h" +#include "ModelManager.h" + + +using namespace Materials; + +MaterialEntry::MaterialEntry() +{} + +MaterialEntry::MaterialEntry(const MaterialLibrary& library, + const QString& modelName, + const QString& dir, + const QString& modelUuid) + : _library(library) + , _name(modelName) + , _directory(dir) + , _uuid(modelUuid) +{} + +MaterialYamlEntry::MaterialYamlEntry(const MaterialLibrary& library, + const QString& modelName, + const QString& dir, + const QString& modelUuid, + const YAML::Node& modelData) + : MaterialEntry(library, modelName, dir, modelUuid) + , _model(modelData) +{} + +// MaterialYamlEntry::~MaterialYamlEntry() +// {} + +QString MaterialYamlEntry::yamlValue(const YAML::Node& node, + const std::string& key, + const std::string& defaultValue) +{ + if (node[key]) { + return QString::fromStdString(node[key].as()); + } + return QString::fromStdString(defaultValue); +} + +void MaterialYamlEntry::addToTree(std::map* materialMap) +{ + std::set exclude; + exclude.insert(QString::fromStdString("General")); + exclude.insert(QString::fromStdString("Inherits")); + + auto yamlModel = getModel(); + auto library = getLibrary(); + auto name = getName(); + auto directory = getDirectory(); + QString uuid = getUUID(); + + QString authorAndLicense = yamlValue(yamlModel["General"], "AuthorAndLicense", ""); + QString description = yamlValue(yamlModel["General"], "Description", ""); + + Material* finalModel = new Material(library, directory, uuid, name); + finalModel->setAuthorAndLicense(authorAndLicense); + finalModel->setDescription(description); + + // Add inheritance list + if (yamlModel["Inherits"]) { + auto inherits = yamlModel["Inherits"]; + for (auto it = inherits.begin(); it != inherits.end(); it++) { + std::string nodeName = it->second["UUID"].as(); + + finalModel->setParentUUID( + QString::fromStdString(nodeName));// Should only be one. Need to check + } + } + + // Add material models + if (yamlModel["Models"]) { + auto models = yamlModel["Models"]; + for (auto it = models.begin(); it != models.end(); it++) { + std::string modelName = (it->first).as(); + + // Add the model uuid + auto modelNode = models[modelName]; + std::string modelUUID = modelNode["UUID"].as(); + finalModel->addPhysical(QString::fromStdString(modelUUID)); + + // Add the property values + auto properties = yamlModel["Models"][modelName]; + for (auto itp = properties.begin(); itp != properties.end(); itp++) { + std::string propertyName = (itp->first).as(); + std::string propertyValue = (itp->second).as(); + + if (finalModel->hasPhysicalProperty(QString::fromStdString(propertyName))) { + finalModel->setPhysicalValue(QString::fromStdString(propertyName), + QString::fromStdString(propertyValue)); + } + else if (propertyName != "UUID") { + Base::Console().Log("\tProperty '%s' is not described by any model. Ignored\n", + propertyName.c_str()); + } + } + } + } + + // Add appearance models + if (yamlModel["AppearanceModels"]) { + auto models = yamlModel["AppearanceModels"]; + for (auto it = models.begin(); it != models.end(); it++) { + std::string modelName = (it->first).as(); + + // Add the model uuid + auto modelNode = models[modelName]; + std::string modelUUID = modelNode["UUID"].as(); + finalModel->addAppearance(QString::fromStdString(modelUUID)); + + // Add the property values + auto properties = yamlModel["AppearanceModels"][modelName]; + for (auto itp = properties.begin(); itp != properties.end(); itp++) { + std::string propertyName = (itp->first).as(); + std::string propertyValue = (itp->second).as(); + + if (finalModel->hasAppearanceProperty(QString::fromStdString(propertyName))) { + finalModel->setAppearanceValue(QString::fromStdString(propertyName), + QString::fromStdString(propertyValue)); + } + else if (propertyName != "UUID") { + Base::Console().Log("\tProperty '%s' is not described by any model. Ignored\n", + propertyName.c_str()); + } + } + } + } + + QString path = QDir(directory).absolutePath(); + // Base::Console().Log("\tPath '%s'\n", path.toStdString().c_str()); + (*materialMap)[uuid] = library.addMaterial(*finalModel, path); +} + +std::map* MaterialLoader::_materialEntryMap = nullptr; + +MaterialLoader::MaterialLoader(std::map* materialMap, + std::list* libraryList) + : _materialMap(materialMap) + , _libraryList(libraryList) +{ + loadLibraries(); +} + +/* + * Destroys the object and frees any allocated resources + */ +MaterialLoader::~MaterialLoader() +{} + +void MaterialLoader::addLibrary(MaterialLibrary* model) +{ + _libraryList->push_back(model); +} + +MaterialEntry* MaterialLoader::getMaterialFromPath(MaterialLibrary& library, + const QString& path) const +{ + MaterialEntry* model = nullptr; + + // Used for debugging + std::string uuid; + std::string pathName = path.toStdString(); + + if (MaterialConfigLoader::isConfigStyle(path)) { + Base::Console().Log("Old format .FCMat file: '%s'\n", pathName.c_str()); + Material* material = MaterialConfigLoader::getMaterialFromPath(library, path); + if (material) { + (*_materialMap)[material->getUUID()] = library.addMaterial(*material, path); + } + + // Return the nullptr as there are no intermediate steps to take, such + // as checking inheritance + return model; + } + + YAML::Node yamlroot; + try { + yamlroot = YAML::LoadFile(pathName); + + const std::string uuid = yamlroot["General"]["UUID"].as(); + // Always get the name from the filename + // QString name = QString::fromStdString(yamlroot["General"]["Name"].as()); + QFileInfo filepath(path); + QString name = + filepath.fileName().remove(QString::fromStdString(".FCMat"), Qt::CaseInsensitive); + + model = new MaterialYamlEntry(library, name, path, QString::fromStdString(uuid), yamlroot); + // showYaml(yamlroot); + } + catch (YAML::Exception const& e) { + Base::Console().Error("YAML parsing error: '%s'\n", pathName.c_str()); + Base::Console().Error("\t'%s'\n", e.what()); + showYaml(yamlroot); + } + + + return model; +} + +void MaterialLoader::showYaml(const YAML::Node& yaml) +{ + std::stringstream out; + + out << yaml; + std::string logData = out.str(); + Base::Console().Log("%s\n", logData.c_str()); +} + + +void MaterialLoader::dereference(Material* material) +{ + // Avoid recursion + if (material->getDereferenced()) { + return; + } + + // Base::Console().Log("Dereferencing material '%s'.\n", + // material->getName().toStdString().c_str()); + + auto parentUUID = material->getParentUUID(); + if (parentUUID.size() > 0) { + Material* parent; + try { + parent = (*_materialMap)[parentUUID]; + } + catch (std::out_of_range& e) { + Base::Console().Log( + "Unable to apply inheritance for material '%s', parent '%s' not found.\n", + material->getName().toStdString().c_str(), + parentUUID.toStdString().c_str()); + } + + // Ensure the parent has been dereferenced + dereference(parent); + + // Add physical models + auto modelVector = parent->getPhysicalModels(); + for (auto model = modelVector->begin(); model != modelVector->end(); model++) { + if (!material->hasPhysicalModel(*model)) { + material->addPhysical(*model); + } + } + + // Add appearance models + modelVector = parent->getAppearanceModels(); + for (auto model = modelVector->begin(); model != modelVector->end(); model++) { + if (!material->hasAppearanceModel(*model)) { + material->addAppearance(*model); + } + } + + // Add values + auto properties = parent->getPhysicalProperties(); + for (auto itp = properties.begin(); itp != properties.end(); itp++) { + auto name = itp->first; + auto property = static_cast(itp->second); + + if (material->getPhysicalProperty(name).isNull()) { + material->getPhysicalProperty(name).setValue(property.getValue()); + } + } + + properties = parent->getAppearanceProperties(); + for (auto itp = properties.begin(); itp != properties.end(); itp++) { + auto name = itp->first; + auto property = static_cast(itp->second); + + if (material->getAppearanceProperty(name).isNull()) { + material->getAppearanceProperty(name).setValue(property.getValue()); + } + } + } + + material->markDereferenced(); +} + +void MaterialLoader::loadLibrary(MaterialLibrary& library) +{ + if (_materialEntryMap == nullptr) { + _materialEntryMap = new std::map(); + } + + QDirIterator it(library.getDirectory(), QDirIterator::Subdirectories); + while (it.hasNext()) { + auto pathname = it.next(); + QFileInfo file(pathname); + if (file.isFile()) { + if (file.suffix().toStdString() == "FCMat") { + QString libraryName = file.baseName(); + + auto model = getMaterialFromPath(library, file.canonicalFilePath()); + if (model) { + (*_materialEntryMap)[model->getUUID()] = model; + } + } + } + } + + for (auto it = _materialEntryMap->begin(); it != _materialEntryMap->end(); it++) { + it->second->addToTree(_materialMap); + } +} + +void MaterialLoader::loadLibraries(void) +{ + std::list* _libraryList = getMaterialLibraries(); + if (_libraryList) { + for (auto it = _libraryList->begin(); it != _libraryList->end(); it++) { + loadLibrary(**it); + } + } + + for (auto it = _materialMap->begin(); it != _materialMap->end(); it++) { + dereference(it->second); + } +} + +std::list* MaterialLoader::getMaterialLibraries() +{ + auto param = App::GetApplication().GetParameterGroupByPath( + "User parameter:BaseApp/Preferences/Mod/Material/Resources"); + bool useBuiltInMaterials = param->GetBool("UseBuiltInMaterials", true); + bool useMatFromModules = param->GetBool("UseMaterialsFromWorkbenches", true); + bool useMatFromConfigDir = param->GetBool("UseMaterialsFromConfigDir", true); + bool useMatFromCustomDir = param->GetBool("UseMaterialsFromCustomDir", true); + + if (useBuiltInMaterials) { + QString resourceDir = QString::fromStdString(App::Application::getResourceDir() + + "/Mod/Material/Resources/Materials"); + auto libData = new MaterialLibrary(QString::fromStdString("System"), + resourceDir, + QString::fromStdString(":/icons/freecad.svg"), + true); + _libraryList->push_back(libData); + } + + if (useMatFromModules) { + auto moduleParam = App::GetApplication().GetParameterGroupByPath( + "User parameter:BaseApp/Preferences/Mod/Material/Resources/Modules"); + for (auto& group : moduleParam->GetGroups()) { + // auto module = moduleParam->GetGroup(group->GetGroupName()); + auto moduleName = QString::fromStdString(group->GetGroupName()); + auto materialDir = QString::fromStdString(group->GetASCII("ModuleDir", "")); + auto materialIcon = QString::fromStdString(group->GetASCII("ModuleIcon", "")); + auto materialReadOnly = group->GetBool("ModuleReadOnly", true); + + if (materialDir.length() > 0) { + QDir dir(materialDir); + if (dir.exists()) { + auto libData = new MaterialLibrary(moduleName, + materialDir, + materialIcon, + materialReadOnly); + _libraryList->push_back(libData); + } + } + } + } + + if (useMatFromConfigDir) { + QString resourceDir = + QString::fromStdString(App::Application::getUserAppDataDir() + "/Material"); + if (!resourceDir.isEmpty()) { + QDir materialDir(resourceDir); + if (materialDir.exists()) { + auto libData = + new MaterialLibrary(QString::fromStdString("User"), + resourceDir, + QString::fromStdString(":/icons/preferences-general.svg"), + false); + _libraryList->push_back(libData); + } + } + } + + if (useMatFromCustomDir) { + QString resourceDir = QString::fromStdString(param->GetASCII("CustomMaterialsDir", "")); + if (!resourceDir.isEmpty()) { + QDir materialDir(resourceDir); + if (materialDir.exists()) { + auto libData = new MaterialLibrary(QString::fromStdString("Custom"), + resourceDir, + QString::fromStdString(":/icons/user.svg"), + false); + _libraryList->push_back(libData); + } + } + } + + return _libraryList; +} + +std::list* MaterialLoader::getMaterialFolders(const MaterialLibrary& library) +{ + std::list* pathList = new std::list(); + QDirIterator it(library.getDirectory(), QDirIterator::Subdirectories); + while (it.hasNext()) { + auto pathname = it.next(); + QFileInfo file(pathname); + if (file.isDir()) { + QString path = QDir(library.getDirectory()).relativeFilePath(file.absoluteFilePath()); + if (!path.startsWith(QString::fromStdString("."))) { + pathList->push_back(path); + } + } + } + + return pathList; +} diff --git a/src/Mod/Material/App/MaterialLoader.h b/src/Mod/Material/App/MaterialLoader.h new file mode 100644 index 0000000000..3bcaf673d1 --- /dev/null +++ b/src/Mod/Material/App/MaterialLoader.h @@ -0,0 +1,129 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATERIAL_MATERIALLOADER_H +#define MATERIAL_MATERIALLOADER_H + +#include +#include +#include + +#include "Materials.h" +#include "trim.h" + +namespace Materials +{ + +class MaterialEntry +{ +public: + MaterialEntry(); + explicit MaterialEntry(const MaterialLibrary& library, + const QString& modelName, + const QString& dir, + const QString& modelUuid); + virtual ~MaterialEntry() = default; + + virtual void addToTree(std::map* materialMap) = 0; + + const MaterialLibrary& getLibrary() const + { + return _library; + } + const QString getName() const + { + return _name; + } + const QString getDirectory() const + { + return _directory; + } + const QString getUUID() const + { + return _uuid; + } + +protected: + MaterialLibrary _library; + QString _name; + QString _directory; + QString _uuid; +}; + +class MaterialYamlEntry: public MaterialEntry +{ +public: + explicit MaterialYamlEntry(const MaterialLibrary& library, + const QString& modelName, + const QString& dir, + const QString& modelUuid, + const YAML::Node& modelData); + ~MaterialYamlEntry() override = default; + + void addToTree(std::map* materialMap) override; + + const YAML::Node& getModel() const + { + return _model; + } + YAML::Node* getModelPtr() + { + return &_model; + } + +private: + MaterialYamlEntry(); + + QString + yamlValue(const YAML::Node& node, const std::string& key, const std::string& defaultValue); + + YAML::Node _model; +}; + +class MaterialLoader +{ +public: + explicit MaterialLoader(std::map* materialMap, + std::list* libraryList); + virtual ~MaterialLoader(); + + std::list* getMaterialLibraries(); + static std::list* getMaterialFolders(const MaterialLibrary& library); + static void showYaml(const YAML::Node& yaml); + +private: + MaterialLoader(); + + void addToTree(MaterialEntry* model); + void dereference(Material* material); + MaterialEntry* getMaterialFromPath(MaterialLibrary& library, const QString& path) const; + void addLibrary(MaterialLibrary* model); + void loadLibrary(MaterialLibrary& library); + void loadLibraries(void); + static std::map* _materialEntryMap; + std::map* _materialMap; + std::list* _libraryList; +}; + +}// namespace Materials + +#endif// MATERIAL_MATERIALLOADER_H diff --git a/src/Mod/Material/App/MaterialManager.cpp b/src/Mod/Material/App/MaterialManager.cpp new file mode 100644 index 0000000000..2415a53ae4 --- /dev/null +++ b/src/Mod/Material/App/MaterialManager.cpp @@ -0,0 +1,273 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" +#ifndef _PreComp_ +#endif + +#include + +#include + +#include "Exceptions.h" +#include "MaterialLoader.h" +#include "MaterialManager.h" +#include "ModelManager.h" + + +using namespace Materials; + +/* TRANSLATOR Material::Materials */ + +std::list* MaterialManager::_libraryList = nullptr; +std::map* MaterialManager::_materialMap = nullptr; +QMutex MaterialManager::_mutex; + +TYPESYSTEM_SOURCE(Materials::MaterialManager, Base::BaseClass) + +MaterialManager::MaterialManager() +{ + // TODO: Add a mutex or similar + initLibraries(); +} + +void MaterialManager::initLibraries() +{ + QMutexLocker locker(&_mutex); + + if (_materialMap == nullptr) { + // Load the models first + ModelManager* manager = new ModelManager(); + Q_UNUSED(manager) + + delete manager; + + _materialMap = new std::map(); + + if (_libraryList == nullptr) { + _libraryList = new std::list(); + } + + // Load the libraries + MaterialLoader loader(_materialMap, _libraryList); + } +} + +void MaterialManager::saveMaterial(MaterialLibrary* library, + Material& material, + const QString& path, + bool saveAsCopy) +{ + Material* newMaterial = library->saveMaterial(material, path, saveAsCopy); + + try { + Material* old = _materialMap->at(newMaterial->getUUID()); + if (old) { + delete old; + } + } + catch (const std::out_of_range&) { + } + + (*_materialMap)[material.getUUID()] = newMaterial; +} + +bool MaterialManager::isMaterial(const fs::path& p) +{ + if (!fs::is_regular_file(p)) { + return false; + } + // check file extension + if (p.extension() == ".FCMat") { + return true; + } + return false; +} + +const Material& MaterialManager::getMaterial(const QString& uuid) const +{ + try { + return *(_materialMap->at(uuid)); + } + catch (std::out_of_range& e) { + throw MaterialNotFound(); + } +} + +const Material& MaterialManager::getMaterialByPath(const QString& path) const +{ + QString cleanPath = QDir::cleanPath(path); + + for (auto library : *_libraryList) { + Base::Console().Log("MaterialManager::getMaterialByPath() Checking library '%s'->'%s'\n", + library->getName().toStdString().c_str(), + library->getDirectory().toStdString().c_str()); + + + if (cleanPath.startsWith(library->getDirectory())) { + Base::Console().Log("MaterialManager::getMaterialByPath() Library '%s'\n", + library->getDirectory().toStdString().c_str()); + Base::Console().Log("MaterialManager::getMaterialByPath() Path '%s'\n", + cleanPath.toStdString().c_str()); + return library->getMaterialByPath(cleanPath); + } + } + Base::Console().Log("MaterialManager::getMaterialByPath() Library not found for path '%s'\n", + cleanPath.toStdString().c_str()); + + throw MaterialNotFound(); +} + +const Material& MaterialManager::getMaterialByPath(const QString& path, const QString& lib) const +{ + auto library = getLibrary(lib); // May throw LibraryNotFound + return library->getMaterialByPath(path);// May throw MaterialNotFound +} + +MaterialLibrary* MaterialManager::getLibrary(const QString& name) const +{ + for (auto library : *_libraryList) { + if (library->getName() == name) { + return library; + } + } + + throw LibraryNotFound(); +} + +std::list* MaterialManager::getMaterialLibraries() +{ + if (_libraryList == nullptr) { + if (_materialMap == nullptr) { + _materialMap = new std::map(); + } + _libraryList = new std::list(); + + // Load the libraries + MaterialLoader loader(_materialMap, _libraryList); + } + return _libraryList; +} + +std::map* +MaterialManager::getMaterialTree(const MaterialLibrary& library) +{ + std::map* materialTree = new std::map(); + + for (auto it = _materialMap->begin(); it != _materialMap->end(); it++) { + auto filename = it->first; + auto material = it->second; + + if (material->getLibrary() == library) { + fs::path path = material->getDirectory().toStdString(); + + // Start at the root + std::map* node = materialTree; + for (auto itp = path.begin(); itp != path.end(); itp++) { + if (QString::fromStdString(itp->string()) + .endsWith(QString::fromStdString(".FCMat"))) { + MaterialTreeNode* child = new MaterialTreeNode(); + child->setData(material); + (*node)[QString::fromStdString(itp->string())] = child; + } + else { + // Add the folder only if it's not already there + QString folderName = QString::fromStdString(itp->string()); + std::map* mapPtr; + if (node->count(folderName) == 0) { + mapPtr = new std::map(); + MaterialTreeNode* child = new MaterialTreeNode(); + child->setFolder(mapPtr); + (*node)[folderName] = child; + node = mapPtr; + } + else { + node = (*node)[folderName]->getFolder(); + } + } + } + } + } + + std::list* folderList = getMaterialFolders(library); + for (auto folder : *folderList) { + fs::path path = folder.toStdString(); + + // Start at the root + std::map* node = materialTree; + for (auto itp = path.begin(); itp != path.end(); itp++) { + // Add the folder only if it's not already there + QString folderName = QString::fromStdString(itp->string()); + if (node->count(folderName) == 0) { + std::map* mapPtr = + new std::map(); + MaterialTreeNode* child = new MaterialTreeNode(); + child->setFolder(mapPtr); + (*node)[folderName] = child; + node = mapPtr; + } + else { + node = (*node)[folderName]->getFolder(); + } + } + } + delete folderList; + + return materialTree; +} + +std::list* MaterialManager::getMaterialFolders(const MaterialLibrary& library) +{ + return MaterialLoader::getMaterialFolders(library); +} + +std::map* MaterialManager::materialsWithModel(QString uuid) +{ + std::map* dict = new std::map(); + + for (auto it = _materialMap->begin(); it != _materialMap->end(); it++) { + QString key = it->first; + Material* material = it->second; + + if (material->hasModel(uuid)) { + (*dict)[key] = material; + } + } + + return dict; +} + +std::map* MaterialManager::materialsWithModelComplete(QString uuid) +{ + std::map* dict = new std::map(); + + for (auto it = _materialMap->begin(); it != _materialMap->end(); it++) { + QString key = it->first; + Material* material = it->second; + + if (material->isModelComplete(uuid)) { + (*dict)[key] = material; + } + } + + return dict; +} diff --git a/src/Mod/Material/App/MaterialManager.h b/src/Mod/Material/App/MaterialManager.h new file mode 100644 index 0000000000..eacebabca7 --- /dev/null +++ b/src/Mod/Material/App/MaterialManager.h @@ -0,0 +1,85 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATERIAL_MATERIALMANAGER_H +#define MATERIAL_MATERIALMANAGER_H + +#include + +#include + +#include "FolderTree.h" +#include "Materials.h" + +namespace fs = boost::filesystem; + +namespace Materials +{ + +typedef FolderTreeNode MaterialTreeNode; + +class MaterialsExport MaterialManager: public Base::BaseClass +{ + TYPESYSTEM_HEADER(); + +public: + MaterialManager(); + virtual ~MaterialManager() = default; + + std::map* getMaterials() + { + return _materialMap; + } + const Material& getMaterial(const QString& uuid) const; + const Material& getMaterialByPath(const QString& path) const; + const Material& getMaterialByPath(const QString& path, const QString& library) const; + MaterialLibrary* getLibrary(const QString& name) const; + + // Library management + static std::list* getMaterialLibraries(); + std::map* getMaterialTree(const MaterialLibrary& library); + std::list* getMaterialFolders(const MaterialLibrary& library); + void createPath(MaterialLibrary* library, const QString& path) + { + library->createPath(path); + } + void saveMaterial(MaterialLibrary* library, + Material& material, + const QString& path, + bool saveAsCopy = true); + + static bool isMaterial(const fs::path& p); + + std::map* materialsWithModel(QString uuid); + std::map* materialsWithModelComplete(QString uuid); + +private: + static std::list* _libraryList; + static std::map* _materialMap; + static QMutex _mutex; + + static void initLibraries(); +}; + +}// namespace Materials + +#endif// MATERIAL_MATERIALMANAGER_H diff --git a/src/Mod/Material/App/MaterialManagerPy.xml b/src/Mod/Material/App/MaterialManagerPy.xml new file mode 100644 index 0000000000..af9579ee75 --- /dev/null +++ b/src/Mod/Material/App/MaterialManagerPy.xml @@ -0,0 +1,51 @@ + + + + + + Material descriptions. + + + + Get a material object by specifying its UUID + + + + + Get a material object by specifying its path and library name + + + + + List of Material libraries. + + + + + + List of Materials. + + + + + + Get a list of materials implementing the specified model + + + + + Get a list of materials implementing the specified model, with values for all properties + + + + diff --git a/src/Mod/Material/App/MaterialManagerPyImpl.cpp b/src/Mod/Material/App/MaterialManagerPyImpl.cpp new file mode 100644 index 0000000000..0f37e603f6 --- /dev/null +++ b/src/Mod/Material/App/MaterialManagerPyImpl.cpp @@ -0,0 +1,204 @@ +/*************************************************************************** + * Copyright (c) 2008 Werner Mayer * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" + +#ifndef _PreComp_ +#include +#endif + +#include "Exceptions.h" +#include "MaterialManager.h" +#include "MaterialManagerPy.h" +#include "MaterialPy.h" +#include "Materials.h" + +#include "MaterialManagerPy.cpp" + +using namespace Materials; + +// returns a string which represents the object e.g. when printed in python +std::string MaterialManagerPy::representation() const +{ + std::stringstream str; + str << ""; + + return str.str(); +} + +PyObject* MaterialManagerPy::PyMake(struct _typeobject*, PyObject*, PyObject*)// Python wrapper +{ + // never create such objects with the constructor + return new MaterialManagerPy(new MaterialManager()); +} + +// constructor method +int MaterialManagerPy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/) +{ + return 0; +} + +PyObject* MaterialManagerPy::getMaterial(PyObject* args) +{ + char* uuid; + if (!PyArg_ParseTuple(args, "s", &uuid)) { + return nullptr; + } + + try { + const Material& material = + getMaterialManagerPtr()->getMaterial(QString::fromStdString(uuid)); + return new MaterialPy(new Material(material)); + } + catch (const MaterialNotFound&) { + PyErr_SetString(PyExc_LookupError, "Material not found"); + return nullptr; + } +} + +PyObject* MaterialManagerPy::getMaterialByPath(PyObject* args) +{ + char* path; + char* lib = ""; + if (!PyArg_ParseTuple(args, "s|s", &path, &lib)) { + return nullptr; + } + + QString libPath(QString::fromStdString(lib)); + if (!libPath.isEmpty()) { + try { + const Material& material = + getMaterialManagerPtr()->getMaterialByPath(QString::fromStdString(path), libPath); + return new MaterialPy(new Material(material)); + } + catch (const MaterialNotFound&) { + PyErr_SetString(PyExc_LookupError, "Material not found"); + return nullptr; + } + catch (const LibraryNotFound&) { + PyErr_SetString(PyExc_LookupError, "Library not found"); + return nullptr; + } + } + + try { + const Material& material = + getMaterialManagerPtr()->getMaterialByPath(QString::fromStdString(path)); + return new MaterialPy(new Material(material)); + } + catch (const MaterialNotFound&) { + PyErr_SetString(PyExc_LookupError, "Material not found"); + return nullptr; + } +} + +Py::List MaterialManagerPy::getMaterialLibraries() const +{ + std::list* libraries = getMaterialManagerPtr()->getMaterialLibraries(); + Py::List list; + + for (auto it = libraries->begin(); it != libraries->end(); it++) { + MaterialLibrary* lib = *it; + Py::Tuple libTuple(3); + libTuple.setItem(0, Py::String(lib->getName().toStdString())); + libTuple.setItem(1, Py::String(lib->getDirectoryPath().toStdString())); + libTuple.setItem(2, Py::String(lib->getIconPath().toStdString())); + + list.append(libTuple); + } + + return list; +} + +Py::Dict MaterialManagerPy::getMaterials() const +{ + Py::Dict dict; + + std::map* materials = getMaterialManagerPtr()->getMaterials(); + + for (auto it = materials->begin(); it != materials->end(); it++) { + QString key = it->first; + Material* material = it->second; + + PyObject* materialPy = new MaterialPy(new Material(*material)); + dict.setItem(Py::String(key.toStdString()), Py::Object(materialPy, true)); + } + + // return Py::new_reference_to(dict); + return dict; +} + +PyObject* MaterialManagerPy::getCustomAttributes(const char* /*attr*/) const +{ + return nullptr; +} + +int MaterialManagerPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) +{ + return 0; +} + +PyObject* MaterialManagerPy::materialsWithModel(PyObject* args) +{ + char* uuid; + if (!PyArg_ParseTuple(args, "s", &uuid)) { + return nullptr; + } + + std::map* materials = + getMaterialManagerPtr()->materialsWithModel(QString::fromStdString(uuid)); + PyObject* dict = PyDict_New(); + + for (auto it = materials->begin(); it != materials->end(); it++) { + QString key = it->first; + Material* material = it->second; + + PyObject* materialPy = new MaterialPy(new Material(*material)); + PyDict_SetItem(dict, PyUnicode_FromString(key.toStdString().c_str()), materialPy); + } + delete materials; + + return dict; +} + +PyObject* MaterialManagerPy::materialsWithModelComplete(PyObject* args) +{ + char* uuid; + if (!PyArg_ParseTuple(args, "s", &uuid)) { + return nullptr; + } + + std::map* materials = + getMaterialManagerPtr()->materialsWithModelComplete(QString::fromStdString(uuid)); + PyObject* dict = PyDict_New(); + + for (auto it = materials->begin(); it != materials->end(); it++) { + QString key = it->first; + Material* material = it->second; + + PyObject* materialPy = new MaterialPy(new Material(*material)); + PyDict_SetItem(dict, PyUnicode_FromString(key.toStdString().c_str()), materialPy); + } + delete materials; + + return dict; +} diff --git a/src/Mod/Material/App/MaterialPy.xml b/src/Mod/Material/App/MaterialPy.xml new file mode 100644 index 0000000000..d2ffb43da2 --- /dev/null +++ b/src/Mod/Material/App/MaterialPy.xml @@ -0,0 +1,161 @@ + + + + + + Material descriptions. + + + + Model library name. + + + + + + Model library path. + + + + + + Model icon path. + + + + + + Model name. + + + + + + Model directory relative to the library root. + + + + + + Unique model identifier. + + + + + + Description of the material. + + + + + + URL to a material reference. + + + + + + Reference for material data. + + + + + + Parent material UUID. + + + + + + Author and license information. + + + + + + List of implemented models. + + + + + + List of implemented models. + + + + + + List of searchable tags. + + + + + + Check if the material implements the physical model with the given UUID + + + + + Check if the material implements the appearance model with the given UUID + + + + + Check if the material implements the physical model with the given UUID, and has values defined for each property + + + + + Check if the material implements the appearance model with the given UUID, and has values defined for each property + + + + + Check if the material implements the physical property with the given name + + + + + Check if the material implements the appearance property with the given name + + + + + deprecated -- Dictionary of all material properties. + + + + + + deprecated -- Dictionary of material physical properties. + + + + + + deprecated -- Dictionary of material appearance properties. + + + + + + Get the value associated with the property + + + + + Get the value associated with the property + + + + diff --git a/src/Mod/Material/App/MaterialPyImpl.cpp b/src/Mod/Material/App/MaterialPyImpl.cpp new file mode 100644 index 0000000000..4d54aab955 --- /dev/null +++ b/src/Mod/Material/App/MaterialPyImpl.cpp @@ -0,0 +1,395 @@ +/*************************************************************************** + * Copyright (c) 2008 Werner Mayer * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" + +#ifndef _PreComp_ +#include +#endif + +#include + +#include +#include +#include + +#include "Exceptions.h" +#include "MaterialPy.h" +#include "Materials.h" + +#include "MaterialPy.cpp" + +using namespace Materials; + +// returns a string which represents the object e.g. when printed in python +std::string MaterialPy::representation() const +{ + MaterialPy::PointerType ptr = getMaterialPtr(); + std::stringstream str; + str << "Property [Name=("; + str << ptr->getName().toStdString(); + str << "), UUID=("; + str << ptr->getUUID().toStdString(); + str << "), Library Name=("; + str << ptr->getLibrary().getName().toStdString(); + str << "), Library Root=("; + str << ptr->getLibrary().getDirectoryPath().toStdString(); + str << "), Library Icon=("; + str << ptr->getLibrary().getIconPath().toStdString(); + str << "), Directory=("; + str << ptr->getDirectory().toStdString(); + // str << "), URL=("; + // str << ptr->getURL(); + // str << "), DOI=("; + // str << ptr->getDOI(); + // str << "), Description=("; + // str << ptr->getDescription(); + // str << "), Inherits=["; + // const std::vector &inherited = getMaterialPtr()->getInheritance(); + // for (auto it = inherited.begin(); it != inherited.end(); it++) + // { + // std::string uuid = *it; + // if (it != inherited.begin()) + // str << "), UUID=("; + // else + // str << "UUID=("; + // str << uuid << ")"; + // } + // str << "]]"; + str << ")]"; + + return str.str(); +} + +PyObject* MaterialPy::PyMake(struct _typeobject*, PyObject*, PyObject*)// Python wrapper +{ + // never create such objects with the constructor + return new MaterialPy(new Material()); +} + +// constructor method +int MaterialPy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/) +{ + return 0; +} + +Py::String MaterialPy::getLibraryName() const +{ + return Py::String(getMaterialPtr()->getLibrary().getName().toStdString()); +} + +Py::String MaterialPy::getLibraryRoot() const +{ + return Py::String(getMaterialPtr()->getLibrary().getDirectoryPath().toStdString()); +} + +Py::String MaterialPy::getLibraryIcon() const +{ + return Py::String(getMaterialPtr()->getLibrary().getIconPath().toStdString()); +} + +Py::String MaterialPy::getName() const +{ + return Py::String(getMaterialPtr()->getName().toStdString()); +} + +Py::String MaterialPy::getDirectory() const +{ + return Py::String(getMaterialPtr()->getDirectory().toStdString()); +} + +Py::String MaterialPy::getUUID() const +{ + return Py::String(getMaterialPtr()->getUUID().toStdString()); +} + +Py::String MaterialPy::getDescription() const +{ + return Py::String(getMaterialPtr()->getDescription().toStdString()); +} + +Py::String MaterialPy::getURL() const +{ + return Py::String(getMaterialPtr()->getURL().toStdString()); +} + +Py::String MaterialPy::getReference() const +{ + return Py::String(getMaterialPtr()->getReference().toStdString()); +} + +Py::String MaterialPy::getParent() const +{ + return Py::String(getMaterialPtr()->getParentUUID().toStdString()); +} + +Py::String MaterialPy::getAuthorAndLicense() const +{ + return Py::String(getMaterialPtr()->getAuthorAndLicense().toStdString()); +} + +Py::List MaterialPy::getPhysicalModels() const +{ + const std::vector* models = getMaterialPtr()->getPhysicalModels(); + Py::List list; + + for (auto it = models->begin(); it != models->end(); it++) { + QString uuid = *it; + + list.append(Py::String(uuid.toStdString())); + } + + return list; +} + +Py::List MaterialPy::getAppearanceModels() const +{ + const std::vector* models = getMaterialPtr()->getAppearanceModels(); + Py::List list; + + for (auto it = models->begin(); it != models->end(); it++) { + QString uuid = *it; + + list.append(Py::String(uuid.toStdString())); + } + + return list; +} + +Py::List MaterialPy::getTags() const +{ + const std::list& tags = getMaterialPtr()->getTags(); + Py::List list; + + for (auto it = tags.begin(); it != tags.end(); it++) { + QString uuid = *it; + + list.append(Py::String(uuid.toStdString())); + } + + return list; +} + +PyObject* MaterialPy::getCustomAttributes(const char* /*attr*/) const +{ + return nullptr; +} + +int MaterialPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) +{ + return 0; +} + +PyObject* MaterialPy::hasPhysicalModel(PyObject* args) +{ + char* uuid; + if (!PyArg_ParseTuple(args, "s", &uuid)) { + return nullptr; + } + + bool hasProperty = getMaterialPtr()->hasPhysicalModel(QString::fromStdString(uuid)); + return hasProperty ? Py_True : Py_False; +} + +PyObject* MaterialPy::hasAppearanceModel(PyObject* args) +{ + char* uuid; + if (!PyArg_ParseTuple(args, "s", &uuid)) { + return nullptr; + } + + bool hasProperty = getMaterialPtr()->hasAppearanceModel(QString::fromStdString(uuid)); + return hasProperty ? Py_True : Py_False; +} + +PyObject* MaterialPy::isPhysicalModelComplete(PyObject* args) +{ + char* name; + if (!PyArg_ParseTuple(args, "s", &name)) { + return nullptr; + } + + bool isComplete = getMaterialPtr()->isPhysicalModelComplete(QString::fromStdString(name)); + return isComplete ? Py_True : Py_False; +} + +PyObject* MaterialPy::isAppearanceModelComplete(PyObject* args) +{ + char* name; + if (!PyArg_ParseTuple(args, "s", &name)) { + return nullptr; + } + + bool isComplete = getMaterialPtr()->isAppearanceModelComplete(QString::fromStdString(name)); + return isComplete ? Py_True : Py_False; +} + +PyObject* MaterialPy::hasPhysicalProperty(PyObject* args) +{ + char* name; + if (!PyArg_ParseTuple(args, "s", &name)) { + return nullptr; + } + + bool hasProperty = getMaterialPtr()->hasPhysicalProperty(QString::fromStdString(name)); + return hasProperty ? Py_True : Py_False; +} + +PyObject* MaterialPy::hasAppearanceProperty(PyObject* args) +{ + char* name; + if (!PyArg_ParseTuple(args, "s", &name)) { + return nullptr; + } + + bool hasProperty = getMaterialPtr()->hasAppearanceProperty(QString::fromStdString(name)); + return hasProperty ? Py_True : Py_False; +} + +Py::Dict MaterialPy::getProperties() const +{ + Py::Dict dict; + + // Maintain backwards compatibility + dict.setItem(Py::String("CardName"), Py::String(getMaterialPtr()->getName().toStdString())); + dict.setItem(Py::String("AuthorAndLicense"), + Py::String(getMaterialPtr()->getAuthorAndLicense().toStdString())); + dict.setItem(Py::String("Name"), Py::String(getMaterialPtr()->getName().toStdString())); + dict.setItem(Py::String("Description"), + Py::String(getMaterialPtr()->getDescription().toStdString())); + dict.setItem(Py::String("ReferenceSource"), + Py::String(getMaterialPtr()->getReference().toStdString())); + dict.setItem(Py::String("SourceURL"), Py::String(getMaterialPtr()->getURL().toStdString())); + + auto properties = getMaterialPtr()->getPhysicalProperties(); + for (auto it = properties.begin(); it != properties.end(); it++) { + QString key = it->first; + MaterialProperty& materialProperty = it->second; + + if (!materialProperty.isNull()) { + auto value = materialProperty.getString(); + dict.setItem(Py::String(key.toStdString()), Py::String(value.toStdString())); + } + } + + properties = getMaterialPtr()->getAppearanceProperties(); + for (auto it = properties.begin(); it != properties.end(); it++) { + QString key = it->first; + MaterialProperty& materialProperty = it->second; + + if (!materialProperty.isNull()) { + auto value = materialProperty.getString(); + dict.setItem(Py::String(key.toStdString()), Py::String(value.toStdString())); + } + } + + return dict; +} + +Py::Dict MaterialPy::getPhysicalProperties() const +{ + Py::Dict dict; + + auto properties = getMaterialPtr()->getPhysicalProperties(); + for (auto it = properties.begin(); it != properties.end(); it++) { + QString key = it->first; + MaterialProperty& materialProperty = it->second; + + if (!materialProperty.isNull()) { + auto value = materialProperty.getString(); + dict.setItem(Py::String(key.toStdString()), Py::String(value.toStdString())); + } + } + + return dict; +} + +Py::Dict MaterialPy::getAppearanceProperties() const +{ + Py::Dict dict; + + auto properties = getMaterialPtr()->getAppearanceProperties(); + for (auto it = properties.begin(); it != properties.end(); it++) { + QString key = it->first; + MaterialProperty& materialProperty = it->second; + + if (!materialProperty.isNull()) { + auto value = materialProperty.getString(); + dict.setItem(Py::String(key.toStdString()), Py::String(value.toStdString())); + } + } + + return dict; +} + +static PyObject* _pyObjectFromVariant(const QVariant& value) +{ + if (value.isNull()) { + return new PyObject(); + } + + if (value.userType() == QMetaType::type("Base::Quantity")) { + return new Base::QuantityPy(new Base::Quantity(value.value())); + } + else if (value.userType() == QMetaType::Double) { + return PyFloat_FromDouble(value.toDouble()); + } + else if (value.userType() == QMetaType::Float) { + return PyFloat_FromDouble(value.toFloat()); + } + else if (value.userType() == QMetaType::Int) { + return PyLong_FromLong(value.toInt()); + } + else if (value.userType() == QMetaType::Long) { + return PyLong_FromLong(value.toInt()); + } + else if (value.userType() == QMetaType::Bool) { + return value.toBool() ? Py_True : Py_False; + } + else if (value.userType() == QMetaType::QString) { + return PyUnicode_FromString(value.toString().toStdString().c_str()); + } + + throw UnknownValueType(); +} + +PyObject* MaterialPy::getPhysicalValue(PyObject* args) +{ + char* name; + if (!PyArg_ParseTuple(args, "s", &name)) { + return nullptr; + } + + QVariant value = getMaterialPtr()->getPhysicalValue(QString::fromStdString(name)); + return _pyObjectFromVariant(value); +} + +PyObject* MaterialPy::getAppearanceValue(PyObject* args) +{ + char* name; + if (!PyArg_ParseTuple(args, "s", &name)) { + return nullptr; + } + + QVariant value = getMaterialPtr()->getAppearanceValue(QString::fromStdString(name)); + return _pyObjectFromVariant(value); +} diff --git a/src/Mod/Material/App/MaterialValue.cpp b/src/Mod/Material/App/MaterialValue.cpp new file mode 100644 index 0000000000..d9f27fa24c --- /dev/null +++ b/src/Mod/Material/App/MaterialValue.cpp @@ -0,0 +1,243 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" +#ifndef _PreComp_ +#endif + +#include + +#include "Exceptions.h" +#include "MaterialValue.h" + + +using namespace Materials; + +/* TRANSLATOR Material::MaterialValue */ + +MaterialValue::MaterialValue() + : _valueType(None) +{} + +MaterialValue::MaterialValue(ValueType type) + : _valueType(type) +{} + +//=== + +Material2DArray::Material2DArray() + : MaterialValue(Array2D) + , _defaultSet(false) +{} + +MaterialValue Material2DArray::getDefault() const +{ + MaterialValue ret(_valueType); + ret.setValue(_value); + return ret; +} + +const std::vector* Material2DArray::getRow(int row) const +{ + try { + return _rows.at(row); + } + catch (std::out_of_range const&) { + throw InvalidRow(); + } +} + +std::vector* Material2DArray::getRow(int row) +{ + try { + return _rows.at(row); + } + catch (std::out_of_range const&) { + throw InvalidRow(); + } +} + +void Material2DArray::addRow(std::vector* row) +{ + _rows.push_back(row); +} + +void Material2DArray::insertRow(int index, std::vector* row) +{ + _rows.insert(_rows.begin() + index, row); +} + +void Material2DArray::deleteRow(int row) +{ + if (static_cast(row) >= _rows.size() || row < 0) { + throw InvalidRow(); + } + _rows.erase(_rows.begin() + row); +} + +void Material2DArray::setValue(int row, int column, const QVariant& value) +{ + if (row >= rows()) { + throw InvalidIndex(); + } + + std::vector* val = getRow(row); + try { + val->at(column) = value; + } + catch (const std::out_of_range&) { + throw InvalidIndex(); + } +} + +const QVariant Material2DArray::getValue(int row, int column) +{ + try { + auto val = getRow(row); + try { + return val->at(column); + } + catch (std::out_of_range const&) { + throw InvalidIndex(); + } + } + catch (const InvalidRow&) { + throw InvalidIndex(); + } +} + +void Material2DArray::dumpRow(const std::vector& row) const +{ + Base::Console().Log("row: "); + for (auto column : row) { + Base::Console().Log("'%s' ", column.toString().toStdString().c_str()); + } + Base::Console().Log("\n"); +} + +void Material2DArray::dump() const +{ + for (auto row : _rows) { + dumpRow(*row); + } +} + +//=== + +Material3DArray::Material3DArray() + : MaterialValue(Array3D) + , _defaultSet(false) +{} + +MaterialValue Material3DArray::getDefault() const +{ + MaterialValue ret(_valueType); + ret.setValue(_value); + return ret; +} + +const std::vector*>& Material3DArray::getTable(const QVariant& depth) const +{ + try { + return _rowMap.at(depth); + } + catch (std::out_of_range const&) { + throw InvalidRow(); + } +} + +const std::vector& Material3DArray::getRow(const QVariant& depth, int row) const +{ + try { + return *(_rowMap.at(depth).at(row)); + } + catch (std::out_of_range const&) { + throw InvalidRow(); + } +} + +const std::vector& Material3DArray::getRow(int row) const +{ + return getRow(getDefault().getValue().toString(), row); +} + +std::vector& Material3DArray::getRow(const QVariant& depth, int row) +{ + try { + return *(_rowMap.at(depth).at(row)); + } + catch (std::out_of_range const&) { + throw InvalidRow(); + } +} + +std::vector& Material3DArray::getRow(int row) +{ + return getRow(getDefault().getValue().toString(), row); +} + +void Material3DArray::addRow(const QVariant& depth, std::vector* row) +{ + _rowMap[depth].push_back(row); +} + +void Material3DArray::deleteRow(const QVariant& depth, int row) +{ + Q_UNUSED(depth) + Q_UNUSED(row) +} + +void Material3DArray::deleteRows(int depth) +{ + Q_UNUSED(depth) +} + +void Material3DArray::setValue(const QVariant& depth, int row, int column, const QVariant& value) +{ + Q_UNUSED(depth) + Q_UNUSED(row) + Q_UNUSED(column) + Q_UNUSED(value) +} + +void Material3DArray::setValue(int row, int column, const QVariant& value) +{ + Q_UNUSED(row) + Q_UNUSED(column) + Q_UNUSED(value) +} + +const QVariant Material3DArray::getValue(const QVariant& depth, int row, int column) +{ + auto val = getRow(depth, row); + try { + return val.at(column); + } + catch (std::out_of_range const&) { + throw InvalidColumn(); + } +} + +const QVariant Material3DArray::getValue(int row, int column) +{ + return getValue(getDefault().getValue().toString(), row, column); +} diff --git a/src/Mod/Material/App/MaterialValue.h b/src/Mod/Material/App/MaterialValue.h new file mode 100644 index 0000000000..d6df062623 --- /dev/null +++ b/src/Mod/Material/App/MaterialValue.h @@ -0,0 +1,187 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATERIAL_MATERIALVALUE_H +#define MATERIAL_MATERIALVALUE_H + +#include + +namespace Materials +{ + +class MaterialsExport MaterialValue +{ +public: + enum ValueType + { + None = 0, + String = 1, + Boolean = 2, + Integer = 3, + Float = 4, + Quantity = 5, + Distribution = 6, + List = 7, + Array2D = 8, + Array3D = 9, + Color = 10, + Image = 11, + File = 12, + URL = 13 + }; + MaterialValue(); + explicit MaterialValue(ValueType type); + virtual ~MaterialValue() = default; + + ValueType getType() + { + return _valueType; + } + + const QVariant getValue(void) const + { + return _value; + } + bool isNull() const + { + return _value.isNull(); + } + virtual const QVariant getValueAt(const QVariant& value) const + { + Q_UNUSED(value); + return _value; + } + void setValue(const QVariant& value) + { + _value = value; + } + +protected: + ValueType _valueType; + QVariant _value; + + void setType(ValueType type) + { + _valueType = type; + } +}; + +class MaterialsExport Material2DArray: public MaterialValue +{ +public: + Material2DArray(); + ~Material2DArray() override = default; + + void setDefault(MaterialValue value) + { + _value = value.getValue(); + _defaultSet = true; + } + void setDefault(const QVariant& value) + { + _value = value; + _defaultSet = true; + } + MaterialValue getDefault() const; + bool defaultSet() const + { + return _defaultSet; + } + + const std::vector* getRow(int row) const; + std::vector* getRow(int row); + int rows() const + { + return _rows.size(); + } + void addRow(std::vector* row); + void insertRow(int index, std::vector* row); + void deleteRow(int row); + + void setValue(int row, int column, const QVariant& value); + const QVariant getValue(int row, int column); + +protected: + std::vector*> _rows; + bool _defaultSet; + +private: + void dumpRow(const std::vector& row) const; + void dump() const; +}; + +class MaterialsExport Material3DArray: public MaterialValue +{ +public: + Material3DArray(); + ~Material3DArray() override = default; + + void setDefault(MaterialValue value) + { + _value = value.getValue(); + _defaultSet = true; + } + void setDefault(const QVariant& value) + { + _value = value; + _defaultSet = true; + } + MaterialValue getDefault() const; + bool defaultSet() const + { + return _defaultSet; + } + + const std::vector*>& getTable(const QVariant& depth) const; + const std::vector& getRow(const QVariant& depth, int row) const; + const std::vector& getRow(int row) const; + std::vector& getRow(const QVariant& depth, int row); + std::vector& getRow(int row); + void addRow(const QVariant& depth, std::vector* row); + void deleteRow(const QVariant& depth, int row); + void deleteRows(int depth); + int depth() const + { + return _rowMap.size(); + } + int rows(const QVariant& depth) const + { + return getTable(depth).size(); + } + + void setValue(const QVariant& depth, int row, int column, const QVariant& value); + void setValue(int row, int column, const QVariant& value); + const QVariant getValue(const QVariant& depth, int row, int column); + const QVariant getValue(int row, int column); + +protected: + std::map*>> _rowMap; + bool _defaultSet; +}; + +}// namespace Materials + +Q_DECLARE_METATYPE(Materials::MaterialValue) +Q_DECLARE_METATYPE(Materials::Material2DArray) +Q_DECLARE_METATYPE(Materials::Material3DArray) + +#endif// MATERIAL_MATERIALVALUE_H diff --git a/src/Mod/Material/App/Materials.cpp b/src/Mod/Material/App/Materials.cpp new file mode 100644 index 0000000000..01d25de872 --- /dev/null +++ b/src/Mod/Material/App/Materials.cpp @@ -0,0 +1,914 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" +#ifndef _PreComp_ +#endif + +#include +#include + +#include +#include + +#include "MaterialManager.h" +#include "Materials.h" +#include "ModelManager.h" + + +using namespace Materials; + +/* TRANSLATOR Material::Materials */ + +TYPESYSTEM_SOURCE(Materials::MaterialProperty, Materials::ModelProperty) + +MaterialProperty::MaterialProperty() +{ + _valuePtr = new MaterialValue(MaterialValue::None); +} + +MaterialProperty::MaterialProperty(const ModelProperty& property) + : ModelProperty(property) + , _valuePtr(nullptr) +{ + setType(getPropertyType()); + auto columns = property.getColumns(); + for (std::vector::const_iterator it = columns.begin(); it != columns.end(); + it++) { + MaterialProperty prop(*it); + addColumn(prop); + } + + if (_valuePtr->getType() == MaterialValue::Array2D) { + reinterpret_cast(_valuePtr)->setDefault(getColumnNull(0)); + } + else if (_valuePtr->getType() == MaterialValue::Array3D) { + reinterpret_cast(_valuePtr)->setDefault(getColumnNull(0)); + } +} + +MaterialProperty::MaterialProperty(const MaterialProperty& other) + : ModelProperty(other) +{ + _modelUUID = other._modelUUID; + if (other._valuePtr != nullptr) { + _valuePtr = new MaterialValue(*(other._valuePtr)); + } + else { + _valuePtr = nullptr; + } + + for (auto it = other._columns.begin(); it != other._columns.end(); it++) { + _columns.push_back(*it); + } +} + +MaterialProperty::~MaterialProperty() +{} + +void MaterialProperty::setModelUUID(const QString& uuid) +{ + _modelUUID = uuid; +} + +const QVariant MaterialProperty::getValue(void) const +{ + return _valuePtr->getValue(); +} + +MaterialValue* MaterialProperty::getMaterialValue(void) +{ + return _valuePtr; +} + +const QString MaterialProperty::getString(void) const +{ + if (getType() == MaterialValue::Quantity) { + Base::Quantity quantity = getValue().value(); + return quantity.getUserString(); + } + return getValue().toString(); +} + +void MaterialProperty::setPropertyType(const QString& type) +{ + ModelProperty::setPropertyType(type); + setType(type); +} + +void MaterialProperty::setType(const QString& type) +{ + if (_valuePtr) { + delete _valuePtr; + } + + if (type == QString::fromStdString("String")) { + _valuePtr = new MaterialValue(MaterialValue::String); + } + else if (type == QString::fromStdString("Boolean")) { + _valuePtr = new MaterialValue(MaterialValue::Boolean); + } + else if (type == QString::fromStdString("Integer")) { + _valuePtr = new MaterialValue(MaterialValue::Integer); + } + else if (type == QString::fromStdString("Float")) { + _valuePtr = new MaterialValue(MaterialValue::Float); + } + else if (type == QString::fromStdString("URL")) { + _valuePtr = new MaterialValue(MaterialValue::URL); + } + else if (type == QString::fromStdString("Quantity")) { + _valuePtr = new MaterialValue(MaterialValue::Quantity); + } + else if (type == QString::fromStdString("Color")) { + _valuePtr = new MaterialValue(MaterialValue::Color); + } + else if (type == QString::fromStdString("File")) { + _valuePtr = new MaterialValue(MaterialValue::File); + } + else if (type == QString::fromStdString("Image")) { + _valuePtr = new MaterialValue(MaterialValue::Image); + } + else if (type == QString::fromStdString("List")) { + _valuePtr = new MaterialValue(MaterialValue::List); + } + else if (type == QString::fromStdString("2DArray")) { + _valuePtr = new Material2DArray(); + } + else if (type == QString::fromStdString("3DArray")) { + _valuePtr = new Material3DArray(); + } + else { + // Error. Throw something + _valuePtr = new MaterialValue(MaterialValue::None); + std::string stringType = type.toStdString(); + std::string name = getName().toStdString(); + throw UnknownValueType(); + } +} + +MaterialProperty& MaterialProperty::getColumn(int column) +{ + try { + return _columns.at(column); + } + catch (std::out_of_range const&) { + throw InvalidColumn(); + } +} + +MaterialValue::ValueType MaterialProperty::getColumnType(int column) const +{ + try { + return _columns.at(column).getType(); + } + catch (std::out_of_range const&) { + throw InvalidColumn(); + } +} + +QString MaterialProperty::getColumnUnits(int column) const +{ + try { + return _columns.at(column).getUnits(); + } + catch (std::out_of_range const&) { + throw InvalidColumn(); + } +} + +QVariant MaterialProperty::getColumnNull(int column) const +{ + MaterialValue::ValueType valueType = getColumnType(column); + + switch (valueType) { + case MaterialValue::Quantity: { + Base::Quantity q = Base::Quantity(0, getColumnUnits(column)); + return QVariant::fromValue(q); + } + + case MaterialValue::Float: + case MaterialValue::Integer: + return QVariant(0); + + default: + break; + } + + return QVariant(QString()); +} + +void MaterialProperty::setValue(const QVariant& value) +{ + // _valueType = MaterialValue::String; + _valuePtr->setValue(value); +} + +void MaterialProperty::setValue(const QString& value) +{ + if (_valuePtr->getType() == MaterialValue::Boolean) { + setBoolean(value); + } + else if (_valuePtr->getType() == MaterialValue::Integer) { + setInt(value); + } + else if (_valuePtr->getType() == MaterialValue::Float) { + setFloat(value); + } + else if (_valuePtr->getType() == MaterialValue::URL) { + setURL(value); + } + else if (_valuePtr->getType() == MaterialValue::Quantity) { + // Base::Console().Log("\tParse quantity '%s'\n", value.toStdString().c_str()); + try { + setQuantity(Base::Quantity::parse(value)); + } + catch (const Base::ParserError& e) { + Base::Console().Log("Error '%s'\n", e.what()); + // Save as a string + setString(value); + } + } + else { + setString(value); + } +} + +void MaterialProperty::setString(const QString& value) +{ + // _valueType = MaterialValue::String; + _valuePtr->setValue(QVariant(value)); +} + +void MaterialProperty::setBoolean(bool value) +{ + // _valueType = MaterialValue::Boolean; + _valuePtr->setValue(QVariant(value)); +} + +void MaterialProperty::setBoolean(int value) +{ + // _valueType = MaterialValue::Boolean; + _valuePtr->setValue(QVariant(value != 0)); +} + +void MaterialProperty::setBoolean(const QString& value) +{ + // _valueType = MaterialValue::Boolean; + bool boolean; + std::string val = value.toStdString(); + if ((val == "true") || (val == "True")) { + boolean = true; + } + else if ((val == "false") || (val == "False")) { + boolean = false; + } + else { + boolean = (std::stoi(val) != 0); + } + + setBoolean(boolean); +} + +void MaterialProperty::setInt(int value) +{ + _valuePtr->setValue(QVariant(value)); +} + +void MaterialProperty::setInt(const QString& value) +{ + _valuePtr->setValue(value.toInt()); +} + +void MaterialProperty::setFloat(double value) +{ + _valuePtr->setValue(QVariant(value)); +} + +void MaterialProperty::setFloat(const QString& value) +{ + _valuePtr->setValue(QVariant(value.toFloat())); +} + +void MaterialProperty::setQuantity(const Base::Quantity& value) +{ + _valuePtr->setValue(QVariant(QVariant::fromValue(value))); +} + +void MaterialProperty::setQuantity(double value, const QString& units) +{ + setQuantity(Base::Quantity(value, units)); +} + +void MaterialProperty::setQuantity(const QString& value) +{ + setQuantity(Base::Quantity::parse(value)); +} + +void MaterialProperty::setURL(const QString& value) +{ + _valuePtr->setValue(QVariant(value)); +} + +MaterialProperty& MaterialProperty::operator=(const MaterialProperty& other) +{ + if (this == &other) { + return *this; + } + + ModelProperty::operator=(other); + _modelUUID = other._modelUUID; + delete _valuePtr; + if (other._valuePtr != nullptr) { + _valuePtr = new MaterialValue(*(other._valuePtr)); + } + else { + _valuePtr = nullptr; + } + + _columns.clear(); + for (auto it = other._columns.begin(); it != other._columns.end(); it++) { + _columns.push_back(*it); + } + + return *this; +} + +TYPESYSTEM_SOURCE(Materials::Material, Base::BaseClass) + +Material::Material() + : _dereferenced(false) +{} + +Material::Material(const MaterialLibrary& library, + const QString& directory, + const QString& uuid, + const QString& name) + : _library(library) + , _uuid(uuid) + , _name(name) + , _dereferenced(false) + , _editState(ModelEdit_None) +{ + setDirectory(directory); +} + +Material::Material(const Material& other) + : _library(other._library) + , _directory(other._directory) + , _uuid(other._uuid) + , _name(other._name) + , _authorAndLicense(other._authorAndLicense) + , _parentUuid(other._parentUuid) + , _description(other._description) + , _url(other._url) + , _reference(other._reference) + , _dereferenced(other._dereferenced) + , _editState(other._editState) +{ + for (auto it = other._tags.begin(); it != other._tags.end(); it++) { + _tags.push_back(*it); + } + for (auto it = other._physicalUuids.begin(); it != other._physicalUuids.end(); it++) { + _physicalUuids.push_back(*it); + } + for (auto it = other._appearanceUuids.begin(); it != other._appearanceUuids.end(); it++) { + _appearanceUuids.push_back(*it); + } + for (auto it = other._allUuids.begin(); it != other._allUuids.end(); it++) { + _allUuids.push_back(*it); + } + for (auto it = other._physical.begin(); it != other._physical.end(); it++) { + _physical[it->first] = MaterialProperty(it->second); + } + for (auto it = other._appearance.begin(); it != other._appearance.end(); it++) { + _appearance[it->first] = MaterialProperty(it->second); + } +} + +/* + * Destroys the object and frees any allocated resources + */ +Material::~Material() +{ + // no need to delete child widgets, Qt does it all for us +} + +void Material::addModel(const QString& uuid) +{ + for (QString modelUUID : _allUuids) { + if (modelUUID == uuid) { + return; + } + } + + _allUuids.push_back(uuid); + + ModelManager manager; + + try { + const Model& model = manager.getModel(uuid); + auto inheritance = model.getInheritance(); + for (auto inherits = inheritance.begin(); inherits != inheritance.end(); inherits++) { + addModel(*inherits); + } + } + catch (ModelNotFound const&) { + } +} + +void Material::setEditState(ModelEdit newState) +{ + if (newState == ModelEdit_Extend) { + if (_editState != ModelEdit_Alter) { + _editState = newState; + } + } + else if (newState == ModelEdit_Alter) { + _editState = newState; + } +} + +void Material::addPhysical(const QString& uuid) +{ + if (hasPhysicalModel(uuid)) { + return; + } + + ModelManager manager; + + try { + const Model& model = manager.getModel(uuid); + + _physicalUuids.push_back(uuid); + addModel(uuid); + setEditStateExtend(); + + for (auto it = model.begin(); it != model.end(); it++) { + QString propertyName = it->first; + ModelProperty property = static_cast(it->second); + + try { + _physical[propertyName] = MaterialProperty(property); + } + catch (const UnknownValueType&) { + Base::Console().Error("Property '%s' has unknown type '%s'. Ignoring\n", + property.getName().toStdString().c_str(), + property.getPropertyType().toStdString().c_str()); + } + } + } + catch (ModelNotFound const&) { + } +} + +void Material::addAppearance(const QString& uuid) +{ + if (hasAppearanceModel(uuid)) { + return; + } + + ModelManager manager; + + try { + const Model& model = manager.getModel(uuid); + + _appearanceUuids.push_back(uuid); + addModel(uuid); + setEditStateExtend(); + + for (auto it = model.begin(); it != model.end(); it++) { + QString propertyName = it->first; + ModelProperty property = static_cast(it->second); + + _appearance[propertyName] = MaterialProperty(property); + } + } + catch (ModelNotFound const&) { + } +} + +void Material::setPhysicalEditState(const QString& name) +{ + if (getPhysicalProperty(name).isNull()) { + setEditStateExtend(); + } + else { + setEditStateAlter(); + } +} + +void Material::setAppearanceEditState(const QString& name) +{ + if (getAppearanceProperty(name).isNull()) { + setEditStateExtend(); + } + else { + setEditStateAlter(); + } +} + +void Material::setPhysicalValue(const QString& name, const QString& value) +{ + setPhysicalEditState(name); + + _physical[name].setValue(value);// may not be a string type +} + +void Material::setPhysicalValue(const QString& name, int value) +{ + setPhysicalEditState(name); + + _physical[name].setInt(value); +} + +void Material::setPhysicalValue(const QString& name, double value) +{ + setPhysicalEditState(name); + + _physical[name].setFloat(value); +} + +void Material::setPhysicalValue(const QString& name, const Base::Quantity value) +{ + setPhysicalEditState(name); + + _physical[name].setQuantity(value); +} + +void Material::setAppearanceValue(const QString& name, const QString& value) +{ + setAppearanceEditState(name); + + _appearance[name].setValue(value);// may not be a string type +} + +MaterialProperty& Material::getPhysicalProperty(const QString& name) +{ + try { + return _physical.at(name); + } + catch (std::out_of_range const&) { + throw PropertyNotFound(); + } +} + +const MaterialProperty& Material::getPhysicalProperty(const QString& name) const +{ + try { + return _physical.at(name); + } + catch (std::out_of_range const&) { + throw PropertyNotFound(); + } +} + +MaterialProperty& Material::getAppearanceProperty(const QString& name) +{ + try { + return _appearance.at(name); + } + catch (std::out_of_range const&) { + throw PropertyNotFound(); + } +} + +const MaterialProperty& Material::getAppearanceProperty(const QString& name) const +{ + try { + return _appearance.at(name); + } + catch (std::out_of_range const&) { + throw PropertyNotFound(); + } +} + +const QVariant Material::getValue(const std::map& propertyList, + const QString& name) const +{ + try { + return propertyList.at(name).getValue(); + } + catch (std::out_of_range const&) { + throw PropertyNotFound(); + } +} + +const QString Material::getValueString(const std::map& propertyList, + const QString& name) const +{ + try { + if (propertyList.at(name).getType() == MaterialValue::Quantity) { + auto value = propertyList.at(name).getValue(); + if (value.isNull()) { + return QString(); + } + return value.value().getUserString(); + } + return propertyList.at(name).getValue().toString(); + } + catch (std::out_of_range const&) { + throw PropertyNotFound(); + } +} + +const QVariant Material::getPhysicalValue(const QString& name) const +{ + return getValue(_physical, name); +} + +const QString Material::getPhysicalValueString(const QString& name) const +{ + return getValueString(_physical, name); +} + +const QVariant Material::getAppearanceValue(const QString& name) const +{ + return getValue(_appearance, name); +} + +const QString Material::getAppearanceValueString(const QString& name) const +{ + return getValueString(_appearance, name); +} + +bool Material::hasPhysicalProperty(const QString& name) const +{ + try { + static_cast(_physical.at(name)); + } + catch (std::out_of_range const&) { + return false; + } + return true; +} + +bool Material::hasAppearanceProperty(const QString& name) const +{ + try { + static_cast(_appearance.at(name)); + } + catch (std::out_of_range const&) { + return false; + } + return true; +} + +bool Material::hasModel(const QString& uuid) const +{ + for (QString modelUUID : _allUuids) { + if (modelUUID == uuid) { + return true; + } + } + + return false; +} + +bool Material::hasPhysicalModel(const QString& uuid) const +{ + if (!hasModel(uuid)) { + return false; + } + + ModelManager manager; + + try { + const Model& model = manager.getModel(uuid); + if (model.getType() == Model::ModelType_Physical) { + return true; + } + } + catch (ModelNotFound const&) { + } + + return false; +} + +bool Material::hasAppearanceModel(const QString& uuid) const +{ + if (!hasModel(uuid)) { + return false; + } + + ModelManager manager; + + try { + const Model& model = manager.getModel(uuid); + if (model.getType() == Model::ModelType_Appearance) { + return true; + } + } + catch (ModelNotFound const&) { + } + + return false; +} + +bool Material::isPhysicalModelComplete(const QString& uuid) const +{ + if (!hasPhysicalModel(uuid)) { + return false; + } + + ModelManager manager; + + try { + const Model& model = manager.getModel(uuid); + for (auto it = model.begin(); it != model.end(); it++) { + QString propertyName = it->first; + const MaterialProperty& property = getPhysicalProperty(propertyName); + + if (property.isNull()) { + return false; + } + } + } + catch (ModelNotFound const&) { + return false; + } + + return true; +} + +bool Material::isAppearanceModelComplete(const QString& uuid) const +{ + if (!hasAppearanceModel(uuid)) { + return false; + } + + ModelManager manager; + + try { + const Model& model = manager.getModel(uuid); + for (auto it = model.begin(); it != model.end(); it++) { + QString propertyName = it->first; + const MaterialProperty& property = getAppearanceProperty(propertyName); + + if (property.isNull()) { + return false; + } + } + } + catch (ModelNotFound const&) { + return false; + } + + return true; +} + +void Material::saveGeneral(QTextStream& stream) const +{ + stream << "General:\n"; + stream << " UUID: \"" << _uuid << "\"\n"; + stream << " Name: \"" << _name << "\"\n"; + if (!_authorAndLicense.isEmpty()) { + stream << " AuthorAndLicense: \"" << _authorAndLicense << "\"\n"; + } + if (!_description.isEmpty()) { + stream << " Description: \"" << _description << "\"\n"; + } + if (!_url.isEmpty()) { + stream << " SourceURL: \"" << _url << "\"\n"; + } + if (!_reference.isEmpty()) { + stream << " ReferenceSource: \"" << _reference << "\"\n"; + } +} + +void Material::saveInherits(QTextStream& stream) const +{ + if (!_parentUuid.isEmpty()) { + MaterialManager manager; + + stream << "Inherits:\n"; + stream << " " << manager.getMaterial(_parentUuid).getName() << ":\n"; + stream << " UUID: \"" << _parentUuid << "\"\n"; + } +} + +void Material::saveModels(QTextStream& stream) const +{ + if (!_physical.empty()) { + ModelManager modelManager; + + stream << "Models:\n"; + for (auto itm = _physicalUuids.begin(); itm != _physicalUuids.end(); itm++) { + auto model = modelManager.getModel(*itm); + stream << " " << model.getName() << ":\n"; + stream << " UUID: \"" << model.getUUID() << "\"\n"; + for (auto itp = model.begin(); itp != model.end(); itp++) { + QString propertyName = itp->first; + const MaterialProperty& property = getPhysicalProperty(propertyName); + + if (!property.isNull()) { + stream << " " << propertyName << ": \"" + << getPhysicalValueString(propertyName) << "\"\n"; + } + } + } + } +} + +void Material::saveAppearanceModels(QTextStream& stream) const +{ + if (!_appearance.empty()) { + ModelManager modelManager; + + stream << "AppearanceModels:\n"; + for (auto itm = _appearanceUuids.begin(); itm != _appearanceUuids.end(); itm++) { + auto model = modelManager.getModel(*itm); + stream << " " << model.getName() << ":\n"; + stream << " UUID: \"" << model.getUUID() << "\"\n"; + for (auto itp = model.begin(); itp != model.end(); itp++) { + QString propertyName = itp->first; + const MaterialProperty& property = getAppearanceProperty(propertyName); + + if (!property.isNull()) { + stream << " " << propertyName << ": \"" + << getAppearanceValueString(propertyName) << "\"\n"; + } + } + } + } +} + +void Material::newUuid() +{ + _uuid = QUuid::createUuid().toString(QUuid::WithoutBraces); +} + +void Material::save(QTextStream& stream, bool saveAsCopy) +{ + Q_UNUSED(saveAsCopy) + + stream << "# File created by FreeCAD\n"; + saveGeneral(stream); + saveInherits(stream); + saveModels(stream); + saveAppearanceModels(stream); +} + +Material& Material::operator=(const Material& other) +{ + if (this == &other) { + return *this; + } + + _library = other._library; + _directory = other._directory; + _uuid = other._uuid; + _name = other._name; + _authorAndLicense = other._authorAndLicense; + _parentUuid = other._parentUuid; + _description = other._description; + _url = other._url; + _reference = other._reference; + _dereferenced = other._dereferenced; + + _tags.clear(); + for (auto it = other._tags.begin(); it != other._tags.end(); it++) { + _tags.push_back(*it); + } + _physicalUuids.clear(); + for (auto it = other._physicalUuids.begin(); it != other._physicalUuids.end(); it++) { + _physicalUuids.push_back(*it); + } + _appearanceUuids.clear(); + for (auto it = other._appearanceUuids.begin(); it != other._appearanceUuids.end(); it++) { + _appearanceUuids.push_back(*it); + } + _allUuids.clear(); + for (auto it = other._allUuids.begin(); it != other._allUuids.end(); it++) { + _allUuids.push_back(*it); + } + _physical.clear(); + for (auto it = other._physical.begin(); it != other._physical.end(); it++) { + _physical[it->first] = MaterialProperty(it->second); + } + _appearance.clear(); + for (auto it = other._appearance.begin(); it != other._appearance.end(); it++) { + _appearance[it->first] = MaterialProperty(it->second); + } + + return *this; +} diff --git a/src/Mod/Material/App/Materials.h b/src/Mod/Material/App/Materials.h new file mode 100644 index 0000000000..b8a950459f --- /dev/null +++ b/src/Mod/Material/App/Materials.h @@ -0,0 +1,334 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATERIAL_MATERIALS_H +#define MATERIAL_MATERIALS_H + +#include +#include +#include +#include + +#include + +#include "MaterialLibrary.h" +#include "Model.h" + +namespace fs = boost::filesystem; + +namespace Materials +{ + +class MaterialsExport MaterialProperty: public ModelProperty +{ + TYPESYSTEM_HEADER_WITH_OVERRIDE(); + +public: + MaterialProperty(); + explicit MaterialProperty(const ModelProperty& property); + explicit MaterialProperty(const MaterialProperty& property); + virtual ~MaterialProperty(); + + MaterialValue::ValueType getType(void) const + { + return _valuePtr->getType(); + } + + const QString getModelUUID(void) const; + const QVariant getValue(void) const; + bool isNull() const + { + return _valuePtr->isNull(); + } + MaterialValue* getMaterialValue(void); + const QString getString(void) const; + bool getBoolean(void) const; + int getInt(void) const; + double getFloat(void) const; + const Base::Quantity& getQuantity(void) const; + const QString getURL(void) const; + + MaterialProperty& getColumn(int column); + MaterialValue::ValueType getColumnType(int column) const; + QString getColumnUnits(int column) const; + QVariant getColumnNull(int column) const; + + void setModelUUID(const QString& uuid); + void setPropertyType(const QString& type) override; + void setValue(const QVariant& value); + void setValue(const QString& value); + void setString(const QString& value); + void setBoolean(bool value); + void setBoolean(int value); + void setBoolean(const QString& value); + void setInt(int value); + void setInt(const QString& value); + void setFloat(double value); + void setFloat(const QString& value); + void setQuantity(const Base::Quantity& value); + void setQuantity(double value, const QString& units); + void setQuantity(const QString& value); + void setURL(const QString& value); + + MaterialProperty& operator=(const MaterialProperty& other); + +protected: + void setType(const QString& type); + // void setType(MaterialValue::ValueType type) { _valueType = type; } + + void addColumn(MaterialProperty& column) + { + _columns.push_back(column); + } + +private: + QString _modelUUID; + MaterialValue* _valuePtr; + std::vector _columns; +}; + +class MaterialsExport Material: public Base::BaseClass +{ + TYPESYSTEM_HEADER(); + +public: + enum ModelEdit + { + ModelEdit_None, // No change + ModelEdit_Alter,// Existing values are changed + ModelEdit_Extend// New values added + }; + + Material(); + explicit Material(const MaterialLibrary& library, + const QString& directory, + const QString& uuid, + const QString& name); + explicit Material(const Material& other); + virtual ~Material(); + + const MaterialLibrary& getLibrary() const + { + return _library; + } + const QString getDirectory() const + { + return _directory; + } + const QString getUUID() const + { + return _uuid; + } + const QString getName() const + { + return _name; + } + const QString getAuthorAndLicense() const + { + return _authorAndLicense; + } + const QString getParentUUID() const + { + return _parentUuid; + } + const QString getDescription() const + { + return _description; + } + const QString getURL() const + { + return _url; + } + const QString getReference() const + { + return _reference; + } + ModelEdit getEditState() const + { + return _editState; + } + const std::list& getTags() const + { + return _tags; + } + const std::vector* getPhysicalModels() const + { + return &_physicalUuids; + } + const std::vector* getAppearanceModels() const + { + return &_appearanceUuids; + } + + void setLibrary(const MaterialLibrary& library) + { + _library = library; + } + void setDirectory(const QString& directory) + { + Base::Console().Log("Materials::setDirectory(%s)\n", directory.toStdString().c_str()); + _directory = directory; + } + void setUUID(const QString& uuid) + { + _uuid = uuid; + } + void setName(const QString& name) + { + _name = name; + } + void setAuthorAndLicense(const QString& authorAndLicense) + { + _authorAndLicense = authorAndLicense; + } + void setParentUUID(const QString& uuid) + { + _parentUuid = uuid; + } + void setDescription(const QString& description) + { + _description = description; + } + void setURL(const QString& url) + { + _url = url; + } + void setReference(const QString& reference) + { + _reference = reference; + } + void setEditState(ModelEdit newState); + void setEditStateAlter() + { + setEditState(ModelEdit_Alter); + } + void setEditStateExtend() + { + setEditState(ModelEdit_Extend); + } + void setPhysicalEditState(const QString& name); + void setAppearanceEditState(const QString& name); + void resetEditState() + { + _editState = ModelEdit_None; + } + void addTag(const QString& tag) + { + Q_UNUSED(tag); + } + void removeTag(const QString& tag) + { + Q_UNUSED(tag); + } + void addPhysical(const QString& uuid); + void addAppearance(const QString& uuid); + void newUuid(); + + void setPhysicalValue(const QString& name, const QString& value); + void setPhysicalValue(const QString& name, int value); + void setPhysicalValue(const QString& name, double value); + void setPhysicalValue(const QString& name, const Base::Quantity value); + + void setAppearanceValue(const QString& name, const QString& value); + + MaterialProperty& getPhysicalProperty(const QString& name); + const MaterialProperty& getPhysicalProperty(const QString& name) const; + MaterialProperty& getAppearanceProperty(const QString& name); + const MaterialProperty& getAppearanceProperty(const QString& name) const; + const QVariant getPhysicalValue(const QString& name) const; + const QString getPhysicalValueString(const QString& name) const; + const QVariant getAppearanceValue(const QString& name) const; + const QString getAppearanceValueString(const QString& name) const; + bool hasPhysicalProperty(const QString& name) const; + bool hasAppearanceProperty(const QString& name) const; + + // Test if the model is defined, and if values are provided for all properties + bool hasModel(const QString& uuid) const; + bool hasPhysicalModel(const QString& uuid) const; + bool hasAppearanceModel(const QString& uuid) const; + bool isModelComplete(const QString& uuid) const + { + return isPhysicalModelComplete(uuid) || isAppearanceModelComplete(uuid); + } + bool isPhysicalModelComplete(const QString& uuid) const; + bool isAppearanceModelComplete(const QString& uuid) const; + + const std::map& getPhysicalProperties() const + { + return _physical; + } + const std::map& getAppearanceProperties() const + { + return _appearance; + } + + bool getDereferenced() const + { + return _dereferenced; + } + void markDereferenced() + { + _dereferenced = true; + } + + void save(QTextStream& stream, bool saveAsCopy); + + Material& operator=(const Material& other); + +protected: + void addModel(const QString& uuid); + + const QVariant getValue(const std::map& propertyList, + const QString& name) const; + const QString getValueString(const std::map& propertyList, + const QString& name) const; + + void saveGeneral(QTextStream& stream) const; + void saveInherits(QTextStream& stream) const; + void saveModels(QTextStream& stream) const; + void saveAppearanceModels(QTextStream& stream) const; + +private: + MaterialLibrary _library; + QString _directory; + QString _uuid; + QString _name; + QString _authorAndLicense; + QString _parentUuid; + QString _description; + QString _url; + QString _reference; + std::list _tags; + std::vector _physicalUuids; + std::vector _appearanceUuids; + std::vector _allUuids;// Includes inherited models + std::map _physical; + std::map _appearance; + bool _dereferenced; + ModelEdit _editState; +}; + +}// namespace Materials + +Q_DECLARE_METATYPE(Materials::Material*) + +#endif// MATERIAL_MATERIALS_H diff --git a/src/Mod/Material/App/Model.cpp b/src/Mod/Material/App/Model.cpp new file mode 100644 index 0000000000..a6b8990db6 --- /dev/null +++ b/src/Mod/Material/App/Model.cpp @@ -0,0 +1,116 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" +#ifndef _PreComp_ +#endif + +#include "Exceptions.h" +#include "Model.h" +#include "ModelLibrary.h" +#include + + +using namespace Materials; + +TYPESYSTEM_SOURCE(Materials::ModelProperty, Base::BaseClass) + +ModelProperty::ModelProperty() +{} + +ModelProperty::ModelProperty(const QString& name, + const QString& type, + const QString& units, + const QString& url, + const QString& description) + : _name(name) + , _propertyType(type) + , _units(units) + , _url(url) + , _description(description) +{} + +ModelProperty::ModelProperty(const ModelProperty& other) + : _name(other._name) + , _propertyType(other._propertyType) + , _units(other._units) + , _url(other._url) + , _description(other._description) + , _inheritance(other._inheritance) +{ + for (auto it = other._columns.begin(); it != other._columns.end(); it++) { + _columns.push_back(*it); + } +} + +ModelProperty& ModelProperty::operator=(const ModelProperty& other) +{ + if (this == &other) { + return *this; + } + + _name = other._name; + _propertyType = other._propertyType; + _units = other._units; + _url = other._url; + _description = other._description; + _inheritance = other._inheritance; + _columns.clear(); + for (auto it = other._columns.begin(); it != other._columns.end(); it++) { + _columns.push_back(*it); + } + + return *this; +} + +TYPESYSTEM_SOURCE(Materials::Model, Base::BaseClass) + +Model::Model() +{} + +Model::Model(const ModelLibrary& library, + ModelType type, + const QString& name, + const QString& directory, + const QString& uuid, + const QString& description, + const QString& url, + const QString& doi) + : _library(library) + , _type(type) + , _name(name) + , _directory(directory) + , _uuid(uuid) + , _description(description) + , _url(url) + , _doi(doi) +{} + +ModelProperty& Model::operator[](const QString& key) +{ + try { + return _properties.at(key); + } + catch (std::out_of_range const&) { + throw PropertyNotFound(); + } +} diff --git a/src/Mod/Material/App/Model.h b/src/Mod/Material/App/Model.h new file mode 100644 index 0000000000..5284e0042e --- /dev/null +++ b/src/Mod/Material/App/Model.h @@ -0,0 +1,297 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATERIAL_MODEL_H +#define MATERIAL_MODEL_H + +#include +#include +#include +#include + +#include "MaterialValue.h" +#include "ModelLibrary.h" + +namespace Materials +{ + +class MaterialsExport ModelProperty: public Base::BaseClass +{ + TYPESYSTEM_HEADER(); + +public: + ModelProperty(); + explicit ModelProperty(const QString& name, + const QString& type, + const QString& units, + const QString& url, + const QString& description); + explicit ModelProperty(const ModelProperty& other); + virtual ~ModelProperty() = default; + + const QString getName() const + { + return _name; + } + const QString getPropertyType() const + { + return _propertyType; + } + const QString getUnits() const + { + return _units; + } + const QString getURL() const + { + return _url; + } + const QString getDescription() const + { + return _description; + } + const QString getInheritance() const + { + return _inheritance; + } + bool isInherited() const + { + return (_inheritance.length() > 0); + } + + void setName(const QString& name) + { + _name = name; + } + virtual void setPropertyType(const QString& type) + { + _propertyType = type; + } + void setUnits(const QString& units) + { + _units = units; + } + void setURL(const QString& url) + { + _url = url; + } + void setDescription(const QString& description) + { + _description = description; + } + void setInheritance(const QString& uuid) + { + _inheritance = uuid; + } + + void addColumn(ModelProperty& column) + { + _columns.push_back(column); + } + const std::vector& getColumns() const + { + return _columns; + } + int columns() const + { + return _columns.size(); + } + + ModelProperty& operator=(const ModelProperty& other); + +private: + QString _name; + QString _propertyType; + QString _units; + QString _url; + QString _description; + QString _inheritance; + std::vector _columns; +}; + +class MaterialsExport Model: public Base::BaseClass +{ + TYPESYSTEM_HEADER(); + +public: + enum ModelType + { + ModelType_Physical, + ModelType_Appearance + }; + + Model(); + explicit Model(const ModelLibrary& library, + ModelType type, + const QString& name, + const QString& directory, + const QString& uuid, + const QString& description, + const QString& url, + const QString& doi); + virtual ~Model() = default; + + const ModelLibrary& getLibrary() const + { + return _library; + } + const QString getBase() const + { + return (_type == ModelType_Physical) ? QString::fromStdString("Model") + : QString::fromStdString("AppearanceModel"); + } + const QString getName() const + { + return _name; + } + ModelType getType() const + { + return _type; + } + const QString getDirectory() const + { + return _directory; + } + const QString getDirectoryPath() const + { + return QDir(_directory).absolutePath(); + } + const QString getRelativePath() const + { + return QDir(_directory).relativeFilePath(QDir(_directory).absolutePath()); + } + const QString getUUID() const + { + return _uuid; + } + const QString getDescription() const + { + return _description; + } + const QString getURL() const + { + return _url; + } + const QString getDOI() const + { + return _doi; + } + + void setLibrary(const ModelLibrary& library) + { + _library = library; + } + void setType(ModelType type) + { + _type = type; + } + void setName(const QString& name) + { + _name = name; + } + void setDirectory(const QString& directory) + { + _directory = directory; + } + void setUUID(const QString& uuid) + { + _uuid = uuid; + } + void setDescription(const QString& description) + { + _description = description; + } + void setURL(const QString& url) + { + _url = url; + } + void setDOI(const QString& doi) + { + _doi = doi; + } + + void addInheritance(const QString& uuid) + { + _inheritedUuids.push_back(uuid); + } + const std::vector& getInheritance() const + { + return _inheritedUuids; + } + + bool operator==(const Model& m) const + { + return _uuid == m._uuid; + } + bool operator!=(const Model& m) const + { + return !operator==(m); + } + + ModelProperty& operator[](const QString& key); + void addProperty(ModelProperty& property) + { + _properties[property.getName()] = property; + } + + using iterator = typename std::map::iterator; + using const_iterator = typename std::map::const_iterator; + iterator begin() + { + return _properties.begin(); + } + const_iterator begin() const noexcept + { + return _properties.begin(); + } + iterator end() noexcept + { + return _properties.end(); + } + const_iterator end() const noexcept + { + return _properties.end(); + } + const_iterator cbegin() const noexcept + { + return _properties.cbegin(); + } + const_iterator cend() const noexcept + { + return _properties.cend(); + } + +private: + ModelLibrary _library; + ModelType _type; + QString _name; + QString _directory; + QString _uuid; + QString _description; + QString _url; + QString _doi; + std::vector _inheritedUuids; + std::map _properties; +}; + +}// namespace Materials + +#endif// MATERIAL_MODEL_H diff --git a/src/Mod/Material/App/ModelLibrary.cpp b/src/Mod/Material/App/ModelLibrary.cpp new file mode 100644 index 0000000000..d42676b8ec --- /dev/null +++ b/src/Mod/Material/App/ModelLibrary.cpp @@ -0,0 +1,114 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" +#ifndef _PreComp_ +#endif + +#include + +#include + +#include "Exceptions.h" +#include "Model.h" +#include "ModelLibrary.h" + + +using namespace Materials; + +TYPESYSTEM_SOURCE(Materials::LibraryBase, Base::BaseClass) + +LibraryBase::LibraryBase(const QString& libraryName, const QString& dir, const QString& icon) + : _name(libraryName) + , _directory(QDir::cleanPath(dir)) + , _iconPath(icon) +{} + +LibraryBase::LibraryBase() +{} + +bool LibraryBase::operator==(const LibraryBase& library) const +{ + return (_name == library._name) && (_directory == library._directory); +} + +QString LibraryBase::getLocalPath(const QString& path) const +{ + QString filePath = getDirectoryPath(); + QString cleanPath = QDir::cleanPath(path); + QString prefix = QString::fromStdString("/") + getName(); + if (cleanPath.startsWith(prefix)) { + // Remove the library name from the path + filePath += cleanPath.right(cleanPath.length() - prefix.length()); + } + else { + filePath += cleanPath; + } + + return filePath; +} + +QString LibraryBase::getRelativePath(const QString& path) const +{ + QString filePath; + QString cleanPath = QDir::cleanPath(path); + QString prefix = QString::fromStdString("/") + getName(); + if (cleanPath.startsWith(prefix)) { + // Remove the library name from the path + filePath = cleanPath.right(cleanPath.length() - prefix.length()); + } + else { + filePath = cleanPath; + } + + prefix = getDirectoryPath(); + if (filePath.startsWith(prefix)) { + // Remove the library root from the path + filePath = filePath.right(filePath.length() - prefix.length()); + } + + // Remove any leading '/' + if (filePath.startsWith(QString::fromStdString("/"))) { + filePath.remove(0, 1); + } + + return filePath; +} + +TYPESYSTEM_SOURCE(Materials::ModelLibrary, LibraryBase) + +ModelLibrary::ModelLibrary(const QString& libraryName, const QString& dir, const QString& icon) + : LibraryBase(libraryName, dir, icon) +{} + +ModelLibrary::ModelLibrary() +{} + +Model* ModelLibrary::addModel(const Model& model, const QString& path) +{ + QString filePath = getRelativePath(path); + Model* newModel = new Model(model); + newModel->setLibrary(*this); + newModel->setDirectory(filePath); + + return newModel; +} diff --git a/src/Mod/Material/App/ModelLibrary.h b/src/Mod/Material/App/ModelLibrary.h new file mode 100644 index 0000000000..bca16e1180 --- /dev/null +++ b/src/Mod/Material/App/ModelLibrary.h @@ -0,0 +1,100 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATERIAL_MODELLIBRARY_H +#define MATERIAL_MODELLIBRARY_H + +#include +#include +#include +#include + +#include "MaterialValue.h" + +namespace Materials +{ + +class Model; + +class MaterialsExport LibraryBase: public Base::BaseClass +{ + TYPESYSTEM_HEADER(); + +public: + LibraryBase(); + explicit LibraryBase(const QString& libraryName, const QString& dir, const QString& icon); + virtual ~LibraryBase() = default; + + const QString getName() const + { + return _name; + } + const QString getDirectory() const + { + return _directory; + } + const QString getDirectoryPath() const + { + return QDir(_directory).absolutePath(); + } + const QString getIconPath() const + { + return _iconPath; + } + bool operator==(const LibraryBase& library) const; + bool operator!=(const LibraryBase& library) const + { + return !operator==(library); + } + QString getLocalPath(const QString& path) const; + QString getRelativePath(const QString& path) const; + +private: + QString _name; + QString _directory; + QString _iconPath; +}; + +class MaterialsExport ModelLibrary: public LibraryBase +{ + TYPESYSTEM_HEADER(); + +public: + ModelLibrary(); + explicit ModelLibrary(const QString& libraryName, const QString& dir, const QString& icon); + virtual ~ModelLibrary() = default; + + bool operator==(const ModelLibrary& library) const + { + return LibraryBase::operator==(library); + } + bool operator!=(const ModelLibrary& library) const + { + return !operator==(library); + } + + Model* addModel(const Model& model, const QString& path); +}; + +}// namespace Materials + +#endif// MATERIAL_MODELLIBRARY_H diff --git a/src/Mod/Material/App/ModelLoader.cpp b/src/Mod/Material/App/ModelLoader.cpp new file mode 100644 index 0000000000..7d7e65c7fd --- /dev/null +++ b/src/Mod/Material/App/ModelLoader.cpp @@ -0,0 +1,417 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" +#ifndef _PreComp_ +#include +#endif + +#include +#include + +#include +#include + +#include "Model.h" +#include "ModelLoader.h" +#include "ModelManager.h" + + +using namespace Materials; + +ModelEntry::ModelEntry(const ModelLibrary& library, + const QString& baseName, + const QString& modelName, + const QString& dir, + const QString& modelUuid, + const YAML::Node& modelData) + : _library(library) + , _base(baseName) + , _name(modelName) + , _directory(dir) + , _uuid(modelUuid) + , _model(modelData) + , _dereferenced(false) +{} + +std::map* ModelLoader::_modelEntryMap = nullptr; + +ModelLoader::ModelLoader(std::map* modelMap, std::list* libraryList) + : _modelMap(modelMap) + , _libraryList(libraryList) +{ + loadLibraries(); +} + +void ModelLoader::addLibrary(ModelLibrary* model) +{ + _libraryList->push_back(model); +} + +const QString ModelLoader::getUUIDFromPath(const QString& path) +{ + QFile file(path); + if (!file.exists()) { + throw ModelNotFound(); + } + + try { + YAML::Node yamlroot = YAML::LoadFile(path.toStdString()); + std::string base = "Model"; + if (yamlroot["AppearanceModel"]) { + base = "AppearanceModel"; + } + + const QString uuid = QString::fromStdString(yamlroot[base]["UUID"].as()); + return uuid; + } + catch (YAML::Exception& ex) { + throw ModelNotFound(); + } +} + +ModelEntry* ModelLoader::getModelFromPath(const ModelLibrary& library, const QString& path) const +{ + QFile file(path); + if (!file.exists()) { + throw ModelNotFound(); + } + + YAML::Node yamlroot; + std::string base = "Model"; + std::string uuid; + std::string name; + try { + yamlroot = YAML::LoadFile(path.toStdString()); + if (yamlroot["AppearanceModel"]) { + base = "AppearanceModel"; + } + + uuid = yamlroot[base]["UUID"].as(); + name = yamlroot[base]["Name"].as(); + } + catch (YAML::Exception const&) { + throw InvalidModel(); + } + + ModelEntry* model = new ModelEntry(library, + QString::fromStdString(base), + QString::fromStdString(name), + path, + QString::fromStdString(uuid), + yamlroot); + + return model; +} + +void ModelLoader::showYaml(const YAML::Node& yaml) const +{ + std::stringstream out; + + out << yaml; + std::string logData = out.str(); + Base::Console().Log("%s\n", logData.c_str()); +} + +void ModelLoader::dereference(const QString& uuid, + ModelEntry* parent, + const ModelEntry* child, + std::map, QString>* inheritances) +{ + auto parentPtr = parent->getModelPtr(); + auto parentBase = parent->getBase().toStdString(); + auto childYaml = child->getModel(); + auto childBase = child->getBase().toStdString(); + + std::set exclude; + exclude.insert(QString::fromStdString("Name")); + exclude.insert(QString::fromStdString("UUID")); + exclude.insert(QString::fromStdString("URL")); + exclude.insert(QString::fromStdString("Description")); + exclude.insert(QString::fromStdString("DOI")); + exclude.insert(QString::fromStdString("Inherits")); + + auto parentProperties = (*parentPtr)[parentBase]; + auto childProperties = childYaml[childBase]; + for (auto it = childProperties.begin(); it != childProperties.end(); it++) { + std::string name = it->first.as(); + if (exclude.count(QString::fromStdString(name)) == 0) { + // showYaml(it->second); + if (!parentProperties[name]) { + parentProperties[name] = it->second; + // parentProperties[name]["Inherits"] = childYaml[childBase]["UUID"]; + (*inheritances)[std::pair(uuid, QString::fromStdString(name))] = + yamlValue(childYaml[childBase], "UUID", ""); + } + } + } + // showYaml(*parentPtr); +} + + +void ModelLoader::dereference(ModelEntry* model, + std::map, QString>* inheritances) +{ + // Avoid recursion + if (model->getDereferenced()) { + return; + } + + auto yamlModel = model->getModel(); + auto base = model->getBase().toStdString(); + if (yamlModel[base]["Inherits"]) { + auto inherits = yamlModel[base]["Inherits"]; + for (auto it = inherits.begin(); it != inherits.end(); it++) { + QString nodeName = QString::fromStdString((*it)["UUID"].as()); + + // This requires that all models have already been loaded undereferenced + try { + const ModelEntry* child = (*_modelEntryMap)[nodeName]; + dereference(model->getUUID(), model, child, inheritances); + } + catch (const std::out_of_range& oor) { + Base::Console().Log("Unable to find '%s' in model map\n", + nodeName.toStdString().c_str()); + } + } + } + + model->markDereferenced(); +} + +QString ModelLoader::yamlValue(const YAML::Node& node, + const std::string& key, + const std::string& defaultValue) +{ + if (node[key]) { + return QString::fromStdString(node[key].as()); + } + return QString::fromStdString(defaultValue); +} + +void ModelLoader::addToTree(ModelEntry* model, + std::map, QString>* inheritances) +{ + std::set exclude; + exclude.insert(QString::fromStdString("Name")); + exclude.insert(QString::fromStdString("UUID")); + exclude.insert(QString::fromStdString("URL")); + exclude.insert(QString::fromStdString("Description")); + exclude.insert(QString::fromStdString("DOI")); + exclude.insert(QString::fromStdString("Inherits")); + + auto yamlModel = model->getModel(); + auto library = model->getLibrary(); + auto base = model->getBase().toStdString(); + auto name = model->getName(); + auto directory = model->getDirectory(); + auto uuid = model->getUUID(); + + QString version = yamlValue(yamlModel["General"], "Version", ""); + + QString description = yamlValue(yamlModel[base], "Description", ""); + QString url = yamlValue(yamlModel[base], "URL", ""); + QString doi = yamlValue(yamlModel[base], "DOI", ""); + + Model::ModelType type = + (base == "Model") ? Model::ModelType_Physical : Model::ModelType_Appearance; + + Model* finalModel = new Model(library, type, name, directory, uuid, description, url, doi); + + // Add inheritance list + if (yamlModel[base]["Inherits"]) { + auto inherits = yamlModel[base]["Inherits"]; + for (auto it = inherits.begin(); it != inherits.end(); it++) { + QString nodeName = QString::fromStdString((*it)["UUID"].as()); + + finalModel->addInheritance(nodeName); + } + } + + // Add property list + auto yamlProperties = yamlModel[base]; + for (auto it = yamlProperties.begin(); it != yamlProperties.end(); it++) { + std::string propName = it->first.as(); + if (exclude.count(QString::fromStdString(propName)) == 0) { + // showYaml(it->second); + auto yamlProp = yamlProperties[propName]; + auto propType = yamlValue(yamlProp, "Type", ""); + auto propUnits = yamlValue(yamlProp, "Units", ""); + auto propURL = yamlValue(yamlProp, "URL", ""); + auto propDescription = yamlValue(yamlProp, "Description", ""); + // auto inherits = yamlValue(yamlProp, "Inherits", ""); + + ModelProperty property(QString::fromStdString(propName), + propType, + propUnits, + propURL, + propDescription); + + if (propType == QString::fromStdString("2DArray") + || propType == QString::fromStdString("3DArray")) { + Base::Console().Log("Reading columns\n"); + // Read the columns + auto cols = yamlProp["Columns"]; + for (auto col : cols) { + std::string colName = col.first.as(); + Base::Console().Log("\tColumns '%s'\n", colName.c_str()); + + auto colProp = cols[colName]; + auto colPropType = yamlValue(colProp, "Type", ""); + auto colPropUnits = yamlValue(colProp, "Units", ""); + auto colPropURL = yamlValue(colProp, "URL", ""); + auto colPropDescription = yamlValue(colProp, "Description", ""); + ModelProperty colProperty(QString::fromStdString(colName), + colPropType, + colPropUnits, + colPropURL, + colPropDescription); + + property.addColumn(colProperty); + } + } + + auto key = std::pair(uuid, QString::fromStdString(propName)); + if (inheritances->count(key) > 0) { + property.setInheritance((*inheritances)[key]); + } + + finalModel->addProperty(property); + } + } + + (*_modelMap)[uuid] = library.addModel(*finalModel, directory); +} + +void ModelLoader::loadLibrary(const ModelLibrary& library) +{ + if (_modelEntryMap == nullptr) { + _modelEntryMap = new std::map(); + } + + QDirIterator it(library.getDirectory(), QDirIterator::Subdirectories); + while (it.hasNext()) { + auto pathname = it.next(); + QFileInfo file(pathname); + if (file.isFile()) { + if (file.suffix().toStdString() == "yml") { + QString libraryName = file.baseName(); + + try { + auto model = getModelFromPath(library, file.canonicalFilePath()); + (*_modelEntryMap)[model->getUUID()] = model; + // showYaml(model->getModel()); + } + catch (InvalidModel const&) { + Base::Console().Log("Invalid model '%s'\n", pathname.toStdString().c_str()); + } + } + } + } + + std::map, QString>* inheritances = + new std::map, QString>(); + for (auto it = _modelEntryMap->begin(); it != _modelEntryMap->end(); it++) { + dereference(it->second, inheritances); + } + + for (auto it = _modelEntryMap->begin(); it != _modelEntryMap->end(); it++) { + addToTree(it->second, inheritances); + } + // delete inheritances; +} + +void ModelLoader::loadLibraries(void) +{ + getModelLibraries(); + if (_libraryList) { + for (auto it = _libraryList->begin(); it != _libraryList->end(); it++) { + loadLibrary(**it); + } + } +} + +void ModelLoader::getModelLibraries() +{ + auto param = App::GetApplication().GetParameterGroupByPath( + "User parameter:BaseApp/Preferences/Mod/Material/Resources"); + bool useBuiltInMaterials = param->GetBool("UseBuiltInMaterials", true); + bool useMatFromModules = param->GetBool("UseMaterialsFromWorkbenches", true); + bool useMatFromConfigDir = param->GetBool("UseMaterialsFromConfigDir", true); + bool useMatFromCustomDir = param->GetBool("UseMaterialsFromCustomDir", true); + + if (useBuiltInMaterials) { + QString resourceDir = QString::fromStdString(App::Application::getResourceDir() + + "/Mod/Material/Resources/Models"); + auto libData = new ModelLibrary(QString::fromStdString("System"), + resourceDir, + QString::fromStdString(":/icons/freecad.svg")); + _libraryList->push_back(libData); + } + + if (useMatFromModules) { + auto moduleParam = App::GetApplication().GetParameterGroupByPath( + "User parameter:BaseApp/Preferences/Mod/Material/Resources/Modules"); + for (auto& group : moduleParam->GetGroups()) { + // auto module = moduleParam->GetGroup(group->GetGroupName()); + auto moduleName = QString::fromStdString(group->GetGroupName()); + auto modelDir = QString::fromStdString(group->GetASCII("ModuleModelDir", "")); + auto modelIcon = QString::fromStdString(group->GetASCII("ModuleIcon", "")); + + if (modelDir.length() > 0) { + QDir dir(modelDir); + if (dir.exists()) { + auto libData = new ModelLibrary(moduleName, modelDir, modelIcon); + _libraryList->push_back(libData); + } + } + } + } + + if (useMatFromConfigDir) { + QString resourceDir = + QString::fromStdString(App::Application::getUserAppDataDir() + "/Models"); + if (!resourceDir.isEmpty()) { + QDir materialDir(resourceDir); + if (materialDir.exists()) { + auto libData = + new ModelLibrary(QString::fromStdString("User"), + resourceDir, + QString::fromStdString(":/icons/preferences-general.svg")); + _libraryList->push_back(libData); + } + } + } + + if (useMatFromCustomDir) { + QString resourceDir = QString::fromStdString(param->GetASCII("CustomMaterialsDir", "")); + if (!resourceDir.isEmpty()) { + QDir materialDir(resourceDir); + if (materialDir.exists()) { + auto libData = new ModelLibrary(QString::fromStdString("Custom"), + resourceDir, + QString::fromStdString(":/icons/user.svg")); + _libraryList->push_back(libData); + } + } + } +} diff --git a/src/Mod/Material/App/ModelLoader.h b/src/Mod/Material/App/ModelLoader.h new file mode 100644 index 0000000000..410fb74d18 --- /dev/null +++ b/src/Mod/Material/App/ModelLoader.h @@ -0,0 +1,130 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATERIAL_MODELLOADER_H +#define MATERIAL_MODELLOADER_H + +#include +#include +#include + +#include "Model.h" + +namespace Materials +{ + +class ModelEntry +{ +public: + explicit ModelEntry(const ModelLibrary& library, + const QString& baseName, + const QString& modelName, + const QString& dir, + const QString& modelUuid, + const YAML::Node& modelData); + virtual ~ModelEntry() = default; + + const ModelLibrary& getLibrary() const + { + return _library; + } + const QString getBase() const + { + return _base; + } + const QString getName() const + { + return _name; + } + const QString getDirectory() const + { + return _directory; + } + const QString getUUID() const + { + return _uuid; + } + const YAML::Node& getModel() const + { + return _model; + } + YAML::Node* getModelPtr() + { + return &_model; + } + bool getDereferenced() const + { + return _dereferenced; + } + + void markDereferenced() + { + _dereferenced = true; + } + +private: + ModelEntry(); + + ModelLibrary _library; + QString _base; + QString _name; + QString _directory; + QString _uuid; + YAML::Node _model; + bool _dereferenced; +}; + +class ModelLoader +{ +public: + explicit ModelLoader(std::map* modelMap, + std::list* libraryList); + virtual ~ModelLoader() = default; + + static const QString getUUIDFromPath(const QString& path); + +private: + ModelLoader(); + + void getModelLibraries(); + QString + yamlValue(const YAML::Node& node, const std::string& key, const std::string& defaultValue); + void addToTree(ModelEntry* model, std::map, QString>* inheritances); + void showYaml(const YAML::Node& yaml) const; + void dereference(const QString& uuid, + ModelEntry* parent, + const ModelEntry* child, + std::map, QString>* inheritances); + void dereference(ModelEntry* model, + std::map, QString>* inheritances); + ModelEntry* getModelFromPath(const ModelLibrary& library, const QString& path) const; + void addLibrary(ModelLibrary* model); + void loadLibrary(const ModelLibrary& library); + void loadLibraries(void); + static std::map* _modelEntryMap; + std::map* _modelMap; + std::list* _libraryList; +}; + +}// namespace Materials + +#endif// MATERIAL_MODELLOADER_H diff --git a/src/Mod/Material/App/ModelManager.cpp b/src/Mod/Material/App/ModelManager.cpp new file mode 100644 index 0000000000..63f303d7f4 --- /dev/null +++ b/src/Mod/Material/App/ModelManager.cpp @@ -0,0 +1,172 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" +#ifndef _PreComp_ +#endif + +#include + +#include + +#include "Model.h" +#include "ModelLoader.h" +#include "ModelManager.h" + + +using namespace Materials; + +std::list* ModelManager::_libraryList = nullptr; +std::map* ModelManager::_modelMap = nullptr; +QMutex ModelManager::_mutex; + +TYPESYSTEM_SOURCE(Materials::ModelManager, Base::BaseClass) + +ModelManager::ModelManager() +{ + initLibraries(); +} + +void ModelManager::initLibraries() +{ + QMutexLocker locker(&_mutex); + + if (_modelMap == nullptr) { + _modelMap = new std::map(); + if (_libraryList == nullptr) { + _libraryList = new std::list(); + } + + // Load the libraries + ModelLoader loader(_modelMap, _libraryList); + } +} + +bool ModelManager::isModel(const fs::path& p) +{ + // if (!fs::is_regular_file(p)) + // return false; + // check file extension + if (p.extension() == ".yml") { + return true; + } + return false; +} + +void ModelManager::refresh() +{ + _modelMap->clear(); + _libraryList->clear(); + + // Load the libraries + ModelLoader loader(_modelMap, _libraryList); +} + +const Model& ModelManager::getModel(const QString& uuid) const +{ + try { + if (_modelMap == nullptr) { + throw Uninitialized(); + } + + return *(_modelMap->at(uuid)); + } + catch (std::out_of_range const&) { + throw ModelNotFound(); + } +} + +const Model& ModelManager::getModelByPath(const QString& path) const +{ + const QString& uuid = ModelLoader::getUUIDFromPath(path); + const Model& model = getModel(uuid); + + return model; +} + +const Model& ModelManager::getModelByPath(const QString& path, const QString& libraryPath) const +{ + QDir modelDir(QDir::cleanPath(libraryPath + QString::fromStdString("/") + path)); + QString absPath = modelDir.absolutePath(); + return getModelByPath(absPath); +} + +bool ModelManager::passFilter(ModelFilter filter, Model::ModelType modelType) const +{ + switch (filter) { + case ModelFilter_None: + return true; + + case ModelFilter_Physical: + return (modelType == Model::ModelType_Physical); + + case ModelFilter_Appearance: + return (modelType == Model::ModelType_Appearance); + } + + return false; +} + +std::map* ModelManager::getModelTree(const ModelLibrary& library, + ModelFilter filter) +{ + std::map* modelTree = new std::map(); + + for (auto it = _modelMap->begin(); it != _modelMap->end(); it++) { + auto filename = it->first; + auto model = it->second; + + if (model->getLibrary() == library && passFilter(filter, model->getType())) { + fs::path path = model->getDirectory().toStdString(); + Base::Console().Log("Relative path '%s'\n\t", path.string().c_str()); + + // Start at the root + std::map* node = modelTree; + for (auto itp = path.begin(); itp != path.end(); itp++) { + if (isModel(itp->string())) { + ModelTreeNode* child = new ModelTreeNode(); + child->setData(model); + (*node)[QString::fromStdString(itp->string())] = child; + } + else { + // Add the folder only if it's not already there + QString folderName = QString::fromStdString(itp->string()); + std::map* mapPtr; + if (node->count(QString::fromStdString(itp->string())) == 0) { + mapPtr = new std::map(); + ModelTreeNode* child = new ModelTreeNode(); + child->setFolder(mapPtr); + (*node)[QString::fromStdString(itp->string())] = child; + node = mapPtr; + } + else { + node = (*node)[QString::fromStdString(itp->string())]->getFolder(); + } + } + Base::Console().Log("'%s' ", itp->string().c_str()); + } + Base::Console().Log("\n"); + } + } + + return modelTree; +} diff --git a/src/Mod/Material/App/ModelManager.h b/src/Mod/Material/App/ModelManager.h new file mode 100644 index 0000000000..06b97297d9 --- /dev/null +++ b/src/Mod/Material/App/ModelManager.h @@ -0,0 +1,85 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATERIAL_MODELMANAGER_H +#define MATERIAL_MODELMANAGER_H + +#include + +#include + +#include "Exceptions.h" +#include "FolderTree.h" +#include "Model.h" + +namespace fs = boost::filesystem; + +namespace Materials +{ + +typedef FolderTreeNode ModelTreeNode; + +class MaterialsExport ModelManager: public Base::BaseClass +{ + TYPESYSTEM_HEADER(); + +public: + enum ModelFilter + { + ModelFilter_None, + ModelFilter_Physical, + ModelFilter_Appearance + }; + + ModelManager(); + virtual ~ModelManager() = default; + + void refresh(); + + std::list* getModelLibraries() + { + return _libraryList; + } + std::map* getModels() + { + return _modelMap; + } + std::map* getModelTree(const ModelLibrary& library, + ModelFilter filter = ModelFilter_None); + const Model& getModel(const QString& uuid) const; + const Model& getModelByPath(const QString& path) const; + const Model& getModelByPath(const QString& path, const QString& libraryPath) const; + + static bool isModel(const fs::path& p); + bool passFilter(ModelFilter filter, Model::ModelType modelType) const; + +private: + static void initLibraries(); + + static std::list* _libraryList; + static std::map* _modelMap; + static QMutex _mutex; +}; + +}// namespace Materials + +#endif// MATERIAL_MODELMANAGER_H diff --git a/src/Mod/Material/App/ModelManagerPy.xml b/src/Mod/Material/App/ModelManagerPy.xml new file mode 100644 index 0000000000..b6e48da967 --- /dev/null +++ b/src/Mod/Material/App/ModelManagerPy.xml @@ -0,0 +1,41 @@ + + + + + + Material model descriptions. + + + + Get a model object by specifying its UUID + + + + + Get a model object by specifying its path + + + + + List of model libraries. + + + + + + List of model libraries. + + + + + diff --git a/src/Mod/Material/App/ModelManagerPyImpl.cpp b/src/Mod/Material/App/ModelManagerPyImpl.cpp new file mode 100644 index 0000000000..0df3749a8c --- /dev/null +++ b/src/Mod/Material/App/ModelManagerPyImpl.cpp @@ -0,0 +1,163 @@ +/*************************************************************************** + * Copyright (c) 2008 Werner Mayer * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" + +#ifndef _PreComp_ +#include +#endif + +#include "ModelManager.h" +#include "ModelManagerPy.h" +#include "ModelPy.h" + +#include "ModelManagerPy.cpp" + +using namespace Materials; + +// returns a string which represents the object e.g. when printed in python +std::string ModelManagerPy::representation() const +{ + std::stringstream str; + str << ""; + + return str.str(); +} + +PyObject* ModelManagerPy::PyMake(struct _typeobject*, PyObject*, PyObject*)// Python wrapper +{ + // never create such objects with the constructor + return new ModelManagerPy(new ModelManager()); +} + +// constructor method +int ModelManagerPy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/) +{ + return 0; +} + +PyObject* ModelManagerPy::getModel(PyObject* args) +{ + char* uuid; + if (!PyArg_ParseTuple(args, "s", &uuid)) { + return nullptr; + } + + try { + const Model model = getModelManagerPtr()->getModel(QString::fromStdString(uuid)); + return new ModelPy(new Model(model)); + } + catch (ModelNotFound const&) { + QString error = QString::fromStdString("Model not found:\n"); + std::map* _modelMap = getModelManagerPtr()->getModels(); + error += QString::fromStdString("ModelMap:\n"); + for (auto itp = _modelMap->begin(); itp != _modelMap->end(); itp++) { + error += QString::fromStdString("\t_modelMap[") + itp->first + + QString::fromStdString("] = '") + itp->second->getName() + + QString::fromStdString("'\n"); + } + error += QString::fromStdString("\tuuid = '") + QString::fromStdString(uuid) + + QString::fromStdString("'\n"); + PyErr_SetString(PyExc_LookupError, error.toStdString().c_str()); + return nullptr; + } + catch (Uninitialized const&) { + PyErr_SetString(PyExc_LookupError, "Uninitialized model list"); + return nullptr; + } +} + +PyObject* ModelManagerPy::getModelByPath(PyObject* args) +{ + char* path; + char* lib = ""; + if (!PyArg_ParseTuple(args, "s|s", &path, &lib)) { + return nullptr; + } + + std::string libPath(lib); + if (libPath.length() > 0) { + try { + const Model& model = + getModelManagerPtr()->getModelByPath(QString::fromStdString(path), + QString::fromStdString(libPath)); + return new ModelPy(new Model(model)); + } + catch (ModelNotFound const&) { + PyErr_SetString(PyExc_LookupError, "Model not found"); + return nullptr; + } + } + + try { + const Model& model = getModelManagerPtr()->getModelByPath(QString::fromStdString(path)); + return new ModelPy(new Model(model)); + } + catch (ModelNotFound const&) { + PyErr_SetString(PyExc_LookupError, "Model not found"); + return nullptr; + } +} + +Py::List ModelManagerPy::getModelLibraries() const +{ + std::list* libraries = getModelManagerPtr()->getModelLibraries(); + Py::List list; + + for (auto it = libraries->begin(); it != libraries->end(); it++) { + ModelLibrary* lib = *it; + Py::Tuple libTuple(3); + libTuple.setItem(0, Py::String(lib->getName().toStdString())); + libTuple.setItem(1, Py::String(lib->getDirectoryPath().toStdString())); + libTuple.setItem(2, Py::String(lib->getIconPath().toStdString())); + + list.append(libTuple); + } + + return list; +} + +Py::Dict ModelManagerPy::getModels() const +{ + std::map* models = getModelManagerPtr()->getModels(); + Py::Dict dict; + + for (auto it = models->begin(); it != models->end(); it++) { + QString key = it->first; + Model* model = it->second; + + PyObject* modelPy = new ModelPy(new Model(*model)); + dict.setItem(Py::String(key.toStdString()), Py::Object(modelPy, true)); + } + + return dict; +} + +PyObject* ModelManagerPy::getCustomAttributes(const char* /*attr*/) const +{ + return nullptr; +} + +int ModelManagerPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) +{ + return 0; +} diff --git a/src/Mod/Material/App/ModelPropertyPy.xml b/src/Mod/Material/App/ModelPropertyPy.xml new file mode 100644 index 0000000000..cffb548f8b --- /dev/null +++ b/src/Mod/Material/App/ModelPropertyPy.xml @@ -0,0 +1,54 @@ + + + + + + Material property descriptions. + + + + + Property name. + + + + + + Property type. + + + + + + Property units category. + + + + + + URL to a detailed description of the property. + + + + + + Property description. + + + + + diff --git a/src/Mod/Material/App/ModelPropertyPyImpl.cpp b/src/Mod/Material/App/ModelPropertyPyImpl.cpp new file mode 100644 index 0000000000..dea18c1ead --- /dev/null +++ b/src/Mod/Material/App/ModelPropertyPyImpl.cpp @@ -0,0 +1,101 @@ +/*************************************************************************** + * Copyright (c) 2008 Werner Mayer * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" + +#ifndef _PreComp_ +#include +#endif + +#include "Model.h" +#include "ModelPropertyPy.h" + +#include "ModelPropertyPy.cpp" + +using namespace Materials; + +// returns a string which represents the object e.g. when printed in python +std::string ModelPropertyPy::representation() const +{ + ModelPropertyPy::PointerType ptr = getModelPropertyPtr(); + std::stringstream str; + str << "Property [Name=("; + str << ptr->getName().toStdString(); + str << "), Type=("; + str << ptr->getPropertyType().toStdString(); + str << "), Units=("; + str << ptr->getUnits().toStdString(); + str << "), URL=("; + str << ptr->getURL().toStdString(); + str << "), Description=("; + str << ptr->getDescription().toStdString(); + str << ")]"; + + return str.str(); +} + +PyObject* ModelPropertyPy::PyMake(struct _typeobject*, PyObject*, PyObject*)// Python wrapper +{ + // never create such objects with the constructor + return new ModelPropertyPy(new ModelProperty()); +} + +// constructor method +int ModelPropertyPy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/) +{ + return 0; +} + +Py::String ModelPropertyPy::getName() const +{ + return Py::String(getModelPropertyPtr()->getName().toStdString()); +} + +Py::String ModelPropertyPy::getType() const +{ + return Py::String(getModelPropertyPtr()->getPropertyType().toStdString()); +} + +Py::String ModelPropertyPy::getUnits() const +{ + return Py::String(getModelPropertyPtr()->getUnits().toStdString()); +} + +Py::String ModelPropertyPy::getURL() const +{ + return Py::String(getModelPropertyPtr()->getURL().toStdString()); +} + +Py::String ModelPropertyPy::getDescription() const +{ + return Py::String(getModelPropertyPtr()->getDescription().toStdString()); +} + +PyObject* ModelPropertyPy::getCustomAttributes(const char* /*attr*/) const +{ + return nullptr; +} + +int ModelPropertyPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) +{ + return 0; +} diff --git a/src/Mod/Material/App/ModelPy.xml b/src/Mod/Material/App/ModelPy.xml new file mode 100644 index 0000000000..9202307244 --- /dev/null +++ b/src/Mod/Material/App/ModelPy.xml @@ -0,0 +1,85 @@ + + + + + + Material model descriptions. + + + + Model library name. + + + + + + Model library path. + + + + + + Model icon path. + + + + + + Model name. + + + + + + Model directory. + + + + + + Unique model identifier. + + + + + + Description of the model. + + + + + + URL to a detailed description of the model. + + + + + + Digital Object Identifier (see https://doi.org/) + + + + + + List of inherited models identified by UUID. + + + + + + Dictionary of model properties. + + + + + diff --git a/src/Mod/Material/App/ModelPyImpl.cpp b/src/Mod/Material/App/ModelPyImpl.cpp new file mode 100644 index 0000000000..431939c396 --- /dev/null +++ b/src/Mod/Material/App/ModelPyImpl.cpp @@ -0,0 +1,172 @@ +/*************************************************************************** + * Copyright (c) 2008 Werner Mayer * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" + +#ifndef _PreComp_ +#include +#endif + +#include "Model.h" +#include "ModelPropertyPy.h" +#include "ModelPy.h" + +#include "ModelPy.cpp" + +using namespace Materials; + +// returns a string which represents the object e.g. when printed in python +std::string ModelPy::representation() const +{ + ModelPy::PointerType ptr = getModelPtr(); + std::stringstream str; + str << "Property [Name=("; + str << ptr->getName().toStdString(); + str << "), UUID=("; + str << ptr->getUUID().toStdString(); + str << "), Library Name=("; + str << ptr->getLibrary().getName().toStdString(); + str << "), Library Root=("; + str << ptr->getLibrary().getDirectoryPath().toStdString(); + str << "), Library Icon=("; + str << ptr->getLibrary().getIconPath().toStdString(); + str << "), Directory=("; + str << ptr->getDirectory().toStdString(); + str << "), URL=("; + str << ptr->getURL().toStdString(); + str << "), DOI=("; + str << ptr->getDOI().toStdString(); + str << "), Description=("; + str << ptr->getDescription().toStdString(); + str << "), Inherits=["; + const std::vector& inherited = getModelPtr()->getInheritance(); + for (auto it = inherited.begin(); it != inherited.end(); it++) { + QString uuid = *it; + if (it != inherited.begin()) { + str << "), UUID=("; + } + else { + str << "UUID=("; + } + str << uuid.toStdString() << ")"; + } + str << "]]"; + + return str.str(); +} + +PyObject* ModelPy::PyMake(struct _typeobject*, PyObject*, PyObject*)// Python wrapper +{ + // never create such objects with the constructor + return new ModelPy(new Model()); +} + +// constructor method +int ModelPy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/) +{ + return 0; +} + +Py::String ModelPy::getLibraryName() const +{ + return Py::String(getModelPtr()->getLibrary().getName().toStdString()); +} + +Py::String ModelPy::getLibraryRoot() const +{ + return Py::String(getModelPtr()->getLibrary().getDirectoryPath().toStdString()); +} + +Py::String ModelPy::getLibraryIcon() const +{ + return Py::String(getModelPtr()->getLibrary().getIconPath().toStdString()); +} + +Py::String ModelPy::getName() const +{ + return Py::String(getModelPtr()->getName().toStdString()); +} + +Py::String ModelPy::getDirectory() const +{ + return Py::String(getModelPtr()->getDirectoryPath().toStdString()); +} + +Py::String ModelPy::getUUID() const +{ + return Py::String(getModelPtr()->getUUID().toStdString()); +} + +Py::String ModelPy::getDescription() const +{ + return Py::String(getModelPtr()->getDescription().toStdString()); +} + +Py::String ModelPy::getURL() const +{ + return Py::String(getModelPtr()->getURL().toStdString()); +} + +Py::String ModelPy::getDOI() const +{ + return Py::String(getModelPtr()->getDOI().toStdString()); +} + +Py::List ModelPy::getInherited() const +{ + const std::vector& inherited = getModelPtr()->getInheritance(); + Py::List list; + + for (auto it = inherited.begin(); it != inherited.end(); it++) { + QString uuid = *it; + + list.append(Py::String(uuid.toStdString())); + } + + return list; +} + +Py::Dict ModelPy::getProperties() const +{ + // std::map *models = getModelPtr()->getModels(); + Py::Dict dict; + + for (auto it = getModelPtr()->begin(); it != getModelPtr()->end(); it++) { + QString key = it->first; + ModelProperty& modelProperty = it->second; + + PyObject* modelPropertyPy = new ModelPropertyPy(new ModelProperty(modelProperty)); + dict.setItem(Py::String(key.toStdString()), Py::Object(modelPropertyPy, true)); + } + + return dict; +} + +PyObject* ModelPy::getCustomAttributes(const char* /*attr*/) const +{ + return nullptr; +} + +int ModelPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) +{ + return 0; +} diff --git a/src/Mod/Material/App/ModelUuids.h b/src/Mod/Material/App/ModelUuids.h new file mode 100644 index 0000000000..cf4074cb21 --- /dev/null +++ b/src/Mod/Material/App/ModelUuids.h @@ -0,0 +1,73 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATERIAL_MODELUUIDS_H +#define MATERIAL_MODELUUIDS_H + +namespace Materials +{ + +// UUIDs for predefined material models + +static const QString ModelUUID_Legacy_Father = + QString::fromStdString("9cdda8b6-b606-4778-8f13-3934d8668e67"); +static const QString ModelUUID_Legacy_MaterialStandard = + QString::fromStdString("1e2c0088-904a-4537-925f-64064c07d700"); + +static const QString ModelUUID_Mechanical_Density = + QString::fromStdString("454661e5-265b-4320-8e6f-fcf6223ac3af"); +static const QString ModelUUID_Mechanical_IsotropicLinearElastic = + QString::fromStdString("f6f9e48c-b116-4e82-ad7f-3659a9219c50"); +static const QString ModelUUID_Mechanical_LinearElastic = + QString::fromStdString("7b561d1d-fb9b-44f6-9da9-56a4f74d7536"); +static const QString ModelUUID_Mechanical_OgdenYld2004p18 = + QString::fromStdString("3ef9e427-cc25-43f7-817f-79ff0d49625f"); +static const QString ModelUUID_Mechanical_OrthotropicLinearElastic = + QString::fromStdString("b19ccc6b-a431-418e-91c2-0ac8c649d146"); + +static const QString ModelUUID_Fluid_Default = + QString::fromStdString("1ae66d8c-1ba1-4211-ad12-b9917573b202"); + +static const QString ModelUUID_Thermal_Default = + QString::fromStdString("9959d007-a970-4ea7-bae4-3eb1b8b883c7"); + +static const QString ModelUUID_Electromagnetic_Default = + QString::fromStdString("b2eb5f48-74b3-4193-9fbb-948674f427f3"); + +static const QString ModelUUID_Architectural_Default = + QString::fromStdString("32439c3b-262f-4b7b-99a8-f7f44e5894c8"); + +static const QString ModelUUID_Costs_Default = + QString::fromStdString("881df808-8726-4c2e-be38-688bb6cce466"); + +static const QString ModelUUID_Rendering_Basic = + QString::fromStdString("f006c7e4-35b7-43d5-bbf9-c5d572309e6e"); +static const QString ModelUUID_Rendering_Texture = + QString::fromStdString("bbdcc65b-67ca-489c-bd5c-a36e33d1c160"); +static const QString ModelUUID_Rendering_Advanced = + QString::fromStdString("c880f092-cdae-43d6-a24b-55e884aacbbf"); +static const QString ModelUUID_Rendering_Vector = + QString::fromStdString("fdf5a80e-de50-4157-b2e5-b6e5f88b680e"); + +}// namespace Materials + +#endif// MATERIAL_MODELUUIDS_H diff --git a/src/Mod/Material/App/PreCompiled.cpp b/src/Mod/Material/App/PreCompiled.cpp new file mode 100644 index 0000000000..c2507f9804 --- /dev/null +++ b/src/Mod/Material/App/PreCompiled.cpp @@ -0,0 +1,24 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#include "PreCompiled.h" diff --git a/src/Mod/Material/App/PreCompiled.h b/src/Mod/Material/App/PreCompiled.h new file mode 100644 index 0000000000..43d31c08af --- /dev/null +++ b/src/Mod/Material/App/PreCompiled.h @@ -0,0 +1,67 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATGUI_PRECOMPILED_H +#define MATGUI_PRECOMPILED_H + +#include + +#include + +// point at which warnings of overly long specifiers disabled (needed for VC6) +#ifdef _MSC_VER +# pragma warning( disable : 4251 ) +# pragma warning( disable : 4503 ) +# pragma warning( disable : 4786 ) // specifier longer then 255 chars +# pragma warning( disable : 4273 ) +#endif + +#ifdef FC_OS_WIN32 +# ifndef NOMINMAX +# define NOMINMAX +# endif +# include +#endif + +#ifdef _PreComp_ + +// standard +#include +#include + +// STL +#include +#include +#include +#include +#include + +// Qt +#include + +// Boost +#include +#include + +#endif //_PreComp_ + +#endif // MATGUI_PRECOMPILED_H diff --git a/src/Mod/Material/App/trim.h b/src/Mod/Material/App/trim.h new file mode 100644 index 0000000000..79d8844a86 --- /dev/null +++ b/src/Mod/Material/App/trim.h @@ -0,0 +1,81 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATERIAL_TRIM_H +#define MATERIAL_TRIM_H + +#include + +namespace Materials +{ + +// trim from start (in place) +static inline void ltrim(std::string& s) +{ + s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](unsigned char ch) { + return !std::isspace(ch); + })); +} + +// trim from end (in place) +static inline void rtrim(std::string& s) +{ + s.erase(std::find_if(s.rbegin(), + s.rend(), + [](unsigned char ch) { + return !std::isspace(ch); + }) + .base(), + s.end()); +} + +// trim from both ends (in place) +static inline void trim(std::string& s) +{ + rtrim(s); + ltrim(s); +} + +// trim from start (copying) +static inline std::string ltrim_copy(std::string s) +{ + ltrim(s); + return s; +} + +// trim from end (copying) +static inline std::string rtrim_copy(std::string s) +{ + rtrim(s); + return s; +} + +// trim from both ends (copying) +static inline std::string trim_copy(std::string s) +{ + trim(s); + return s; +} + +}// namespace Materials + +#endif// MATERIAL_TRIM_H diff --git a/src/Mod/Material/CMakeLists.txt b/src/Mod/Material/CMakeLists.txt index da9f68f39e..c26a5fdb92 100644 --- a/src/Mod/Material/CMakeLists.txt +++ b/src/Mod/Material/CMakeLists.txt @@ -1,174 +1,221 @@ -IF (BUILD_GUI) - PYSIDE_WRAP_RC(Material_QRC_SRCS Resources/Material.qrc) -ENDIF (BUILD_GUI) +add_subdirectory(App) -SET(Material_SRCS +if(BUILD_GUI) + add_subdirectory(Gui) +endif(BUILD_GUI) + +IF(BUILD_GUI) + PYSIDE_WRAP_RC(Material_QRC_SRCS Resources/Material.qrc) +ENDIF(BUILD_GUI) + +SET(MaterialScripts_Files Init.py InitGui.py - Material.py importFCMat.py MaterialEditor.py - materials-editor.ui + TestMaterialsApp.py + Resources/ui/materials-editor.ui Templatematerial.yml ) -SOURCE_GROUP("Module" FILES ${Material_SRCS}) -SET (MaterialTools_Files +# SOURCE_GROUP("MaterialScripts" FILES ${MaterialScripts_Files}) +SET(MaterialTools_Files materialtools/__init__.py materialtools/cardutils.py + materialtools/MaterialModels.py ) -SET (Material_Icon_Files +SET(Material_Icon_Files Resources/icons/preview-rendered.svg Resources/icons/preview-vector.svg ) # collect all the material cards: -#FILE( GLOB MaterialLib_Files ./StandardMaterial/*.FCMat ./StandardMaterial/*.txt ) - -SET (MaterialLib_Files - StandardMaterial/None.FCMat - StandardMaterial/ABS-Generic.FCMat - StandardMaterial/Acrylic-Glass-Generic.FCMat - StandardMaterial/AlMg3F24.FCMat - StandardMaterial/AlMgSi1F31.FCMat - StandardMaterial/Aluminum-6061-T6.FCMat - StandardMaterial/Aluminum-Generic.FCMat - StandardMaterial/AlZn4-5Mg1F35.FCMat - StandardMaterial/CalculiX-Steel.FCMat - StandardMaterial/Concrete-Generic.FCMat - StandardMaterial/Copper-Generic.FCMat - StandardMaterial/Glass-E-GlassFibre.FCMat - StandardMaterial/Glass-Generic.FCMat - StandardMaterial/Glass-S2-GlassFibre.FCMat - StandardMaterial/Graphite.FCMat - StandardMaterial/Iron-Generic.FCMat - StandardMaterial/Invar-Generic.FCMat - StandardMaterial/PA6-Generic.FCMat - StandardMaterial/PET-Generic.FCMat - StandardMaterial/PLA-Generic.FCMat - StandardMaterial/PP-Generic.FCMat - StandardMaterial/PTFE-Generic.FCMat - StandardMaterial/PVC-Generic.FCMat - StandardMaterial/Reinforcement-FIB-B500.FCMat - StandardMaterial/Steel-15CrNi6.FCMat - StandardMaterial/Steel-17CrNiMo6.FCMat - StandardMaterial/Steel-1C22.FCMat - StandardMaterial/Steel-1C35.FCMat - StandardMaterial/Steel-1C45.FCMat - StandardMaterial/Steel-1C60.FCMat - StandardMaterial/Steel-20NiCrMo2.FCMat - StandardMaterial/Steel-28Mn6.FCMat - StandardMaterial/Steel-2C10.FCMat - StandardMaterial/Steel-30CrNiMo8.FCMat - StandardMaterial/Steel-34CrNiMo6.FCMat - StandardMaterial/Steel-36CrNiMo4.FCMat - StandardMaterial/Steel-36NiCrMo16.FCMat - StandardMaterial/Steel-3C15.FCMat - StandardMaterial/Steel-3C22.FCMat - StandardMaterial/Steel-3C35.FCMat - StandardMaterial/Steel-3V45.FCMat - StandardMaterial/Steel-C10.FCMat - StandardMaterial/Steel-C15.FCMat - StandardMaterial/Steel-C22E.FCMat - StandardMaterial/Steel-C25E.FCMat - StandardMaterial/Steel-C30E.FCMat - StandardMaterial/Steel-C40E.FCMat - StandardMaterial/Steel-C50E.FCMat - StandardMaterial/Steel-C55E.FCMat - StandardMaterial/Steel-C60E.FCMat - StandardMaterial/Steel-E295-GC.FCMat - StandardMaterial/Steel-E295.FCMat - StandardMaterial/Steel-E335-GC.FCMat - StandardMaterial/Steel-E335.FCMat - StandardMaterial/Steel-E360-GC.FCMat - StandardMaterial/Steel-E360.FCMat - StandardMaterial/Steel-EN-GJL-100.FCMat - StandardMaterial/Steel-EN-GJL-150.FCMat - StandardMaterial/Steel-EN-GJL-200.FCMat - StandardMaterial/Steel-EN-GJL-250.FCMat - StandardMaterial/Steel-EN-GJL-300.FCMat - StandardMaterial/Steel-EN-GJL-350.FCMat - StandardMaterial/Steel-EN-GJMB-350-10.FCMat - StandardMaterial/Steel-EN-GJMB-550-4.FCMat - StandardMaterial/Steel-EN-GJMB-650-2.FCMat - StandardMaterial/Steel-EN-GJMW-350-4.FCMat - StandardMaterial/Steel-EN-GJMW-360-12.FCMat - StandardMaterial/Steel-EN-GJMW-400-5.FCMat - StandardMaterial/Steel-EN-GJMW-450-7.FCMat - StandardMaterial/Steel-EN-GJS-400-15.FCMat - StandardMaterial/Steel-EN-GJS-500-7.FCMat - StandardMaterial/Steel-EN-GJS-600-3.FCMat - StandardMaterial/Steel-EN-GJS-700-2.FCMat - StandardMaterial/Steel-EN-GJS-800-1.FCMat - StandardMaterial/Steel-G16Mn5.FCMat - StandardMaterial/Steel-G200.FCMat - StandardMaterial/Steel-G20Mn5.FCMat - StandardMaterial/Steel-G230.FCMat - StandardMaterial/Steel-G260.FCMat - StandardMaterial/Steel-G300.FCMat - StandardMaterial/Steel-G30Mn5.FCMat - StandardMaterial/Steel-Generic.FCMat - StandardMaterial/Steel-S185.FCMat - StandardMaterial/Steel-S235JO.FCMat - StandardMaterial/Steel-S235JR.FCMat - StandardMaterial/Steel-S235JRG1.FCMat - StandardMaterial/Steel-S260NC.FCMat - StandardMaterial/Steel-S275JO.FCMat - StandardMaterial/Steel-S275JR.FCMat - StandardMaterial/Steel-S275N.FCMat - StandardMaterial/Steel-S335JO.FCMat - StandardMaterial/Steel-S335JR.FCMat - StandardMaterial/Steel-S335N.FCMat - StandardMaterial/Steel-S340MC.FCMat - StandardMaterial/Steel-S355J2G3.FCMat - StandardMaterial/Steel-S380MC.FCMat - StandardMaterial/Steel-S420MC.FCMat - StandardMaterial/Steel-S420N.FCMat - StandardMaterial/Steel-S460MC.FCMat - StandardMaterial/Steel-S460N.FCMat - StandardMaterial/Steel-S500MC.FCMat - StandardMaterial/Steel-S550MC.FCMat - StandardMaterial/Steel-S690MC.FCMat - StandardMaterial/Steel-St-37-2K.FCMat - StandardMaterial/Steel-St-E-255.FCMat - StandardMaterial/Steel-St-E-315.FCMat - StandardMaterial/Steel-St-E-380.FCMat - StandardMaterial/Steel-St-E-460.FCMat - StandardMaterial/Steel-St-E-500.FCMat - StandardMaterial/Steel-X2CrNiMoN17-13-3.FCMat - StandardMaterial/Steel-X2CrNiN24-4.FCMat - StandardMaterial/Steel-X39CrMo17-1.FCMat - StandardMaterial/Steel-X3CrNiMo13-14.FCMat - StandardMaterial/Steel-X5CrNi18-10.FCMat - StandardMaterial/Steel-X5CrNiMo17-12-2.FCMat - StandardMaterial/Steel-X6CrNiTi18-10.FCMat - StandardMaterial/TEMPLATE.FCMat - StandardMaterial/Ti-6Al-4V.FCMat - StandardMaterial/Wood-Generic.FCMat - StandardMaterial/Readme.txt -) -SOURCE_GROUP("MatLib" FILES ${MaterialLib_Files}) - -SET (FluidMaterial_Files - FluidMaterial/None.FCMat - FluidMaterial/Air.FCMat - FluidMaterial/Argon.FCMat - FluidMaterial/Carbon_dioxide.FCMat - FluidMaterial/Nitrogen.FCMat - FluidMaterial/Water.FCMat - FluidMaterial/Readme.md -) -SOURCE_GROUP("MatLib" FILES ${FluidMaterial_Files}) - -ADD_CUSTOM_TARGET(Material ALL - SOURCES ${Material_SRCS} ${Material_QRC_SRCS} +# FILE( GLOB MaterialLib_Files ./StandardMaterial/*.FCMat ./StandardMaterial/*.txt ) +SET(MaterialLib_Files + Resources/Materials/StandardMaterial/Aggregate/Concrete-EN-C35_45.FCMat + Resources/Materials/StandardMaterial/Aggregate/Concrete-Generic.FCMat + Resources/Materials/StandardMaterial/Aggregate/Reinforcement-FIB-B500.FCMat + Resources/Materials/StandardMaterial/Carbon/Graphite.FCMat + Resources/Materials/StandardMaterial/Glass/Glass-E-GlassFibre.FCMat + Resources/Materials/StandardMaterial/Glass/Glass-Generic.FCMat + Resources/Materials/StandardMaterial/Glass/Glass-S2-GlassFibre.FCMat + Resources/Materials/StandardMaterial/Metal/Alloys/Invar-Generic.FCMat + Resources/Materials/StandardMaterial/Metal/Aluminum/AlMg3F24.FCMat + Resources/Materials/StandardMaterial/Metal/Aluminum/AlMgSi1F31.FCMat + Resources/Materials/StandardMaterial/Metal/Aluminum/Aluminum-6061-T6.FCMat + Resources/Materials/StandardMaterial/Metal/Aluminum/Aluminum-Generic.FCMat + Resources/Materials/StandardMaterial/Metal/Aluminum/AlZn4-5Mg1F35.FCMat + Resources/Materials/StandardMaterial/Metal/Copper/Copper-Generic.FCMat + Resources/Materials/StandardMaterial/Metal/Iron/Iron-Generic.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/CalculiX-Steel.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-15CrNi6.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-17CrNiMo6.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-1C22.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-1C35.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-1C45.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-1C60.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-20NiCrMo2.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-28Mn6.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-2C10.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-30CrNiMo8.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-34CrNiMo6.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-36CrNiMo4.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-36NiCrMo16.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-3C15.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-3C22.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-3C35.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-3V45.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-C10.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-C15.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-C22E.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-C25E.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-C30E.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-C40E.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-C50E.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-C55E.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-C60E.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-E295-GC.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-E295.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-E335-GC.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-E335.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-E360-GC.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-E360.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-100.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-150.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-200.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-250.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-300.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-350.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMB-350-10.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMB-550-4.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMB-650-2.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMW-350-4.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMW-360-12.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMW-400-5.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMW-450-7.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-400-15.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-500-7.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-600-3.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-700-2.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-800-1.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-G16Mn5.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-G200.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-G20Mn5.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-G230.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-G260.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-G300.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-G30Mn5.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-Generic.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-S185.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-S235JO.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-S235JR.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-S235JRG1.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-S260NC.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-S275JO.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-S275JR.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-S275N.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-S335JO.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-S335JR.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-S335N.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-S340MC.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-S355J2G3.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-S380MC.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-S420MC.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-S420N.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-S460MC.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-S460N.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-S500MC.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-S550MC.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-S690MC.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-37-2K.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-255.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-315.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-380.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-460.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-500.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-X2CrNiMoN17-13-3.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-X2CrNiN24-4.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-X39CrMo17-1.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-X3CrNiMo13-14.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-X5CrNi18-10.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-X5CrNiMo17-12-2.FCMat + Resources/Materials/StandardMaterial/Metal/Steel/Steel-X6CrNiTi18-10.FCMat + Resources/Materials/StandardMaterial/Metal/Titanium/Ti-6Al-4V.FCMat + Resources/Materials/StandardMaterial/Thermoplast/ABS-Generic.FCMat + Resources/Materials/StandardMaterial/Thermoplast/Acrylic-Glass-Generic.FCMat + Resources/Materials/StandardMaterial/Thermoplast/PA6-Generic.FCMat + Resources/Materials/StandardMaterial/Thermoplast/PET-Generic.FCMat + Resources/Materials/StandardMaterial/Thermoplast/PLA-Generic.FCMat + Resources/Materials/StandardMaterial/Thermoplast/PP-Generic.FCMat + Resources/Materials/StandardMaterial/Thermoplast/PTFE-Generic.FCMat + Resources/Materials/StandardMaterial/Thermoplast/PVC-Generic.FCMat + Resources/Materials/StandardMaterial/Wood/Wood-Generic.FCMat ) -fc_target_copy_resource(Material +SET(FluidMaterial_Files + Resources/Materials/FluidMaterial/None.FCMat + Resources/Materials/FluidMaterial/Air.FCMat + Resources/Materials/FluidMaterial/Argon.FCMat + Resources/Materials/FluidMaterial/Carbon_dioxide.FCMat + Resources/Materials/FluidMaterial/Nitrogen.FCMat + Resources/Materials/FluidMaterial/Water.FCMat +) + +SET(AppearanceLib_Files + Resources/Materials/Appearance/Aluminum.FCMat + Resources/Materials/Appearance/Brass.FCMat + Resources/Materials/Appearance/Bronze.FCMat + Resources/Materials/Appearance/Chrome.FCMat + Resources/Materials/Appearance/Copper.FCMat + Resources/Materials/Appearance/DefaultAppearance.FCMat + Resources/Materials/Appearance/Emerald.FCMat + Resources/Materials/Appearance/Gold.FCMat + Resources/Materials/Appearance/Jade.FCMat + Resources/Materials/Appearance/Metalized.FCMat + Resources/Materials/Appearance/NeonGNC.FCMat + Resources/Materials/Appearance/NeonPHC.FCMat + Resources/Materials/Appearance/Obsidian.FCMat + Resources/Materials/Appearance/Pewter.FCMat + Resources/Materials/Appearance/Plaster.FCMat + Resources/Materials/Appearance/Plastic.FCMat + Resources/Materials/Appearance/Ruby.FCMat + Resources/Materials/Appearance/Satin.FCMat + Resources/Materials/Appearance/ShinyPlastic.FCMat + Resources/Materials/Appearance/Silver.FCMat + Resources/Materials/Appearance/Steel.FCMat + Resources/Materials/Appearance/Stone.FCMat +) + +SET(MaterialModel_Files + Resources/Models/Architectural/Architectural.yml + Resources/Models/Costs/Costs.yml + Resources/Models/Electromagnetic/Electromagnetic.yml + Resources/Models/Fluid/Fluid.yml + Resources/Models/Legacy/Father.yml + Resources/Models/Legacy/MaterialStandard.yml + Resources/Models/Mechanical/Density.yml + Resources/Models/Mechanical/HypotheticalExample.yml + Resources/Models/Mechanical/IsotropicLinearElastic.yml + Resources/Models/Mechanical/LinearElastic.yml + Resources/Models/Mechanical/OgdenYld2004p18.yml + Resources/Models/Mechanical/OrthotropicLinearElastic.yml + Resources/Models/Rendering/AdvancedRendering.yml + Resources/Models/Rendering/BasicRendering.yml + Resources/Models/Rendering/TextureRendering.yml + Resources/Models/Rendering/VectorRendering.yml + Resources/Models/Thermal/Thermal.yml +) + +ADD_CUSTOM_TARGET(MaterialScripts ALL + SOURCES ${MaterialScripts_Files} ${Material_QRC_SRCS} +) + +fc_target_copy_resource(MaterialScripts ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_BINARY_DIR}/Mod/Material - ${Material_SRCS}) + ${MaterialScripts_Files}) +INSTALL(FILES ${MaterialScripts_Files} DESTINATION Mod/Material) ADD_CUSTOM_TARGET(MaterialToolsLib ALL SOURCES ${MaterialTools_Files} @@ -191,42 +238,47 @@ fc_target_copy_resource(MaterialIconsLib INSTALL(FILES ${MaterialTools_Files} DESTINATION Mod/Material/materialtools) INSTALL(FILES ${Material_Icon_Files} DESTINATION Mod/Material/Resources/icons) -IF (BUILD_GUI) - fc_target_copy_resource(Material - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_BINARY_DIR}/Mod/Material - Material_rc.py) -ENDIF (BUILD_GUI) - ADD_CUSTOM_TARGET(MaterialLib ALL SOURCES ${MaterialLib_Files} ) ADD_CUSTOM_TARGET(FluidMaterialLib ALL SOURCES ${FluidMaterial_Files} ) +ADD_CUSTOM_TARGET(AppearanceLib ALL + SOURCES ${AppearanceLib_Files} +) +ADD_CUSTOM_TARGET(MaterialModelLib ALL + SOURCES ${MaterialModel_Files} +) # When a target copies files to different output directories then apparently it always builds the project # which is very annoying. So, the trick is to split this into two targets to avoid this behaviour. fc_target_copy_resource(MaterialLib ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Material + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Material/ ${MaterialLib_Files}) fc_target_copy_resource(FluidMaterialLib ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Material + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Material/ ${FluidMaterial_Files}) +fc_target_copy_resource(AppearanceLib + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Material/ + ${AppearanceLib_Files}) +fc_target_copy_resource(MaterialModelLib + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Material/ + ${MaterialModel_Files}) INSTALL( FILES ${Material_SRCS} ${Material_QRC_SRCS} DESTINATION Mod/Material ) -INSTALL( - DIRECTORY - StandardMaterial - DIRECTORY - FluidMaterial - DESTINATION - ${CMAKE_INSTALL_DATADIR}/Mod/Material - FILES_MATCHING PATTERN "*.FCMat*" -) +foreach(file ${MaterialLib_Files} ${FluidMaterial_Files} ${AppearanceLib_Files} ${MaterialModel_Files}) + cmake_path(REMOVE_FILENAME file OUTPUT_VARIABLE filepath) + INSTALL( + FILES ${file} + DESTINATION ${CMAKE_INSTALL_DATADIR}/Mod/Material/${filepath} + ) +endforeach() diff --git a/src/Mod/Material/FluidMaterial/Air.FCMat b/src/Mod/Material/FluidMaterial/Air.FCMat deleted file mode 100644 index 19447e1eab..0000000000 --- a/src/Mod/Material/FluidMaterial/Air.FCMat +++ /dev/null @@ -1,24 +0,0 @@ -[General] -Name = Air -Description = Dry air properties at 20 Degrees Celsius and 1 atm -MolarMass = 28.965 -Father = Gas - -[Fluidic] -Density = 1.204 kg/m^3 -DynamicViscosity = 1.80e-5 kg/m/s -KinematicViscosity = 1.511e-5 m^2/s -; PrandtlNumber is a nondimension number for CFD simulation -PrandtlNumber = 0.7 - -[Thermal] -SpecificHeat = 1.01 kJ/kg/K -ThermalConductivity = 0.02587 W/m/K -; thermal expansion coefficient of ideal gas is 1/temperature -ThermalExpansionCoefficient = 3.43e-3 1/K - -[Electromagnetic] -RelativePermittivity = 1.00059 -; at 18°C and 50Hz -ElectricalConductivity = 1e-12 S/m -RelativePermeability = 1.0 diff --git a/src/Mod/Material/FluidMaterial/Argon.FCMat b/src/Mod/Material/FluidMaterial/Argon.FCMat deleted file mode 100644 index 59ef9a5ea4..0000000000 --- a/src/Mod/Material/FluidMaterial/Argon.FCMat +++ /dev/null @@ -1,24 +0,0 @@ -[General] -Name = Argon -Description = Argon properties at 20 Degrees Celsius and 1 atm -MolarMass = 39.95 -Father = Gas - -[Fluidic] -Density = 1.641 kg/m^3 -DynamicViscosity = 22.3e-6 kg/m/s -; Kinematic Viscosity = Dynamic Viscosity / Density -KinematicViscosity = 13.59-6 m^2/s -; PrandtlNumber is a nondimension number for CFD simulation -PrandtlNumber = 0.7 - -[Thermal] -SpecificHeat = 0.520 kJ/kg/K -ThermalConductivity = 0.018 W/m/K -; thermal expansion coefficient of ideal gas is 1/temperature -ThermalExpansionCoefficient = 3.43e-3 1/K - -[Electromagnetic] -RelativePermittivity = 1.000513 -ElectricalConductivity = 1e-15 S/m -RelativePermeability = 1.0 diff --git a/src/Mod/Material/FluidMaterial/Carbon_dioxide.FCMat b/src/Mod/Material/FluidMaterial/Carbon_dioxide.FCMat deleted file mode 100644 index ca4b9bf57f..0000000000 --- a/src/Mod/Material/FluidMaterial/Carbon_dioxide.FCMat +++ /dev/null @@ -1,24 +0,0 @@ -[General] -Name = Carbon dioxide -Description = Carbon dioxide properties at 20 Degrees Celsius and 1 atm -MolarMass = 44.009 -Father = Gas - -[Fluidic] -Density = 1.8393 kg/m^3 -DynamicViscosity = 14.7e-6 kg/m/s -; Kinematic Viscosity = Dynamic Viscosity / Density -KinematicViscosity = 8.09e-6 m^2/s -; PrandtlNumber is a nondimension number for CFD simulation -PrandtlNumber = 0.7651 - -[Thermal] -SpecificHeat = 0.8460 kJ/kg/K -ThermalConductivity = 0.016242 W/m/K -; thermal expansion coefficient of ideal gas is 1/temperature -ThermalExpansionCoefficient = 3.43e-3 1/K - -[Electromagnetic] -RelativePermittivity = 1.0009217 -ElectricalConductivity = 1e-12 S/m -RelativePermeability = 1.0 diff --git a/src/Mod/Material/FluidMaterial/Nitrogen.FCMat b/src/Mod/Material/FluidMaterial/Nitrogen.FCMat deleted file mode 100644 index 4f957c8ae0..0000000000 --- a/src/Mod/Material/FluidMaterial/Nitrogen.FCMat +++ /dev/null @@ -1,24 +0,0 @@ -[General] -Name = Nitrogen -Description = Nitrogen properties at 20 Degrees Celsius and 1 atm -MolarMass = 14.007 -Father = Gas - -[Fluidic] -Density = 1.2506 kg/m^3 -DynamicViscosity = 17.58e-6 kg/m/s -; Kinematic Viscosity = Dynamic Viscosity / Density -KinematicViscosity = 14.06e-6 m^2/s -; PrandtlNumber is a nondimension number for CFD simulation -PrandtlNumber = 0.7 - -[Thermal] -SpecificHeat = 1.04 kJ/kg/K -ThermalConductivity = 25.83e-3 W/m/K -; thermal expansion coefficient of ideal gas is 1/temperature -ThermalExpansionCoefficient = 3.43e-3 1/K - -[Electromagnetic] -RelativePermittivity = 1.00058 -ElectricalConductivity = 1e-12 S/m -RelativePermeability = 1.0 diff --git a/src/Mod/Material/FluidMaterial/None.FCMat b/src/Mod/Material/FluidMaterial/None.FCMat deleted file mode 100644 index 9de08f0786..0000000000 --- a/src/Mod/Material/FluidMaterial/None.FCMat +++ /dev/null @@ -1,15 +0,0 @@ -; None means nothing, as the starting point of making a new fluid material - -[General] -Name = None -Description = "None" - -[Fluidic] -Density = 0 kg/m^3 -DynamicViscosity = 0 kg/m/s -KinematicViscosity = 0 m^2/s - -[Thermal] -SpecificHeat = 0 J/kg/K -ThermalConductivity = 0 W/m/K -ThermalExpansionCoefficient = 0 1/K diff --git a/src/Mod/Material/FluidMaterial/Readme.md b/src/Mod/Material/FluidMaterial/Readme.md deleted file mode 100644 index a50ee6139b..0000000000 --- a/src/Mod/Material/FluidMaterial/Readme.md +++ /dev/null @@ -1,31 +0,0 @@ -# FreeCAD fluid material library - - It's intended to gather the most common fluid properties, water, air, which are useful for other modules and workbenches. - -## User defined material - -To prevent the database from becoming inefficiently large it is only limited to commonly used variables at 20 degrees Celsius at 1 atm. - -Users can defined new material, either in Fem material card editor, or directly generate textual material file, * .FCMat, see example in this folder. - -To enable new material, go to FreeCAD menu "Edit->Preference..." Cfd preference page (select on the left panel) and switch to materiai tab on the right. - -Browse to your material folder, and save/apply this preference, new material will be Material with same name as FreeCAD material has higher priority, so user defined `Water` material will not appear in Fem material task panel's dropbox list, just give it a different name! - -### Edit material value - -Please verify the fluid material properties before use. It aims to serve as a quick reference and does not aim to be an extended look up table. - - -## Add new material to Material module - -1. follow examples in material folders to create new material file -2. stick to the meta data definition in `src/Mod/Material/Templatematerial.yml` for property name -3. add the file name into the `src/Mod/Material/CMakeLists.txt` , so the new files can be installed to the properly place during compiling and installation. - -## Changelog - -CfdOF module authored 5 material types, values are taken from FM White (2011) Fluid Mechanics. - -Currently, 3 (Water, Air, None) are merged into Fem module and maintained by Cfd module author, Qingfeng Xia - diff --git a/src/Mod/Material/FluidMaterial/Water.FCMat b/src/Mod/Material/FluidMaterial/Water.FCMat deleted file mode 100644 index ced22ef6f5..0000000000 --- a/src/Mod/Material/FluidMaterial/Water.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; see meta data definition in the file: src/Mod/Material/Templatematerial.yml -[General] -Name = Water -Description = Standard distilled water properties at 20 Degrees Celsius and 1 atm -MolarMass = 18 -Father = Gas -ReferenceSource = '' - -[Fluidic] -Density = 998 kg/m^3 -DynamicViscosity = 1.003e-3 kg/m/s -KinematicViscosity = 1.005e-6 m^2/s -; PrandtlNumber is a nondimension number for CFD simulation -PrandtlNumber = 7.56 - -[Thermal] -SpecificHeat = 4182 J/kg/K -ThermalConductivity = 0.591 W/m/K -; https://en.wikipedia.org/wiki/Water -ThermalExpansionCoefficient = 2.07e-4 m/m/K - -[Electromagnetic] -RelativePermittivity = 80.0 -; at 20°C and 50Hz -ElectricalConductivity = 5.5e-6 S/m -RelativePermeability = 0.999992 diff --git a/src/Mod/Material/Gui/AppMatGui.cpp b/src/Mod/Material/Gui/AppMatGui.cpp new file mode 100644 index 0000000000..629b4457a4 --- /dev/null +++ b/src/Mod/Material/Gui/AppMatGui.cpp @@ -0,0 +1,105 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License (LGPL) * + * as published by the Free Software Foundation; either version 2 of * + * the License, or (at your option) any later version. * + * for detail see the LICENCE text file. * + * * + * FreeCAD is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with FreeCAD; if not, write to the Free Software * + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * + * USA * + * * + ***************************************************************************/ + + +#include "PreCompiled.h" +#ifndef _PreComp_ +#endif + +#include +#include +#include +#include +#include +#include + +#include "DlgSettingsMaterial.h" + +// use a different name to CreateCommand() +void CreateMaterialCommands(); + +void loadMaterialResource() +{ + // add resources and reloads the translators + Q_INIT_RESOURCE(Material); + Q_INIT_RESOURCE(Material_translation); + Gui::Translator::instance()->refresh(); +} + +namespace MatGui +{ +class Module: public Py::ExtensionModule +{ +public: + Module() + : Py::ExtensionModule("MatGui") + { + initialize("This module is the MatGui module.");// register with Python + } + + ~Module() override + {} + +private: +}; + +PyObject* initModule() +{ + return Base::Interpreter().addModule(new Module); +} + +}// namespace MatGui + +PyMOD_INIT_FUNC(MatGui) +{ + if (!Gui::Application::Instance) { + PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application."); + PyMOD_Return(nullptr); + } + + // load needed modules + try { + Base::Interpreter().runString("import Material"); + } + catch (const Base::Exception& e) { + PyErr_SetString(PyExc_ImportError, e.what()); + PyMOD_Return(nullptr); + } + + PyObject* matGuiModule = MatGui::initModule(); + + Base::Console().Log("Loading GUI of Material module... done\n"); + + // instantiating the commands + CreateMaterialCommands(); + + // register preferences pages on Material, the order here will be the order of the tabs in pref + // widget + new Gui::PrefPageProducer( + QT_TRANSLATE_NOOP("QObject", "Material")); + + // add resources and reloads the translators + loadMaterialResource(); + + PyMOD_Return(matGuiModule); +} diff --git a/src/Mod/Material/Gui/Array2D.cpp b/src/Mod/Material/Gui/Array2D.cpp new file mode 100644 index 0000000000..4c10d789ea --- /dev/null +++ b/src/Mod/Material/Gui/Array2D.cpp @@ -0,0 +1,158 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" +#ifndef _PreComp_ +#include +#endif + +#include + +#include +#include + +#include "Array2D.h" +#include "ArrayDelegate.h" +#include "ArrayModel.h" +#include "ui_Array2D.h" + + +using namespace MatGui; + +/* TRANSLATOR MatGui::Array2D */ + +Array2D::Array2D(const QString& propertyName, Materials::Material* material, QWidget* parent) + : QDialog(parent) + , ui(new Ui_Array2D) +{ + ui->setupUi(this); + + if (material->hasPhysicalProperty(propertyName)) { + _property = &(material->getPhysicalProperty(propertyName)); + } + else if (material->hasAppearanceProperty(propertyName)) { + _property = &(material->getAppearanceProperty(propertyName)); + } + else { + _property = nullptr; + } + if (_property) { + _value = static_cast(_property->getMaterialValue()); + } + else { + _value = nullptr; + } + + setupDefault(); + setupArray(); + + connect(ui->standardButtons, &QDialogButtonBox::accepted, this, &Array2D::accept); + connect(ui->standardButtons, &QDialogButtonBox::rejected, this, &Array2D::reject); +} + +void Array2D::setupDefault() +{ + if (_property == nullptr) { + return; + } + + try { + Materials::MaterialProperty& column1 = _property->getColumn(0); + QString label = QString::fromStdString("Default ") + column1.getName(); + ui->labelDefault->setText(label); + if (column1.getPropertyType() == QString::fromStdString("Quantity")) { + ui->editDefault->setMinimum(std::numeric_limits::min()); + ui->editDefault->setMaximum(std::numeric_limits::max()); + ui->editDefault->setUnitText(_property->getColumnUnits(0)); + ui->editDefault->setValue(_value->getDefault().getValue().value()); + + connect(ui->editDefault, + qOverload(&Gui::QuantitySpinBox::valueChanged), + this, + &Array2D::defaultValueChanged); + } + } + catch (const Materials::PropertyNotFound&) { + return; + } +} + +void Array2D::setHeaders(QStandardItemModel* model) +{ + QStringList headers; + auto columns = _property->getColumns(); + for (auto column = columns.begin(); column != columns.end(); column++) { + headers.append(column->getName()); + } + model->setHorizontalHeaderLabels(headers); +} + +void Array2D::setColumnWidths(QTableView* table) +{ + int length = _property->columns(); + for (int i = 0; i < length; i++) { + table->setColumnWidth(i, 100); + } +} + +void Array2D::setColumnDelegates(QTableView* table) +{ + int length = _property->columns(); + for (int i = 0; i < length; i++) { + Materials::MaterialProperty& column = _property->getColumn(i); + table->setItemDelegateForColumn( + i, + new ArrayDelegate(column.getType(), column.getUnits(), this)); + } +} + +void Array2D::setupArray() +{ + if (_property == nullptr) { + return; + } + + auto table = ui->tableView; + auto model = new Array2DModel(_property, _value, this); + table->setModel(model); + table->setEditTriggers(QAbstractItemView::AllEditTriggers); + + setColumnWidths(table); + setColumnDelegates(table); +} + +void Array2D::defaultValueChanged(const Base::Quantity& value) +{ + _value->setDefault(QVariant::fromValue(value)); +} + +void Array2D::accept() +{ + QDialog::accept(); +} + +void Array2D::reject() +{ + QDialog::reject(); +} + +#include "moc_Array2D.cpp" diff --git a/src/Mod/Material/Gui/Array2D.h b/src/Mod/Material/Gui/Array2D.h new file mode 100644 index 0000000000..1195739b72 --- /dev/null +++ b/src/Mod/Material/Gui/Array2D.h @@ -0,0 +1,68 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATGUI_ARRAY2D_H +#define MATGUI_ARRAY2D_H + +#include +#include +#include +#include + +#include "ArrayModel.h" +#include + +namespace MatGui +{ + +class Ui_Array2D; + +class Array2D: public QDialog +{ + Q_OBJECT + +public: + explicit Array2D(const QString& propertyName, + Materials::Material* material, + QWidget* parent = nullptr); + ~Array2D() override = default; + + void defaultValueChanged(const Base::Quantity& value); + + void accept() override; + void reject() override; + +private: + std::unique_ptr ui; + Materials::MaterialProperty* _property; + Materials::Material2DArray* _value; + + void setupDefault(); + void setHeaders(QStandardItemModel* model); + void setColumnWidths(QTableView* table); + void setColumnDelegates(QTableView* table); + void setupArray(); +}; + +}// namespace MatGui + +#endif// MATGUI_ARRAY2D_H diff --git a/src/Mod/Material/Gui/Array2D.ui b/src/Mod/Material/Gui/Array2D.ui new file mode 100644 index 0000000000..3911c2f6d3 --- /dev/null +++ b/src/Mod/Material/Gui/Array2D.ui @@ -0,0 +1,92 @@ + + + MatGui::Array2D + + + + 0 + 0 + 578 + 557 + + + + 2D Array + + + + + + + + Default Value + + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + Gui::QuantitySpinBox + QWidget +
Gui/QuantitySpinBox.h
+
+
+ + + + standardButtons + accepted() + MatGui::Array2D + accept() + + + 248 + 254 + + + 157 + 274 + + + + + standardButtons + rejected() + MatGui::Array2D + reject() + + + 316 + 260 + + + 286 + 274 + + + + +
diff --git a/src/Mod/Material/Gui/Array3D.cpp b/src/Mod/Material/Gui/Array3D.cpp new file mode 100644 index 0000000000..150f639376 --- /dev/null +++ b/src/Mod/Material/Gui/Array3D.cpp @@ -0,0 +1,198 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" +#ifndef _PreComp_ +#include +#include +#endif + +#include + +#include +#include + +#include "Array3D.h" +#include "ArrayDelegate.h" +#include "ArrayModel.h" +#include "ui_Array3D.h" + + +using namespace MatGui; + +Array3D::Array3D(const QString& propertyName, Materials::Material* material, QWidget* parent) + : QDialog(parent) + , ui(new Ui_Array3D) +{ + ui->setupUi(this); + + if (material->hasPhysicalProperty(propertyName)) { + _property = &(material->getPhysicalProperty(propertyName)); + } + else if (material->hasAppearanceProperty(propertyName)) { + _property = &(material->getAppearanceProperty(propertyName)); + } + else { + _property = nullptr; + } + if (_property) { + _value = static_cast(_property->getMaterialValue()); + } + else { + _value = nullptr; + } + + setupDefault(); + setupDepthArray(); + setupArray(); + + Base::Console().Log("Material '%s'\n", material->getName().toStdString().c_str()); + Base::Console().Log("\tproperty '%s'\n", propertyName.toStdString().c_str()); + + // connect(ui->splitter, &QSplitter::event, + // this, &Array3D::onSplitter); + + connect(ui->standardButtons->button(QDialogButtonBox::Ok), + &QPushButton::clicked, + this, + &Array3D::onOk); + connect(ui->standardButtons->button(QDialogButtonBox::Cancel), + &QPushButton::clicked, + this, + &Array3D::onCancel); +} + +bool Array3D::onSplitter(QEvent* e) +{ + Q_UNUSED(e) + + return false; +} + +void Array3D::setupDefault() +{ + if (_property == nullptr) { + return; + } + + try { + Materials::MaterialProperty& column1 = _property->getColumn(0); + QString label = QString::fromStdString("Default ") + column1.getName(); + ui->labelDefault->setText(label); + if (column1.getPropertyType() == QString::fromStdString("Quantity")) { + ui->editDefault->setMinimum(std::numeric_limits::min()); + ui->editDefault->setMaximum(std::numeric_limits::max()); + ui->editDefault->setUnitText(_property->getColumnUnits(0)); + ui->editDefault->setValue(_value->getDefault().getValue().value()); + + connect(ui->editDefault, + qOverload(&Gui::QuantitySpinBox::valueChanged), + this, + &Array3D::defaultValueChanged); + } + } + catch (const Materials::PropertyNotFound&) { + return; + } +} + +void Array3D::defaultValueChanged(const Base::Quantity& value) +{ + _value->setDefault(QVariant::fromValue(value)); +} + +void Array3D::setDepthColumnDelegate(QTableView* table) +{ + Materials::MaterialProperty& column = _property->getColumn(0); + table->setItemDelegateForColumn(0, + new ArrayDelegate(column.getType(), column.getUnits(), this)); +} + +void Array3D::setDepthColumnWidth(QTableView* table) +{ + table->setColumnWidth(0, 100); +} + +void Array3D::setupDepthArray() +{ + if (_property == nullptr) { + return; + } + + auto table = ui->table3D; + auto model = new Array3DDepthModel(_property, _value, this); + table->setModel(model); + table->setEditTriggers(QAbstractItemView::AllEditTriggers); + + setDepthColumnWidth(table); + setDepthColumnDelegate(table); +} + +void Array3D::setColumnWidths(QTableView* table) +{ + int length = _property->columns(); + for (int i = 0; i < length; i++) { + table->setColumnWidth(i, 100); + } +} + +void Array3D::setColumnDelegates(QTableView* table) +{ + int length = _property->columns(); + for (int i = 0; i < length; i++) { + Materials::MaterialProperty& column = _property->getColumn(i); + table->setItemDelegateForColumn( + i, + new ArrayDelegate(column.getType(), column.getUnits(), this)); + } +} + +void Array3D::setupArray() +{ + if (_property == nullptr) { + return; + } + + auto table = ui->table2D; + auto model = new Array3DModel(_property, _value, this); + table->setModel(model); + table->setEditTriggers(QAbstractItemView::AllEditTriggers); + + setColumnWidths(table); + setColumnDelegates(table); +} + +void Array3D::onOk(bool checked) +{ + Q_UNUSED(checked) + + QDialog::accept(); +} + +void Array3D::onCancel(bool checked) +{ + Q_UNUSED(checked) + + QDialog::reject(); +} + +#include "moc_Array3D.cpp" diff --git a/src/Mod/Material/Gui/Array3D.h b/src/Mod/Material/Gui/Array3D.h new file mode 100644 index 0000000000..7759a674ff --- /dev/null +++ b/src/Mod/Material/Gui/Array3D.h @@ -0,0 +1,67 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATGUI_ARRAY3D_H +#define MATGUI_ARRAY3D_H + +#include +#include +#include + +namespace MatGui +{ + +class Ui_Array3D; + +class Array3D: public QDialog +{ + Q_OBJECT + +public: + explicit Array3D(const QString& propertyName, + Materials::Material* material, + QWidget* parent = nullptr); + ~Array3D() override = default; + + void defaultValueChanged(const Base::Quantity& value); + bool onSplitter(QEvent* e); + + void onOk(bool checked); + void onCancel(bool checked); + +private: + std::unique_ptr ui; + Materials::MaterialProperty* _property; + Materials::Material3DArray* _value; + + void setupDefault(); + void setDepthColumnWidth(QTableView* table); + void setDepthColumnDelegate(QTableView* table); + void setupDepthArray(); + void setColumnWidths(QTableView* table); + void setColumnDelegates(QTableView* table); + void setupArray(); +}; + +}// namespace MatGui + +#endif// MATGUI_ARRAY3D_H diff --git a/src/Mod/Material/Gui/Array3D.ui b/src/Mod/Material/Gui/Array3D.ui new file mode 100644 index 0000000000..7d2d6dd669 --- /dev/null +++ b/src/Mod/Material/Gui/Array3D.ui @@ -0,0 +1,104 @@ + + + MatGui::Array3D + + + + 0 + 0 + 915 + 709 + + + + 3D Array + + + + + + + + + 0 + 0 + + + + Default Value + + + + + + + + + + + + + + + + Qt::Horizontal + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + Gui::QuantitySpinBox + QWidget +
Gui/QuantitySpinBox.h
+
+
+ + + + standardButtons + accepted() + MatGui::Array3D + accept() + + + 248 + 254 + + + 157 + 274 + + + + + standardButtons + rejected() + MatGui::Array3D + reject() + + + 316 + 260 + + + 286 + 274 + + + + +
diff --git a/src/Mod/Material/Gui/ArrayDelegate.cpp b/src/Mod/Material/Gui/ArrayDelegate.cpp new file mode 100644 index 0000000000..ea5df4a7fb --- /dev/null +++ b/src/Mod/Material/Gui/ArrayDelegate.cpp @@ -0,0 +1,184 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" +#ifndef _PreComp_ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +// #include + +#include +#include + +#include "Array2D.h" +#include "Array3D.h" +#include "ArrayDelegate.h" +#include "MaterialSave.h" + + +using namespace MatGui; + +ArrayDelegate::ArrayDelegate(Materials::MaterialValue::ValueType type, + QString units, + QObject* parent) + : QStyledItemDelegate(parent) + , _type(type) + , _units(units) +{} + +void ArrayDelegate::paint(QPainter* painter, + const QStyleOptionViewItem& option, + const QModelIndex& index) const +{ + + if (_type == Materials::MaterialValue::Quantity) { + const AbstractArrayModel* tableModel = + reinterpret_cast(index.model()); + painter->save(); + + if (tableModel->newRow(index)) { + painter->drawText(option.rect, 0, QString()); + } + else { + QVariant item = tableModel->data(index); + Base::Quantity quantity = item.value(); + QString text = quantity.getUserString(); + painter->drawText(option.rect, 0, text); + } + + painter->restore(); + } + else { + QStyledItemDelegate::paint(painter, option, index); + } +} + +void ArrayDelegate::setEditorData(QWidget* editor, const QModelIndex& index) const +{ + Base::Console().Log("ArrayDelegate::setEditorData()\n"); + + if (_type == Materials::MaterialValue::Quantity) { + QAbstractItemModel* tableModel = const_cast(index.model()); + auto item = tableModel->data(index); + + // Gui::InputField* input = static_cast(editor); + // input->setText(item.toString()); + Gui::QuantitySpinBox* input = static_cast(editor); + input->setValue(item.value()); + } + else { + QStyledItemDelegate::setEditorData(editor, index); + } +} + +QWidget* ArrayDelegate::createEditor(QWidget* parent, + const QStyleOptionViewItem&, + const QModelIndex& index) const +{ + Base::Console().Log("ArrayDelegate::createEditor()\n"); + + const QAbstractTableModel* tableModel = static_cast(index.model()); + auto item = tableModel->data(index); + + QWidget* editor = createWidget(parent, item); + + return editor; +} + +QWidget* ArrayDelegate::createWidget(QWidget* parent, const QVariant& item) const +{ + QWidget* widget = nullptr; + + if (_type == Materials::MaterialValue::String || _type == Materials::MaterialValue::URL + || _type == Materials::MaterialValue::List) { + widget = new Gui::PrefLineEdit(parent); + } + else if (_type == Materials::MaterialValue::Integer) { + Gui::UIntSpinBox* spinner = new Gui::UIntSpinBox(parent); + spinner->setMinimum(0); + spinner->setMaximum(UINT_MAX); + spinner->setValue(item.toUInt()); + widget = spinner; + } + else if (_type == Materials::MaterialValue::Float) { + Gui::DoubleSpinBox* spinner = new Gui::DoubleSpinBox(parent); + + // the magnetic permeability is the parameter for which many decimals matter + // the most however, even for this, 6 digits are sufficient + spinner->setDecimals(6); + + // for almost all Float parameters of materials a step of 1 would be too large + spinner->setSingleStep(0.1); + + spinner->setMinimum(std::numeric_limits::min()); + spinner->setMaximum(std::numeric_limits::max()); + spinner->setValue(item.toDouble()); + widget = spinner; + } + else if (_type == Materials::MaterialValue::Boolean) { + Gui::PrefComboBox* combo = new Gui::PrefComboBox(parent); + combo->insertItem(0, QString::fromStdString("")); + combo->insertItem(1, QString::fromStdString("False")); + combo->insertItem(2, QString::fromStdString("True")); + combo->setCurrentText(item.toString()); + widget = combo; + } + else if (_type == Materials::MaterialValue::Quantity) { + Gui::QuantitySpinBox* input = new Gui::QuantitySpinBox(); + input->setMinimum(std::numeric_limits::min()); + input->setMaximum(std::numeric_limits::max()); + input->setUnitText(_units); + input->setValue(item.value()); + + widget = input; + } + else { + // Default editor + widget = new QLineEdit(parent); + } + + widget->setParent(parent); + + return widget; +} + +#include "moc_ArrayDelegate.cpp" diff --git a/src/Mod/Material/Gui/ArrayDelegate.h b/src/Mod/Material/Gui/ArrayDelegate.h new file mode 100644 index 0000000000..71e3bdd222 --- /dev/null +++ b/src/Mod/Material/Gui/ArrayDelegate.h @@ -0,0 +1,75 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATGUI_ArrayDelegate_H +#define MATGUI_ArrayDelegate_H + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace fs = boost::filesystem; + +namespace MatGui +{ + +class ArrayDelegate: public QStyledItemDelegate +{ + Q_OBJECT +public: + explicit ArrayDelegate( + Materials::MaterialValue::ValueType type = Materials::MaterialValue::None, + QString units = QString(), + QObject* parent = nullptr); + virtual ~ArrayDelegate() = default; + + void paint(QPainter* painter, + const QStyleOptionViewItem& option, + const QModelIndex& index) const override; + QWidget* createEditor(QWidget* parent, + const QStyleOptionViewItem&, + const QModelIndex& index) const override; + void setEditorData(QWidget* editor, const QModelIndex& index) const override; + + // Q_SIGNALS: + /** Emits this signal when a property has changed */ + // void propertyChange(const QString &property, const QString value); + +private: + Materials::MaterialValue::ValueType _type; + QString _units; + + QWidget* createWidget(QWidget* parent, const QVariant& item) const; +}; + +}// namespace MatGui + +#endif// MATGUI_ArrayDelegate_H diff --git a/src/Mod/Material/Gui/ArrayModel.cpp b/src/Mod/Material/Gui/ArrayModel.cpp new file mode 100644 index 0000000000..3114c7ef67 --- /dev/null +++ b/src/Mod/Material/Gui/ArrayModel.cpp @@ -0,0 +1,466 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" +#ifndef _PreComp_ +#include +#endif + +#include + +#include +#include + +#include +#include + +#include "ArrayModel.h" + + +using namespace MatGui; + +/* TRANSLATOR MatGui::ArrayModel */ + +AbstractArrayModel::AbstractArrayModel(QObject* parent) + : QAbstractTableModel(parent) +{} + +//=== + + +Array2DModel::Array2DModel(Materials::MaterialProperty* property, + Materials::Material2DArray* value, + QObject* parent) + : AbstractArrayModel(parent) + , _property(property) + , _value(value) +{} + +int Array2DModel::rowCount(const QModelIndex& parent) const +{ + if (parent.isValid()) { + return 0;// No children + } + + return _value->rows() + 1;// Will always have 1 empty row +} + +bool Array2DModel::newRow(const QModelIndex& index) const +{ + return (index.row() == _value->rows()); +} + +int Array2DModel::columnCount(const QModelIndex& parent) const +{ + Q_UNUSED(parent); + + return _property->columns(); +} + +QVariant Array2DModel::data(const QModelIndex& index, int role) const +{ + if (role == Qt::DisplayRole) { + try { + return _value->getValue(index.row(), index.column()); + } + catch (const Materials::InvalidIndex&) { + } + + try { + auto column = _property->getColumnType(index.column()); + if (column == Materials::MaterialValue::Quantity) { + Base::Quantity q = Base::Quantity(0, _property->getColumnUnits(index.column())); + return QVariant::fromValue(q); + } + } + catch (const Materials::InvalidColumn&) { + } + + return QString(); + } + + return QVariant(); +} + +QVariant Array2DModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + if (role == Qt::DisplayRole) { + if (orientation == Qt::Horizontal) { + Materials::MaterialProperty& column = _property->getColumn(section); + return QVariant(column.getName()); + } + else if (orientation == Qt::Vertical) { + // Vertical header + if (section == (rowCount() - 1)) { + return QVariant(QString::fromStdString("*")); + } + return QVariant(section + 1); + } + } + + return QAbstractTableModel::headerData(section, orientation, role); +} + +bool Array2DModel::setData(const QModelIndex& index, const QVariant& value, int role) +{ + Q_UNUSED(role); + + if (index.row() == _value->rows()) { + insertRows(index.row(), 1); + } + _value->setValue(index.row(), index.column(), value); + + Q_EMIT dataChanged(index, index); + return true; +} + +Qt::ItemFlags Array2DModel::flags(const QModelIndex& index) const +{ + return (QAbstractTableModel::flags(index) | Qt::ItemIsEditable); +} + + +// Resizing functions +bool Array2DModel::insertRows(int row, int count, const QModelIndex& parent) +{ + beginInsertRows(parent, row, row + count - 1); + + int columns = columnCount(); + for (int i = 0; i < count; i++) { + std::vector* rowPtr = new std::vector(); + for (int j = 0; j < columns; j++) { + rowPtr->push_back(_property->getColumnNull(j)); + } + + _value->insertRow(row, rowPtr); + } + + endInsertRows(); + + return false; +} + +bool Array2DModel::removeRows(int row, int count, const QModelIndex& parent) +{ + beginRemoveRows(parent, row, row + count - 1); + + endRemoveRows(); + + return false; +} + +bool Array2DModel::insertColumns(int column, int count, const QModelIndex& parent) +{ + Q_UNUSED(column); + Q_UNUSED(count); + Q_UNUSED(parent); + + return false; +} + +bool Array2DModel::removeColumns(int column, int count, const QModelIndex& parent) +{ + Q_UNUSED(column); + Q_UNUSED(count); + Q_UNUSED(parent); + + return false; +} + +//=== + +Array3DDepthModel::Array3DDepthModel(Materials::MaterialProperty* property, + Materials::Material3DArray* value, + QObject* parent) + : AbstractArrayModel(parent) + , _property(property) + , _value(value) +{} + +int Array3DDepthModel::rowCount(const QModelIndex& parent) const +{ + if (parent.isValid()) { + return 0;// No children + } + + return _value->depth() + 1;// Will always have 1 empty row +} + +bool Array3DDepthModel::newRow(const QModelIndex& index) const +{ + return (index.row() == _value->depth()); +} + +QVariant Array3DDepthModel::data(const QModelIndex& index, int role) const +{ + if (role == Qt::DisplayRole) { + try { + return _value->getValue(index.row(), index.column()); + } + catch (const Materials::InvalidIndex&) { + } + + try { + auto column = _property->getColumnType(index.column()); + if (column == Materials::MaterialValue::Quantity) { + Base::Quantity q = Base::Quantity(0, _property->getColumnUnits(index.column())); + return QVariant::fromValue(q); + } + } + catch (const Materials::InvalidColumn&) { + } + + return QString(); + } + + return QVariant(); +} + +QVariant Array3DDepthModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + if (role == Qt::DisplayRole) { + if (orientation == Qt::Horizontal) { + Materials::MaterialProperty& column = _property->getColumn(section); + return QVariant(column.getName()); + } + else if (orientation == Qt::Vertical) { + // Vertical header + if (section == (rowCount() - 1)) { + return QVariant(QString::fromStdString("*")); + } + return QVariant(section + 1); + } + } + + return QAbstractTableModel::headerData(section, orientation, role); +} + +bool Array3DDepthModel::setData(const QModelIndex& index, const QVariant& value, int role) +{ + Q_UNUSED(role); + + if (index.row() == _value->depth()) { + insertRows(index.row(), 1); + } + _value->setValue(index.row(), index.column(), value); + + Q_EMIT dataChanged(index, index); + return true; +} + +Qt::ItemFlags Array3DDepthModel::flags(const QModelIndex& index) const +{ + return (QAbstractTableModel::flags(index) | Qt::ItemIsEditable); +} + + +// Resizing functions +bool Array3DDepthModel::insertRows(int row, int count, const QModelIndex& parent) +{ + beginInsertRows(parent, row, row + count - 1); + + int columns = columnCount(); + for (int i = 0; i < count; i++) { + std::vector* rowPtr = new std::vector(); + for (int j = 0; j < columns; j++) { + rowPtr->push_back(_property->getColumnNull(j)); + } + + // _value->insertRow(row, rowPtr); + } + + endInsertRows(); + + return false; +} + +bool Array3DDepthModel::removeRows(int row, int count, const QModelIndex& parent) +{ + beginRemoveRows(parent, row, row + count - 1); + + endRemoveRows(); + + return false; +} + +bool Array3DDepthModel::insertColumns(int column, int count, const QModelIndex& parent) +{ + Q_UNUSED(column); + Q_UNUSED(count); + Q_UNUSED(parent); + + return false; +} + +bool Array3DDepthModel::removeColumns(int column, int count, const QModelIndex& parent) +{ + Q_UNUSED(column); + Q_UNUSED(count); + Q_UNUSED(parent); + + return false; +} + +//=== + +Array3DModel::Array3DModel(Materials::MaterialProperty* property, + Materials::Material3DArray* value, + QObject* parent) + : AbstractArrayModel(parent) + , _property(property) + , _value(value) +{} + +int Array3DModel::rowCount(const QModelIndex& parent) const +{ + if (parent.isValid()) { + return 0;// No children + } + + return _value->depth() + 1;// Will always have 1 empty row +} + +int Array3DModel::columnCount(const QModelIndex& parent) const +{ + Q_UNUSED(parent); + + return _property->columns() - 1; +} + +bool Array3DModel::newRow(const QModelIndex& index) const +{ + return (index.row() == _value->depth()); +} + +QVariant Array3DModel::data(const QModelIndex& index, int role) const +{ + if (role == Qt::DisplayRole) { + Base::Console().Error("Row %d, column %d\n", index.row(), index.column()); + try { + return _value->getValue(index.row(), index.column() + 1); + } + catch (const Materials::InvalidIndex&) { + } + catch (const std::exception& e) { + Base::Console().Error("The error message is: %s\n", e.what()); + } + + try { + auto column = _property->getColumnType(index.column() + 1); + if (column == Materials::MaterialValue::Quantity) { + Base::Quantity q = Base::Quantity(0, _property->getColumnUnits(index.column() - 1)); + return QVariant::fromValue(q); + } + } + catch (const Materials::InvalidColumn&) { + } + + return QString(); + } + + return QVariant(); +} + +QVariant Array3DModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + if (role == Qt::DisplayRole) { + if (orientation == Qt::Horizontal) { + Materials::MaterialProperty& column = _property->getColumn(section + 1); + return QVariant(column.getName()); + } + else if (orientation == Qt::Vertical) { + // Vertical header + if (section == (rowCount() - 1)) { + return QVariant(QString::fromStdString("*")); + } + return QVariant(section + 1); + } + } + + return QAbstractTableModel::headerData(section, orientation, role); +} + +bool Array3DModel::setData(const QModelIndex& index, const QVariant& value, int role) +{ + Q_UNUSED(role); + + if (index.row() == _value->depth()) { + insertRows(index.row(), 1); + } + _value->setValue(index.row(), index.column(), value); + + Q_EMIT dataChanged(index, index); + return true; +} + +Qt::ItemFlags Array3DModel::flags(const QModelIndex& index) const +{ + return (QAbstractTableModel::flags(index) | Qt::ItemIsEditable); +} + + +// Resizing functions +bool Array3DModel::insertRows(int row, int count, const QModelIndex& parent) +{ + beginInsertRows(parent, row, row + count - 1); + + int columns = columnCount(); + for (int i = 0; i < count; i++) { + std::vector* rowPtr = new std::vector(); + for (int j = 0; j < columns; j++) { + rowPtr->push_back(_property->getColumnNull(j)); + } + + // _value->insertRow(row, rowPtr); + } + + endInsertRows(); + + return false; +} + +bool Array3DModel::removeRows(int row, int count, const QModelIndex& parent) +{ + beginRemoveRows(parent, row, row + count - 1); + + endRemoveRows(); + + return false; +} + +bool Array3DModel::insertColumns(int column, int count, const QModelIndex& parent) +{ + Q_UNUSED(column); + Q_UNUSED(count); + Q_UNUSED(parent); + + return false; +} + +bool Array3DModel::removeColumns(int column, int count, const QModelIndex& parent) +{ + Q_UNUSED(column); + Q_UNUSED(count); + Q_UNUSED(parent); + + return false; +} diff --git a/src/Mod/Material/Gui/ArrayModel.h b/src/Mod/Material/Gui/ArrayModel.h new file mode 100644 index 0000000000..021f041be4 --- /dev/null +++ b/src/Mod/Material/Gui/ArrayModel.h @@ -0,0 +1,139 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATGUI_ARRAYMODEL_H +#define MATGUI_ARRAYMODEL_H + +#include +#include +#include +#include + +#include +#include + +namespace MatGui +{ + +class AbstractArrayModel: public QAbstractTableModel +{ +public: + explicit AbstractArrayModel(QObject* parent = nullptr); + ~AbstractArrayModel() override = default; + + virtual bool newRow(const QModelIndex& index) const = 0; +}; + +class Array2DModel: public AbstractArrayModel +{ +public: + explicit Array2DModel(Materials::MaterialProperty* property = nullptr, + Materials::Material2DArray* value = nullptr, + QObject* parent = nullptr); + ~Array2DModel() override = default; + + // Overridden virtual functions + int rowCount(const QModelIndex& parent = QModelIndex()) const override; + bool newRow(const QModelIndex& index) const override; + int columnCount(const QModelIndex& parent = QModelIndex()) const override; + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; + QVariant + headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override; + Qt::ItemFlags flags(const QModelIndex& index) const override; + + // Resizing functions + bool insertRows(int row, int count, const QModelIndex& parent = QModelIndex()) override; + bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()) override; + bool insertColumns(int column, int count, const QModelIndex& parent = QModelIndex()) override; + bool removeColumns(int column, int count, const QModelIndex& parent = QModelIndex()) override; + +private: + Materials::MaterialProperty* _property; + Materials::Material2DArray* _value; +}; + +class Array3DDepthModel: public AbstractArrayModel +{ +public: + explicit Array3DDepthModel(Materials::MaterialProperty* property = nullptr, + Materials::Material3DArray* value = nullptr, + QObject* parent = nullptr); + ~Array3DDepthModel() override = default; + + // Overridden virtual functions + int rowCount(const QModelIndex& parent = QModelIndex()) const override; + bool newRow(const QModelIndex& index) const override; + int columnCount(const QModelIndex& parent = QModelIndex()) const override + { + Q_UNUSED(parent) + return 1; + } + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; + QVariant + headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override; + Qt::ItemFlags flags(const QModelIndex& index) const override; + + // Resizing functions + bool insertRows(int row, int count, const QModelIndex& parent = QModelIndex()) override; + bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()) override; + bool insertColumns(int column, int count, const QModelIndex& parent = QModelIndex()) override; + bool removeColumns(int column, int count, const QModelIndex& parent = QModelIndex()) override; + +private: + Materials::MaterialProperty* _property; + Materials::Material3DArray* _value; +}; + +class Array3DModel: public AbstractArrayModel +{ +public: + explicit Array3DModel(Materials::MaterialProperty* property = nullptr, + Materials::Material3DArray* value = nullptr, + QObject* parent = nullptr); + ~Array3DModel() override = default; + + // Overridden virtual functions + int rowCount(const QModelIndex& parent = QModelIndex()) const override; + bool newRow(const QModelIndex& index) const override; + int columnCount(const QModelIndex& parent = QModelIndex()) const override; + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; + QVariant + headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override; + Qt::ItemFlags flags(const QModelIndex& index) const override; + + // Resizing functions + bool insertRows(int row, int count, const QModelIndex& parent = QModelIndex()) override; + bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()) override; + bool insertColumns(int column, int count, const QModelIndex& parent = QModelIndex()) override; + bool removeColumns(int column, int count, const QModelIndex& parent = QModelIndex()) override; + +private: + Materials::MaterialProperty* _property; + Materials::Material3DArray* _value; +}; + +}// namespace MatGui + +#endif// MATGUI_ARRAYMODEL_H diff --git a/src/Mod/Material/Gui/CMakeLists.txt b/src/Mod/Material/Gui/CMakeLists.txt new file mode 100644 index 0000000000..07e6ba0c0c --- /dev/null +++ b/src/Mod/Material/Gui/CMakeLists.txt @@ -0,0 +1,106 @@ +if(MSVC) + add_definitions(-DHAVE_ACOSH -DHAVE_ATANH -DHAVE_ASINH) +else(MSVC) + add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H) +endif(MSVC) + +include_directories( + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/src + ${CMAKE_BINARY_DIR}/src + ${CMAKE_CURRENT_BINARY_DIR} + ${Boost_INCLUDE_DIRS} + ${COIN3D_INCLUDE_DIRS} + ${OCC_INCLUDE_DIR} + ${PYTHON_INCLUDE_DIRS} + ${XercesC_INCLUDE_DIRS} + ${ZLIB_INCLUDE_DIR} +) +link_directories(${OCC_LIBRARY_DIR}) + +set(MatGui_LIBS + Material + FreeCADGui +) + +include_directories( + ${QtConcurrent_INCLUDE_DIRS} +) +list(APPEND MatGui_LIBS + ${QtConcurrent_LIBRARIES} +) + +set (Material_TR_QRC ${CMAKE_CURRENT_BINARY_DIR}/Resources/Material_translation.qrc) +qt_find_and_add_translation(QM_SRCS "Resources/translations/*_*.ts" + ${CMAKE_CURRENT_BINARY_DIR}/Resources/translations) +qt_create_resource_file(${Material_TR_QRC} ${QM_SRCS}) +qt_add_resources(MatGui_QRC_SRCS Resources/Material.qrc ${Material_TR_QRC}) + +set(MatGui_UIC_SRCS + Array2D.ui + Array3D.ui + DlgSettingsMaterial.ui + MaterialSave.ui + MaterialsEditor.ui + ModelSelect.ui +) + +SET(MatGui_SRCS + ${MatGui_QRC_SRCS} + ${MatGui_UIC_HDRS} + AppMatGui.cpp + Array2D.cpp + Array2D.h + Array2D.ui + Array3D.cpp + Array3D.h + Array3D.ui + ArrayDelegate.cpp + ArrayDelegate.h + ArrayModel.cpp + ArrayModel.h + Command.cpp + DlgSettingsMaterial.cpp + DlgSettingsMaterial.h + DlgSettingsMaterial.ui + MaterialDelegate.cpp + MaterialDelegate.h + MaterialSave.cpp + MaterialSave.h + MaterialSave.ui + MaterialsEditor.cpp + MaterialsEditor.h + MaterialsEditor.ui + ModelSelect.cpp + ModelSelect.h + ModelSelect.ui + PreCompiled.cpp + PreCompiled.h +) + +if(FREECAD_USE_PCH) + add_definitions(-D_PreComp_) + GET_MSVC_PRECOMPILED_SOURCE("PreCompiled.cpp" PCH_SRCS ${MatGui_SRCS}) + ADD_MSVC_PRECOMPILED_HEADER(MatGui PreCompiled.h PreCompiled.cpp PCH_SRCS) +endif(FREECAD_USE_PCH) + +SET(MatGuiIcon_SVG + Resources/icons/Materials_Edit.svg + Resources/icons/MaterialWorkbench.svg + Resources/icons/preferences-material.svg + Resources/icons/preview-rendered.svg + Resources/icons/preview-vector.svg + Resources/icons/table.svg +) + +add_library(MatGui SHARED ${MatGui_SRCS} ${MatGuiIcon_SVG}) +target_link_libraries(MatGui ${MatGui_LIBS}) + + +SET_BIN_DIR(MatGui MatGui /Mod/Material) +SET_PYTHON_PREFIX_SUFFIX(MatGui) + +fc_copy_sources(MatGui "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Material" ${MatGuiIcon_SVG}) + +INSTALL(TARGETS MatGui DESTINATION ${CMAKE_INSTALL_LIBDIR}) +INSTALL(FILES ${MatGuiIcon_SVG} DESTINATION "${CMAKE_INSTALL_DATADIR}/Mod/Material/Resources/icons") diff --git a/src/Mod/Material/Gui/Command.cpp b/src/Mod/Material/Gui/Command.cpp new file mode 100644 index 0000000000..b3d1e3ff4e --- /dev/null +++ b/src/Mod/Material/Gui/Command.cpp @@ -0,0 +1,83 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#include "PreCompiled.h" +#ifndef _PreComp_ +#include +#endif + +#include +#include + +#include "MaterialSave.h" +#include "MaterialsEditor.h" +#include "ModelSelect.h" + + +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +//=========================================================================== +// Material_Edit +//=========================================================================== +DEF_STD_CMD_A(CmdMaterialsEdit) + +CmdMaterialsEdit::CmdMaterialsEdit() + : Command("Materials_Edit") +{ + sAppModule = "Material"; + sGroup = QT_TR_NOOP("Material"); + sMenuText = QT_TR_NOOP("Edit..."); + sToolTipText = QT_TR_NOOP("Edit material properties"); + sWhatsThis = "Materials_Edit"; + sStatusTip = sToolTipText; + sPixmap = "Materials_Edit"; +} + +void CmdMaterialsEdit::activated(int iMsg) +{ + Q_UNUSED(iMsg); + + Base::Console().Log("Materials_Edit\n"); + + static QPointer dlg = nullptr; + if (!dlg) { + dlg = new MatGui::MaterialsEditor(Gui::getMainWindow()); + } + dlg->setAttribute(Qt::WA_DeleteOnClose); + dlg->show(); +} + +bool CmdMaterialsEdit::isActive() +{ + // return (hasActiveDocument() && !Gui::Control().activeDialog()); + return true; +} + +//--------------------------------------------------------------- + +void CreateMaterialCommands() +{ + Gui::CommandManager& rcCmdMgr = Gui::Application::Instance->commandManager(); + + rcCmdMgr.addCommand(new CmdMaterialsEdit()); +} diff --git a/src/Mod/Fem/Gui/DlgSettingsFemMaterialImp.cpp b/src/Mod/Material/Gui/DlgSettingsMaterial.cpp similarity index 81% rename from src/Mod/Fem/Gui/DlgSettingsFemMaterialImp.cpp rename to src/Mod/Material/Gui/DlgSettingsMaterial.cpp index 9451f8ea01..5c05c62256 100644 --- a/src/Mod/Fem/Gui/DlgSettingsFemMaterialImp.cpp +++ b/src/Mod/Material/Gui/DlgSettingsMaterial.cpp @@ -24,45 +24,51 @@ #include "PreCompiled.h" -#include "DlgSettingsFemMaterialImp.h" -#include "ui_DlgSettingsFemMaterial.h" +#include "DlgSettingsMaterial.h" +#include "ui_DlgSettingsMaterial.h" -using namespace FemGui; +using namespace MatGui; -DlgSettingsFemMaterialImp::DlgSettingsFemMaterialImp(QWidget* parent) +DlgSettingsMaterial::DlgSettingsMaterial(QWidget* parent) : PreferencePage(parent) - , ui(new Ui_DlgSettingsFemMaterialImp) + , ui(new Ui_DlgSettingsMaterial) { ui->setupUi(this); } -DlgSettingsFemMaterialImp::~DlgSettingsFemMaterialImp() = default; - -void DlgSettingsFemMaterialImp::saveSettings() +void DlgSettingsMaterial::saveSettings() { ui->cb_use_built_in_materials->onSave(); + ui->cb_use_mat_from_workbenches->onSave(); ui->cb_use_mat_from_config_dir->onSave(); ui->cb_use_mat_from_custom_dir->onSave(); ui->fc_custom_mat_dir->onSave(); ui->cb_delete_duplicates->onSave(); ui->cb_sort_by_resources->onSave(); + + // Temporary for testing + ui->cb_legacy_editor->onSave(); } -void DlgSettingsFemMaterialImp::loadSettings() +void DlgSettingsMaterial::loadSettings() { ui->cb_use_built_in_materials->onRestore(); + ui->cb_use_mat_from_workbenches->onRestore(); ui->cb_use_mat_from_config_dir->onRestore(); ui->cb_use_mat_from_custom_dir->onRestore(); ui->fc_custom_mat_dir->onRestore(); ui->cb_delete_duplicates->onRestore(); ui->cb_sort_by_resources->onRestore(); + + // Temporary for testing + ui->cb_legacy_editor->onRestore(); } /** * Sets the strings of the subwidgets using the current language. */ -void DlgSettingsFemMaterialImp::changeEvent(QEvent* e) +void DlgSettingsMaterial::changeEvent(QEvent* e) { if (e->type() == QEvent::LanguageChange) { ui->retranslateUi(this); @@ -72,4 +78,4 @@ void DlgSettingsFemMaterialImp::changeEvent(QEvent* e) } } -#include "moc_DlgSettingsFemMaterialImp.cpp" +#include "moc_DlgSettingsMaterial.cpp" diff --git a/src/Mod/Fem/Gui/DlgSettingsFemMaterialImp.h b/src/Mod/Material/Gui/DlgSettingsMaterial.h similarity index 81% rename from src/Mod/Fem/Gui/DlgSettingsFemMaterialImp.h rename to src/Mod/Material/Gui/DlgSettingsMaterial.h index 9a72a3eca0..b0d62cdb4d 100644 --- a/src/Mod/Fem/Gui/DlgSettingsFemMaterialImp.h +++ b/src/Mod/Material/Gui/DlgSettingsMaterial.h @@ -22,24 +22,24 @@ * * ***************************************************************************/ -#ifndef FEMGUI_DLGSETTINGSFEMMATERIALIMP_H -#define FEMGUI_DLGSETTINGSFEMMATERIALIMP_H +#ifndef MATGUI_DLGSETTINGSMATERIAL_H +#define MATGUI_DLGSETTINGSMATERIAL_H #include #include -namespace FemGui +namespace MatGui { -class Ui_DlgSettingsFemMaterialImp; +class Ui_DlgSettingsMaterial; -class DlgSettingsFemMaterialImp: public Gui::Dialog::PreferencePage +class DlgSettingsMaterial: public Gui::Dialog::PreferencePage { Q_OBJECT public: - explicit DlgSettingsFemMaterialImp(QWidget* parent = nullptr); - ~DlgSettingsFemMaterialImp() override; + explicit DlgSettingsMaterial(QWidget* parent = nullptr); + ~DlgSettingsMaterial() override = default; protected: void saveSettings() override; @@ -47,9 +47,9 @@ protected: void changeEvent(QEvent* e) override; private: - std::unique_ptr ui; + std::unique_ptr ui; }; -} // namespace FemGui +} // namespace MatGui -#endif // FEMGUI_DLGSETTINGSFEMMATERIALIMP_H +#endif // MATGUI_DLGSETTINGSMATERIAL_H diff --git a/src/Mod/Fem/Gui/DlgSettingsFemMaterial.ui b/src/Mod/Material/Gui/DlgSettingsMaterial.ui similarity index 82% rename from src/Mod/Fem/Gui/DlgSettingsFemMaterial.ui rename to src/Mod/Material/Gui/DlgSettingsMaterial.ui index f763a07e42..fa3afcd8d8 100644 --- a/src/Mod/Fem/Gui/DlgSettingsFemMaterial.ui +++ b/src/Mod/Material/Gui/DlgSettingsMaterial.ui @@ -1,17 +1,17 @@ - FemGui::DlgSettingsFemMaterialImp - + MatGui::DlgSettingsMaterial + 0 0 434 - 229 + 341 - Material + General @@ -44,6 +44,25 @@ + + + + Use materials added by external workbenches. + + + Use materials from external workbenches + + + true + + + UseMaterialsFromWorkbenches + + + Mod/Material/Resources + + + @@ -124,9 +143,6 @@ will be listed as available.
0 - - Gui::FileChooser::Directory - CustomMaterialsDir @@ -190,6 +206,31 @@ If unchecked, they will be sorted by their name.
+ + + + Testing + + + + + + Use legacy editor + + + true + + + LegacyEditor + + + Mod/Material/Cards + + + + + + @@ -226,9 +267,7 @@ If unchecked, they will be sorted by their name.
Gui/PrefWidgets.h
- - - + cb_use_mat_from_custom_dir diff --git a/src/Mod/Material/Gui/MaterialDelegate.cpp b/src/Mod/Material/Gui/MaterialDelegate.cpp new file mode 100644 index 0000000000..8a3e434c2f --- /dev/null +++ b/src/Mod/Material/Gui/MaterialDelegate.cpp @@ -0,0 +1,466 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" +#ifndef _PreComp_ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "Array2D.h" +#include "Array3D.h" +#include "MaterialDelegate.h" +#include "MaterialSave.h" + + +using namespace MatGui; + +MaterialDelegate::MaterialDelegate(QObject* parent) + : QStyledItemDelegate(parent) +{} + +bool MaterialDelegate::editorEvent(QEvent* event, + QAbstractItemModel* model, + const QStyleOptionViewItem& option, + const QModelIndex& index) +{ + if (index.column() == 1) { + if (event->type() == QEvent::MouseButtonDblClick) { + const QStandardItemModel* treeModel = + static_cast(index.model()); + + // Check we're not the material model root. This is also used to access the entry + // columns + auto item = treeModel->itemFromIndex(index); + auto group = item->parent(); + if (!group) { + return QStyledItemDelegate::editorEvent(event, model, option, index); + } + + int row = index.row(); + + QString propertyName = group->child(row, 0)->text(); + QString propertyType = QString::fromStdString("String"); + if (group->child(row, 2)) { + propertyType = group->child(row, 2)->text(); + } + + std::string type = propertyType.toStdString(); + if (type == "Color") { + Base::Console().Log("Edit color\n"); + showColorModal(item); + // Mark as handled + return true; + } + else if (type == "2DArray") { + Base::Console().Log("Edit 2DArray\n"); + showArray2DModal(propertyName, item); + // Mark as handled + return true; + } + else if (type == "3DArray") { + Base::Console().Log("Edit 3DArray\n"); + showArray3DModal(propertyName, item); + // Mark as handled + return true; + } + } + } + return QStyledItemDelegate::editorEvent(event, model, option, index); +} + +void MaterialDelegate::showColorModal(QStandardItem* item) +{ + QColor currentColor;// = d->col; + currentColor.setRgba(parseColor(item->text())); + QColorDialog* dlg = new QColorDialog(currentColor); + + dlg->setAttribute(Qt::WA_DeleteOnClose); + if (Gui::DialogOptions::dontUseNativeColorDialog()) { + dlg->setOptions(QColorDialog::DontUseNativeDialog); + } + dlg->setOption(QColorDialog::ColorDialogOption::ShowAlphaChannel, false); + + dlg->setCurrentColor(currentColor); + dlg->adjustSize(); + + connect(dlg, &QColorDialog::finished, this, [&](int result) { + if (result == QDialog::Accepted) { + QColor color = dlg->selectedColor(); + if (color.isValid()) { + QString colorText = QString(QString::fromStdString("(%1,%2,%3,%4)")) + .arg(color.red() / 255.0) + .arg(color.green() / 255.0) + .arg(color.blue() / 255.0) + .arg(color.alpha() / 255.0); + item->setText(colorText); + } + } + }); + + dlg->exec(); +} + +void MaterialDelegate::showArray2DModal(const QString& propertyName, QStandardItem* item) +{ + Materials::Material* material = item->data().value(); + Array2D* dlg = new Array2D(propertyName, material); + + dlg->setAttribute(Qt::WA_DeleteOnClose); + + dlg->adjustSize(); + + connect(dlg, &QDialog::finished, this, [&](int result) { + if (result == QDialog::Accepted) { + Base::Console().Log("Accepted\n"); + } + }); + + dlg->exec(); +} + +void MaterialDelegate::showArray3DModal(const QString& propertyName, QStandardItem* item) +{ + Materials::Material* material = item->data().value(); + Array3D* dlg = new Array3D(propertyName, material); + + dlg->setAttribute(Qt::WA_DeleteOnClose); + + dlg->adjustSize(); + + connect(dlg, &QDialog::finished, this, [&](int result) { + if (result == QDialog::Accepted) { + Base::Console().Log("Accepted\n"); + } + }); + + dlg->exec(); +} + +void MaterialDelegate::paint(QPainter* painter, + const QStyleOptionViewItem& option, + const QModelIndex& index) const +{ + // Base::Console().Log("MaterialsEditor::paint()\n"); + if (index.column() != 1) { + QStyledItemDelegate::paint(painter, option, index); + return; + } + + const QStandardItemModel* treeModel = static_cast(index.model()); + + // Check we're not the material model root. This is also used to access the entry columns + auto item = treeModel->itemFromIndex(index); + auto group = item->parent(); + if (!group) { + QStyledItemDelegate::paint(painter, option, index); + return; + } + + int row = index.row(); + + QString propertyName = group->child(row, 0)->text(); + QString propertyType = QString::fromStdString("String"); + if (group->child(row, 2)) { + propertyType = group->child(row, 2)->text(); + } + QString propertyValue = QString::fromStdString(""); + if (group->child(row, 1)) { + propertyValue = group->child(row, 1)->text(); + } + + std::string type = propertyType.toStdString(); + if (type == "Color") { + painter->save(); + + QColor color; + color.setRgba(parseColor(propertyValue)); + int left = option.rect.left() + 5; + int width = option.rect.width() - 10; + if (option.rect.width() > 75) { + left += (option.rect.width() - 75) / 2; + width = 65; + } + painter->fillRect(left, + option.rect.top() + 5, + width, + option.rect.height() - 10, + QBrush(color)); + + painter->restore(); + return; + } + else if (type == "2DArray" || type == "3DArray") { + // painter->save(); + + QImage table(QString::fromStdString(":/icons/table.svg")); + QRect target(option.rect); + if (target.width() > target.height()) { + target.setWidth(target.height()); + } + else { + target.setHeight(target.width()); + } + painter->drawImage(target, table, table.rect()); + + // painter->restore(); + return; + } + + QStyledItemDelegate::paint(painter, option, index); +} + +QSize MaterialDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const +{ + if (index.column() != 1) { + return QStyledItemDelegate::sizeHint(option, index); + } + + const QStandardItemModel* treeModel = static_cast(index.model()); + + // Check we're not the material model root. This is also used to access the entry columns + auto item = treeModel->itemFromIndex(index); + auto group = item->parent(); + if (!group) { + return QStyledItemDelegate::sizeHint(option, index); + } + + int row = index.row(); + + QString propertyType = QString::fromStdString("String"); + if (group->child(row, 2)) { + propertyType = group->child(row, 2)->text(); + } + + std::string type = propertyType.toStdString(); + if (type == "Color") { + return QSize(75, 23);// Standard QPushButton size + } + else if (type == "2DArray" || type == "3DArray") { + return QSize(23, 23); + } + + return QStyledItemDelegate::sizeHint(option, index); +} + +void MaterialDelegate::setEditorData(QWidget* editor, const QModelIndex& index) const +{ + Base::Console().Log("MaterialsEditor::setEditorData()\n"); + QVariant propertyType = editor->property("Type"); + const QStandardItemModel* model = static_cast(index.model()); + QStandardItem* item = model->itemFromIndex(index); + auto group = item->parent(); + if (!group) { + return; + } + + int row = index.row(); + QString propertyName = group->child(row, 0)->text(); + + std::string type = propertyType.toString().toStdString(); + if (type == "File") { + Gui::FileChooser* chooser = static_cast(editor); + item->setText(chooser->fileName()); + } + else if (type == "Quantity") { + Gui::InputField* input = static_cast(editor); + item->setText(input->getQuantityString()); + } + else { + QStyledItemDelegate::setEditorData(editor, index); + } + + // Q_EMIT const_cast(this)->propertyChange(propertyName, item->text()); +} + +void MaterialDelegate::setModelData(QWidget* editor, + QAbstractItemModel* model, + const QModelIndex& index) const +{ + QStyledItemDelegate::setModelData(editor, model, index); + + QStandardItem* item = static_cast(model)->itemFromIndex(index); + auto group = item->parent(); + if (!group) { + return; + } + + int row = index.row(); + QString propertyName = group->child(row, 0)->text(); + Q_EMIT const_cast(this)->propertyChange(propertyName, item->text()); +} + +QWidget* MaterialDelegate::createEditor(QWidget* parent, + const QStyleOptionViewItem&, + const QModelIndex& index) const +{ + Base::Console().Log("MaterialsEditor::createEditor()\n"); + if (index.column() != 1) { + return nullptr; + } + + const QStandardItemModel* treeModel = static_cast(index.model()); + + // Check we're not the material model root. This is also used to access the entry columns + auto item = treeModel->itemFromIndex(index); + auto group = item->parent(); + if (!group) { + return nullptr; + } + + int row = index.row(); + + QString propertyName = group->child(row, 0)->text(); + QString propertyType = QString::fromStdString("String"); + if (group->child(row, 2)) { + propertyType = group->child(row, 2)->text(); + } + + QString propertyValue = QString::fromStdString(""); + if (group->child(row, 1)) { + propertyValue = group->child(row, 1)->text(); + } + + QString propertyUnits = QString::fromStdString(""); + if (group->child(row, 1)) { + propertyUnits = group->child(row, 3)->text(); + } + + QWidget* editor = + createWidget(parent, propertyName, propertyType, propertyValue, propertyUnits); + + return editor; +} + +QWidget* MaterialDelegate::createWidget(QWidget* parent, + const QString& propertyName, + const QString& propertyType, + const QString& propertyValue, + const QString& propertyUnits) const +{ + Q_UNUSED(propertyName); + + QWidget* widget = nullptr; + + std::string type = propertyType.toStdString(); + if (type == "String" || type == "URL" || type == "Vector") { + widget = new Gui::PrefLineEdit(parent); + } + else if ((type == "Integer") || (type == "Int")) { + Gui::UIntSpinBox* spinner = new Gui::UIntSpinBox(parent); + spinner->setMinimum(0); + spinner->setMaximum(UINT_MAX); + spinner->setValue(propertyValue.toUInt()); + widget = spinner; + } + else if (type == "Float") { + Gui::DoubleSpinBox* spinner = new Gui::DoubleSpinBox(parent); + + // the magnetic permeability is the parameter for which many decimals matter + // the most however, even for this, 6 digits are sufficient + spinner->setDecimals(6); + + // for almost all Float parameters of materials a step of 1 would be too large + spinner->setSingleStep(0.1); + + spinner->setMinimum(std::numeric_limits::min()); + spinner->setMaximum(std::numeric_limits::max()); + spinner->setValue(propertyValue.toDouble()); + widget = spinner; + } + else if (type == "Boolean") { + Gui::PrefComboBox* combo = new Gui::PrefComboBox(parent); + combo->insertItem(0, QString::fromStdString("")); + combo->insertItem(1, QString::fromStdString("False")); + combo->insertItem(2, QString::fromStdString("True")); + combo->setCurrentText(propertyValue); + widget = combo; + } + else if (type == "Quantity") { + Gui::InputField* input = new Gui::InputField(); + input->setMinimum(std::numeric_limits::min()); + input->setMaximum(std::numeric_limits::max()); + input->setUnitText(propertyUnits);// TODO: Ensure this exists + input->setPrecision(6); + input->setQuantityString(propertyValue); + + widget = input; + } + else if (type == "File") { + Gui::FileChooser* chooser = new Gui::FileChooser(); + if (propertyValue.length() > 0) { + chooser->setFileName(propertyValue); + } + + widget = chooser; + } + else { + // Default editor + widget = new QLineEdit(parent); + } + + widget->setProperty("Type", propertyType); + widget->setParent(parent); + + return widget; +} + +QRgb MaterialDelegate::parseColor(const QString& color) const +{ + QString trimmed = color; + trimmed.replace(QRegularExpression(QString::fromStdString("\\(([^<]*)\\)")), + QString::fromStdString("\\1")); + QStringList parts = trimmed.split(QString::fromStdString(",")); + if (parts.length() < 4) { + return qRgba(0, 0, 0, 1); + } + int red = parts.at(0).toDouble() * 255; + int green = parts.at(1).toDouble() * 255; + int blue = parts.at(2).toDouble() * 255; + int alpha = parts.at(3).toDouble() * 255; + + return qRgba(red, green, blue, alpha); +} + +#include "moc_MaterialDelegate.cpp" diff --git a/src/Mod/Material/Gui/MaterialDelegate.h b/src/Mod/Material/Gui/MaterialDelegate.h new file mode 100644 index 0000000000..749feecf42 --- /dev/null +++ b/src/Mod/Material/Gui/MaterialDelegate.h @@ -0,0 +1,87 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATGUI_MATERIALDELEGATE_H +#define MATGUI_MATERIALDELEGATE_H + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace fs = boost::filesystem; + +namespace MatGui +{ + +class MaterialDelegate: public QStyledItemDelegate +{ + Q_OBJECT +public: + explicit MaterialDelegate(QObject* parent = nullptr); + virtual ~MaterialDelegate() = default; + + QWidget* createEditor(QWidget* parent, + const QStyleOptionViewItem&, + const QModelIndex& index) const override; + QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const override; + void paint(QPainter* painter, + const QStyleOptionViewItem& option, + const QModelIndex& index) const override; + void setEditorData(QWidget* editor, const QModelIndex& index) const override; + void setModelData(QWidget* editor, + QAbstractItemModel* model, + const QModelIndex& index) const override; + +protected: + bool editorEvent(QEvent* event, + QAbstractItemModel* model, + const QStyleOptionViewItem& option, + const QModelIndex& index) override; + +Q_SIGNALS: + /** Emits this signal when a property has changed */ + void propertyChange(const QString& property, const QString value); + +private: + QWidget* createWidget(QWidget* parent, + const QString& propertyName, + const QString& propertyType, + const QString& propertyValue, + const QString& propertyUnits) const; + QRgb parseColor(const QString& color) const; + void showColorModal(QStandardItem* item); + void showArray2DModal(const QString& propertyName, QStandardItem* item); + void showArray3DModal(const QString& propertyName, QStandardItem* item); +}; + +}// namespace MatGui + +#endif// MATGUI_MATERIALDELEGATE_H diff --git a/src/Mod/Material/Gui/MaterialSave.cpp b/src/Mod/Material/Gui/MaterialSave.cpp new file mode 100644 index 0000000000..82d0f30c5e --- /dev/null +++ b/src/Mod/Material/Gui/MaterialSave.cpp @@ -0,0 +1,314 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" +#ifndef _PreComp_ +#include +#include +#endif + +#include + +#include + +#include "MaterialSave.h" +#include "ui_MaterialSave.h" + +using namespace MatGui; + +/* TRANSLATOR MatGui::MaterialsEditor */ + +MaterialSave::MaterialSave(Materials::Material* material, QWidget* parent) + : QDialog(parent) + , ui(new Ui_MaterialSave) + , _material(material) + , _selectedPath(QString::fromStdString("/")) + , _selectedUUID(QString()) +{ + ui->setupUi(this); + + setLibraries(); + createModelTree(); + showSelectedTree(); + + if (_material->getName().length() > 0) { + ui->editFilename->setText(_material->getName() + QString::fromStdString(".FCMat")); + } + else { + ui->editFilename->setText(QString::fromStdString("NewMaterial.FCMat")); + } + _filename = QString(ui->editFilename->text());// No filename by default + + connect(ui->standardButtons->button(QDialogButtonBox::Ok), + &QPushButton::clicked, + this, + &MaterialSave::onOk); + connect(ui->standardButtons->button(QDialogButtonBox::Cancel), + &QPushButton::clicked, + this, + &MaterialSave::onCancel); + + connect(ui->comboLibrary, + &QComboBox::currentTextChanged, + this, + &MaterialSave::currentTextChanged); + connect(ui->buttonNewFolder, &QPushButton::clicked, this, &MaterialSave::onNewFolder); + connect(ui->editFilename, &QLineEdit::textEdited, this, &MaterialSave::onFilename); + + QItemSelectionModel* selectionModel = ui->treeMaterials->selectionModel(); + connect(selectionModel, + &QItemSelectionModel::selectionChanged, + this, + &MaterialSave::onSelectModel); +} + +/* + * Destroys the object and frees any allocated resources + */ +MaterialSave::~MaterialSave() +{ + // no need to delete child widgets, Qt does it all for us +} + +void MaterialSave::onOk(bool checked) +{ + Q_UNUSED(checked) + + QString name = _filename.remove(QString::fromStdString(".FCMat"), Qt::CaseInsensitive); + Base::Console().Log("name '%s'\n", _filename.toStdString().c_str()); + if (name != _material->getName()) { + _material->setName(name); + _material->setEditStateAlter();// ? Does a name change count? + } + + auto variant = ui->comboLibrary->currentData(); + auto library = variant.value(); + QFileInfo filepath(_selectedPath + QString::fromStdString("/") + name + + QString::fromStdString(".FCMat")); + Base::Console().Log("saveMaterial(library(%s), material(%s), path(%s))\n", + library.getName().toStdString().c_str(), + _material->getName().toStdString().c_str(), + filepath.filePath().toStdString().c_str()); + _manager.saveMaterial(&library, *_material, filepath.filePath()); + + accept(); +} + +void MaterialSave::onCancel(bool checked) +{ + Q_UNUSED(checked) + + reject(); +} + +void MaterialSave::accept() +{ + QDialog::accept(); +} + +void MaterialSave::reject() +{ + QDialog::reject(); +} + +void MaterialSave::setLibraries() +{ + std::list* libraries = _manager.getMaterialLibraries(); + for (Materials::MaterialLibrary* library : *libraries) { + if (!library->isReadOnly()) { + QVariant libraryVariant; + libraryVariant.setValue(*library); + ui->comboLibrary->addItem(library->getName(), libraryVariant); + } + } +} + +void MaterialSave::createModelTree() +{ + auto tree = ui->treeMaterials; + auto model = new QStandardItemModel(); + tree->setModel(model); + tree->setHeaderHidden(true); +} + +void MaterialSave::addExpanded(QTreeView* tree, QStandardItem* parent, QStandardItem* child) +{ + parent->appendRow(child); + tree->setExpanded(child->index(), true); +} + +void MaterialSave::addExpanded(QTreeView* tree, QStandardItemModel* parent, QStandardItem* child) +{ + parent->appendRow(child); + tree->setExpanded(child->index(), true); +} + +void MaterialSave::addMaterials(QStandardItem& parent, + const std::map* modelTree, + const QIcon& folderIcon, + const QIcon& icon) +{ + auto tree = ui->treeMaterials; + for (auto& mat : *modelTree) { + Materials::MaterialTreeNode* nodePtr = mat.second; + if (nodePtr->getType() == Materials::MaterialTreeNode::DataNode) { + const Materials::Material* material = nodePtr->getData(); + QString uuid = material->getUUID(); + Base::Console().Log("Material path '%s'\n", + material->getDirectory().toStdString().c_str()); + + // auto card = new QStandardItem(icon, material->getName()); + auto card = new QStandardItem(icon, mat.first); + // card->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled + // | Qt::ItemIsDropEnabled); + card->setData(QVariant(uuid), Qt::UserRole); + + addExpanded(tree, &parent, card); + } + else { + auto node = new QStandardItem(folderIcon, mat.first); + addExpanded(tree, &parent, node); + // node->setFlags(Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); + const std::map* treeMap = nodePtr->getFolder(); + addMaterials(*node, treeMap, folderIcon, icon); + } + } +} + +void MaterialSave::showSelectedTree() +{ + auto tree = ui->treeMaterials; + auto model = static_cast(tree->model()); + model->clear(); + + if (ui->comboLibrary->count() > 0) { + auto variant = ui->comboLibrary->currentData(); + auto library = variant.value(); + QIcon icon(library.getIconPath()); + QIcon folderIcon(QString::fromStdString(":/icons/folder.svg")); + _libraryName = library.getName(); + _selectedPath = QString::fromStdString("/") + _libraryName; + + auto lib = new QStandardItem(library.getName()); + lib->setFlags(Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); + addExpanded(tree, model, lib); + + std::map* modelTree = + _manager.getMaterialTree(library); + addMaterials(*lib, modelTree, folderIcon, icon); + } + else { + QMessageBox::warning(Gui::getMainWindow(), + QObject::tr("No writeable library"), + QObject::tr("No writeable library")); + } +} + +QString MaterialSave::getPath(const QStandardItem* item) const +{ + QString path = QString::fromStdString("/"); + if (item) { + path = path + item->text(); + if (item->parent()) { + return getPath(item->parent()) + path; + } + } + + return path; +} + +void MaterialSave::onSelectModel(const QItemSelection& selected, const QItemSelection& deselected) +{ + // Q_UNUSED(selected); + Q_UNUSED(deselected); + + _filename = QString(ui->editFilename->text());// No filename by default + QStandardItemModel* model = static_cast(ui->treeMaterials->model()); + QModelIndexList indexes = selected.indexes(); + if (indexes.count() == 0) { + Base::Console().Log("Nothing selected\n"); + _selectedPath = QString::fromStdString("/") + _libraryName; + _selectedUUID = QString(); + Base::Console().Log("\tSelected path '%s'\n", _selectedPath.toStdString().c_str()); + return; + } + for (auto it = indexes.begin(); it != indexes.end(); it++) { + QStandardItem* item = model->itemFromIndex(*it); + Base::Console().Log("%s\n", item->text().toStdString().c_str()); + if (item) { + auto _selected = item->data(Qt::UserRole); + if (_selected.isValid()) { + Base::Console().Log("\tuuid %s\n", _selected.toString().toStdString().c_str()); + _selectedPath = getPath(item->parent()); + _selectedUUID = _selected.toString(); + _filename = item->text(); + } + else { + _selectedPath = getPath(item); + _selectedUUID = QString(); + } + } + } + if (_filename.length() > 0) { + ui->editFilename->setText(_filename); + } + Base::Console().Log("\tSelected path '%s', filename = '%s'\n", + _selectedPath.toStdString().c_str(), + _filename.toStdString().c_str()); +} + +void MaterialSave::currentTextChanged(const QString& value) +{ + Q_UNUSED(value) + + showSelectedTree(); +} + +void MaterialSave::onNewFolder(bool checked) +{ + Q_UNUSED(checked) + + auto tree = ui->treeMaterials; + auto model = static_cast(tree->model()); + auto current = tree->currentIndex(); + if (!current.isValid()) { + current = model->index(0, 0); + } + auto item = model->itemFromIndex(current); + if (item->hasChildren()) { + Base::Console().Log("Add new folder to '%s'\n", item->text().toStdString().c_str()); + QIcon folderIcon(QString::fromStdString(":/icons/folder.svg")); + + auto node = new QStandardItem(folderIcon, QString::fromStdString("New Folder")); + addExpanded(tree, item, node); + // node->setFlags(Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); + } +} + +void MaterialSave::onFilename(const QString& text) +{ + Base::Console().Log("MaterialSave::onFilename('%s')\n", text.toStdString().c_str()); + + _filename = text; +} + +#include "moc_MaterialSave.cpp" diff --git a/src/Mod/Material/Gui/MaterialSave.h b/src/Mod/Material/Gui/MaterialSave.h new file mode 100644 index 0000000000..c515e76a08 --- /dev/null +++ b/src/Mod/Material/Gui/MaterialSave.h @@ -0,0 +1,81 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATGUI_MATERIALSAVE_H +#define MATGUI_MATERIALSAVE_H + +// #include + +#include +#include +#include +#include + +#include + +namespace MatGui +{ + +class Ui_MaterialSave; + +class MaterialSave: public QDialog +{ + Q_OBJECT + +public: + explicit MaterialSave(Materials::Material* material, QWidget* parent = nullptr); + ~MaterialSave() override; + + void setLibraries(); + void createModelTree(); + void addExpanded(QTreeView* tree, QStandardItem* parent, QStandardItem* child); + void addExpanded(QTreeView* tree, QStandardItemModel* parent, QStandardItem* child); + void addMaterials(QStandardItem& parent, + const std::map* modelTree, + const QIcon& folderIcon, + const QIcon& icon); + void showSelectedTree(); + + void onSelectModel(const QItemSelection& selected, const QItemSelection& deselected); + void currentTextChanged(const QString& value); + void onNewFolder(bool checked); + void onFilename(const QString& text); + void onOk(bool checked); + void onCancel(bool checked); + void accept() override; + void reject() override; + +private: + std::unique_ptr ui; + Materials::MaterialManager _manager; + Materials::Material* _material; + QString _selectedPath; + QString _selectedUUID; + QString _libraryName; + QString _filename; + + QString getPath(const QStandardItem* item) const; +}; + +}// namespace MatGui + +#endif// MATGUI_MATERIALSAVE_H diff --git a/src/Mod/Material/Gui/MaterialSave.ui b/src/Mod/Material/Gui/MaterialSave.ui new file mode 100644 index 0000000000..a6a719e5a6 --- /dev/null +++ b/src/Mod/Material/Gui/MaterialSave.ui @@ -0,0 +1,133 @@ + + + MatGui::MaterialSave + + + + 0 + 0 + 654 + 708 + + + + Save Material + + + + + + + + Library: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + New Folder + + + + + + + + + + + Filename: + + + + + + + + 0 + 0 + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + standardButtons + accepted() + MatGui::MaterialSave + accept() + + + 248 + 254 + + + 157 + 274 + + + + + standardButtons + rejected() + MatGui::MaterialSave + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/src/Mod/Material/Gui/MaterialsEditor.cpp b/src/Mod/Material/Gui/MaterialsEditor.cpp new file mode 100644 index 0000000000..96cba4c2cd --- /dev/null +++ b/src/Mod/Material/Gui/MaterialsEditor.cpp @@ -0,0 +1,905 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" +#ifndef _PreComp_ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "MaterialDelegate.h" +#include "MaterialSave.h" +#include "MaterialsEditor.h" +#include "ModelSelect.h" +#include "ui_MaterialsEditor.h" + + +using namespace MatGui; + +/* TRANSLATOR MatGui::MaterialsEditor */ + +MaterialsEditor::MaterialsEditor(QWidget* parent) + : QDialog(parent) + , ui(new Ui_MaterialsEditor) + , _edited(false) +{ + ui->setupUi(this); + + getFavorites(); + getRecents(); + + createMaterialTree(); + createPhysicalTree(); + createAppearanceTree(); + createPreviews(); + + ui->buttonURL->setIcon(QIcon(QString::fromStdString(":/icons/internet-web-browser.svg"))); + + connect(ui->standardButtons->button(QDialogButtonBox::Ok), + &QPushButton::clicked, + this, + &MaterialsEditor::onOk); + connect(ui->standardButtons->button(QDialogButtonBox::Cancel), + &QPushButton::clicked, + this, + &MaterialsEditor::onCancel); + connect(ui->standardButtons->button(QDialogButtonBox::Save), + &QPushButton::clicked, + this, + &MaterialsEditor::onSave); + + connect(ui->buttonURL, &QPushButton::clicked, this, &MaterialsEditor::onURL); + connect(ui->buttonPhysicalAdd, &QPushButton::clicked, this, &MaterialsEditor::onPhysicalAdd); + connect(ui->buttonAppearanceAdd, + &QPushButton::clicked, + this, + &MaterialsEditor::onAppearanceAdd); + connect(ui->buttonFavorite, &QPushButton::clicked, this, &MaterialsEditor::onFavourite); + + QItemSelectionModel* selectionModel = ui->treeMaterials->selectionModel(); + connect(selectionModel, + &QItemSelectionModel::selectionChanged, + this, + &MaterialsEditor::onSelectMaterial); +} + +void MaterialsEditor::getFavorites() +{ + _favorites.clear(); + + auto param = App::GetApplication().GetParameterGroupByPath( + "User parameter:BaseApp/Preferences/Mod/Material/Favorites"); + int count = param->GetInt("Favorites", 0); + for (int i = 0; i < count; i++) { + QString key = QString::fromLatin1("FAV%1").arg(i); + QString uuid = QString::fromStdString(param->GetASCII(key.toStdString().c_str(), "")); + _favorites.push_back(uuid); + } +} + +void MaterialsEditor::saveFavorites() +{ + auto param = App::GetApplication().GetParameterGroupByPath( + "User parameter:BaseApp/Preferences/Mod/Material/Favorites"); + + // Clear out the existing favorites + int count = param->GetInt("Favorites", 0); + for (int i = 0; i < count; i++) { + QString key = QString::fromLatin1("FAV%1").arg(i); + param->RemoveASCII(key.toStdString().c_str()); + } + + // Add the current values + param->SetInt("Favorites", _favorites.size()); + int j = 0; + for (auto favorite : _favorites) { + QString key = QString::fromLatin1("FAV%1").arg(j); + param->SetASCII(key.toStdString().c_str(), favorite.toStdString()); + + j++; + } +} + +void MaterialsEditor::addFavorite(const QString& uuid) +{ + // Ensure it is a material. New, unsaved materials will not be + try { + const Materials::Material& material = _materialManager.getMaterial(uuid); + Q_UNUSED(material) + } + catch (const Materials::MaterialNotFound&) { + return; + } + + if (!isFavorite(uuid)) { + _favorites.push_back(uuid); + saveFavorites(); + refreshMaterialTree(); + } +} + +void MaterialsEditor::removeFavorite(const QString& uuid) +{ + if (isFavorite(uuid)) { + _favorites.remove(uuid); + saveFavorites(); + refreshMaterialTree(); + } +} + +bool MaterialsEditor::isFavorite(const QString& uuid) const +{ + for (auto it : _favorites) { + if (it == uuid) { + return true; + } + } + return false; +} + + +void MaterialsEditor::getRecents() +{ + _recents.clear(); + + auto param = App::GetApplication().GetParameterGroupByPath( + "User parameter:BaseApp/Preferences/Mod/Material/Recent"); + _recentMax = param->GetInt("RecentMax", 5); + int count = param->GetInt("Recent", 0); + for (int i = 0; i < count; i++) { + QString key = QString::fromLatin1("MRU%1").arg(i); + QString uuid = QString::fromStdString(param->GetASCII(key.toStdString().c_str(), "")); + _recents.push_back(uuid); + } +} + +void MaterialsEditor::saveRecents() +{ + auto param = App::GetApplication().GetParameterGroupByPath( + "User parameter:BaseApp/Preferences/Mod/Material/Recent"); + + // Clear out the existing favorites + int count = param->GetInt("Recent", 0); + for (int i = 0; i < count; i++) { + QString key = QString::fromLatin1("MRU%1").arg(i); + param->RemoveASCII(key.toStdString().c_str()); + } + + // Add the current values + int size = _recents.size(); + if (size > _recentMax) { + size = _recentMax; + } + param->SetInt("Recent", size); + int j = 0; + for (auto recent : _recents) { + QString key = QString::fromLatin1("MRU%1").arg(j); + param->SetASCII(key.toStdString().c_str(), recent.toStdString()); + + j++; + if (j >= size) { + break; + } + } +} + +void MaterialsEditor::addRecent(const QString& uuid) +{ + // Ensure it is a material. New, unsaved materials will not be + try { + const Materials::Material& material = _materialManager.getMaterial(uuid); + Q_UNUSED(material) + } + catch (const Materials::MaterialNotFound&) { + return; + } + + // Ensure no duplicates + if (isRecent(uuid)) { + _recents.remove(uuid); + } + + _recents.push_front(uuid); + while (_recents.size() > static_cast(_recentMax)) { + _recents.pop_back(); + } + + saveRecents(); +} + +bool MaterialsEditor::isRecent(const QString& uuid) const +{ + for (auto it : _recents) { + if (it == uuid) { + return true; + } + } + return false; +} + +void MaterialsEditor::propertyChange(const QString& property, const QString value) +{ + Base::Console().Log("MaterialsEditor::propertyChange(%s) = '%s'\n", + property.toStdString().c_str(), + value.toStdString().c_str()); + if (_material.hasPhysicalProperty(property)) { + _material.setPhysicalValue(property, value); + } + else if (_material.hasAppearanceProperty(property)) { + _material.setAppearanceValue(property, value); + updatePreview(); + } + _edited = true; +} + +void MaterialsEditor::onURL(bool checked) +{ + Q_UNUSED(checked) + + Base::Console().Log("URL\n"); + QString url = ui->editSourceURL->text(); + if (url.length() > 0) { + QDesktopServices::openUrl(QUrl(url, QUrl::TolerantMode)); + } +} + +void MaterialsEditor::onPhysicalAdd(bool checked) +{ + Q_UNUSED(checked) + + ModelSelect dialog(this, Materials::ModelManager::ModelFilter_Physical); + dialog.setModal(true); + if (dialog.exec() == QDialog::Accepted) { + QString selected = dialog.selectedModel(); + Base::Console().Log("Selected model '%s'\n", selected.toStdString().c_str()); + _material.addPhysical(selected); + updateMaterial(); + } + else { + Base::Console().Log("No model selected\n"); + } +} + +void MaterialsEditor::onAppearanceAdd(bool checked) +{ + Q_UNUSED(checked) + + ModelSelect dialog(this, Materials::ModelManager::ModelFilter_Appearance); + dialog.setModal(true); + if (dialog.exec() == QDialog::Accepted) { + QString selected = dialog.selectedModel(); + Base::Console().Log("Selected model '%s'\n", selected.toStdString().c_str()); + _material.addAppearance(selected); + updateMaterial(); + } + else { + Base::Console().Log("No model selected\n"); + } +} + +void MaterialsEditor::onFavourite(bool checked) +{ + Q_UNUSED(checked) + + Base::Console().Log("Favorite\n"); + auto selected = _material.getUUID(); + if (isFavorite(selected)) { + removeFavorite(selected); + } + else { + addFavorite(selected); + } +} + +void MaterialsEditor::onOk(bool checked) +{ + Q_UNUSED(checked) + + accept(); +} + +void MaterialsEditor::onCancel(bool checked) +{ + Q_UNUSED(checked) + + reject(); +} + +void MaterialsEditor::onSave(bool checked) +{ + Q_UNUSED(checked) + + saveMaterial(); +} + +void MaterialsEditor::saveMaterial() +{ + MaterialSave dialog(&_material, this); + dialog.setModal(true); + if (dialog.exec() == QDialog::Accepted) { + _material.resetEditState(); + refreshMaterialTree(); + } +} + +void MaterialsEditor::accept() +{ + addRecent(_material.getUUID()); + QDialog::accept(); +} + +void MaterialsEditor::reject() +{ + QDialog::reject(); +} + +// QIcon MaterialsEditor::errorIcon(const QIcon &icon) const { +// auto pixmap = icon.pixmap(); +// } + +void MaterialsEditor::addMaterials(QStandardItem& parent, + const std::map* modelTree, + const QIcon& folderIcon, + const QIcon& icon) +{ + auto tree = ui->treeMaterials; + for (auto& mat : *modelTree) { + Materials::MaterialTreeNode* nodePtr = mat.second; + if (nodePtr->getType() == Materials::MaterialTreeNode::DataNode) { + const Materials::Material* material = nodePtr->getData(); + QString uuid = material->getUUID(); + // Base::Console().Log("Material path '%s'\n", + // material->getDirectory().toStdString().c_str()); + + // auto card = new QStandardItem(icon, material->getName()); + auto card = new QStandardItem(icon, mat.first); + card->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled + | Qt::ItemIsDropEnabled); + card->setData(QVariant(uuid), Qt::UserRole); + + addExpanded(tree, &parent, card); + } + else { + auto node = new QStandardItem(folderIcon, mat.first); + addExpanded(tree, &parent, node); + node->setFlags(Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); + const std::map* treeMap = nodePtr->getFolder(); + addMaterials(*node, treeMap, folderIcon, icon); + } + } +} + +void MaterialsEditor::addExpanded(QTreeView* tree, QStandardItem* parent, QStandardItem* child) +{ + parent->appendRow(child); + tree->setExpanded(child->index(), true); +} + +void MaterialsEditor::addExpanded(QTreeView* tree, QStandardItemModel* parent, QStandardItem* child) +{ + parent->appendRow(child); + tree->setExpanded(child->index(), true); +} + +void MaterialsEditor::createPhysicalTree() +{ + auto tree = ui->treePhysicalProperties; + auto model = new QStandardItemModel(); + tree->setModel(model); + + QStringList headers; + headers.append(QString::fromStdString("Property")); + headers.append(QString::fromStdString("Value")); + headers.append(QString::fromStdString("Type")); + model->setHorizontalHeaderLabels(headers); + + tree->setColumnWidth(0, 250); + tree->setColumnWidth(1, 250); + tree->setColumnHidden(2, true); + + tree->setHeaderHidden(false); + tree->setUniformRowHeights(true); + MaterialDelegate* delegate = new MaterialDelegate(this); + tree->setItemDelegateForColumn(1, delegate); + + connect(delegate, &MaterialDelegate::propertyChange, this, &MaterialsEditor::propertyChange); +} + +void MaterialsEditor::createPreviews() +{ + _rendered = new QSvgWidget(QString::fromStdString(":/icons/preview-rendered.svg")); + _rendered->setMaximumWidth(64); + _rendered->setMinimumHeight(64); + ui->layoutAppearance->addWidget(_rendered); + + _vectored = new QSvgWidget(QString::fromStdString(":/icons/preview-vector.svg")); + _vectored->setMaximumWidth(64); + _vectored->setMinimumHeight(64); + ui->layoutAppearance->addWidget(_vectored); + + updatePreview(); +} + +void MaterialsEditor::createAppearanceTree() +{ + auto tree = ui->treeAppearance; + auto model = new QStandardItemModel(); + tree->setModel(model); + + QStringList headers; + headers.append(QString::fromStdString("Property")); + headers.append(QString::fromStdString("Value")); + headers.append(QString::fromStdString("Type")); + model->setHorizontalHeaderLabels(headers); + + tree->setColumnWidth(0, 250); + tree->setColumnWidth(1, 250); + tree->setColumnHidden(2, true); + + tree->setHeaderHidden(false); + tree->setUniformRowHeights(false); + MaterialDelegate* delegate = new MaterialDelegate(this); + tree->setItemDelegateForColumn(1, delegate); + + connect(delegate, &MaterialDelegate::propertyChange, this, &MaterialsEditor::propertyChange); +} + +void MaterialsEditor::addRecents(QStandardItem* parent) +{ + auto tree = ui->treeMaterials; + for (auto& uuid : _recents) { + try { + const Materials::Material& material = getMaterialManager().getMaterial(uuid); + + QIcon icon = QIcon(material.getLibrary().getIconPath()); + auto card = new QStandardItem(icon, material.getName()); + card->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled + | Qt::ItemIsDropEnabled); + card->setData(QVariant(uuid), Qt::UserRole); + + addExpanded(tree, parent, card); + } + catch (const Materials::MaterialNotFound&) { + } + } +} + +void MaterialsEditor::addFavorites(QStandardItem* parent) +{ + auto tree = ui->treeMaterials; + for (auto& uuid : _favorites) { + try { + const Materials::Material& material = getMaterialManager().getMaterial(uuid); + + QIcon icon = QIcon(material.getLibrary().getIconPath()); + auto card = new QStandardItem(icon, material.getName()); + card->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled + | Qt::ItemIsDropEnabled); + card->setData(QVariant(uuid), Qt::UserRole); + + addExpanded(tree, parent, card); + } + catch (const Materials::MaterialNotFound&) { + } + } +} + +void MaterialsEditor::fillMaterialTree() +{ + auto tree = ui->treeMaterials; + auto model = static_cast(tree->model()); + + auto lib = new QStandardItem(QString::fromStdString("Favorites")); + lib->setFlags(Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); + addExpanded(tree, model, lib); + addFavorites(lib); + + lib = new QStandardItem(QString::fromStdString("Recent")); + lib->setFlags(Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); + addExpanded(tree, model, lib); + addRecents(lib); + + auto libraries = Materials::MaterialManager::getMaterialLibraries(); + for (const auto& library : *libraries) { + lib = new QStandardItem(library->getName()); + lib->setFlags(Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); + addExpanded(tree, model, lib); + + QIcon icon(library->getIconPath()); + QIcon folderIcon(QString::fromStdString(":/icons/folder.svg")); + + std::map* modelTree = + _materialManager.getMaterialTree(*library); + addMaterials(*lib, modelTree, folderIcon, icon); + } +} + +void MaterialsEditor::createMaterialTree() +{ + // Materials::ModelManager &modelManager = getModelManager(); + // Q_UNUSED(modelManager) + + auto tree = ui->treeMaterials; + auto model = new QStandardItemModel(); + tree->setModel(model); + + tree->setHeaderHidden(true); + fillMaterialTree(); +} + +void MaterialsEditor::refreshMaterialTree() +{ + auto tree = ui->treeMaterials; + auto model = static_cast(tree->model()); + model->clear(); + + fillMaterialTree(); +} + +void MaterialsEditor::updatePreview() const +{ + QString diffuseColor; + QString highlightColor; + QString sectionColor; + + if (_material.hasAppearanceProperty(QString::fromStdString("DiffuseColor"))) { + diffuseColor = _material.getAppearanceValueString(QString::fromStdString("DiffuseColor")); + } + else if (_material.hasAppearanceProperty(QString::fromStdString("ViewColor"))) { + diffuseColor = _material.getAppearanceValueString(QString::fromStdString("ViewColor")); + } + else if (_material.hasAppearanceProperty(QString::fromStdString("Color"))) { + diffuseColor = _material.getAppearanceValueString(QString::fromStdString("Color")); + } + + if (_material.hasAppearanceProperty(QString::fromStdString("SpecularColor"))) { + highlightColor = + _material.getAppearanceValueString(QString::fromStdString("SpecularColor")); + } + + if (_material.hasAppearanceProperty(QString::fromStdString("SectionColor"))) { + sectionColor = _material.getAppearanceValueString(QString::fromStdString("SectionColor")); + } + + if ((diffuseColor.length() + highlightColor.length()) > 0) { + auto file = QFile(QString::fromStdString(":/icons/preview-rendered.svg")); + if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { + QString svg = QTextStream(&file).readAll(); + file.close(); + if (diffuseColor.length() > 0) { + svg = + svg.replace(QString::fromStdString("#d3d7cf"), getColorHash(diffuseColor, 255)); + svg = + svg.replace(QString::fromStdString("#555753"), getColorHash(diffuseColor, 125)); + } + if (highlightColor.length() > 0) { + svg = svg.replace(QString::fromStdString("#fffffe"), + getColorHash(highlightColor, 255)); + } + _rendered->load(svg.toUtf8()); + } + } + + if ((diffuseColor.length() + sectionColor.length()) > 0) { + auto file = QFile(QString::fromStdString(":/icons/preview-vector.svg")); + if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { + QString svg = QTextStream(&file).readAll(); + file.close(); + if (diffuseColor.length() > 0) { + svg = + svg.replace(QString::fromStdString("#d3d7cf"), getColorHash(diffuseColor, 255)); + svg = + svg.replace(QString::fromStdString("#555753"), getColorHash(diffuseColor, 125)); + } + if (sectionColor.length() > 0) { + svg = + svg.replace(QString::fromStdString("#ffffff"), getColorHash(sectionColor, 255)); + } + _vectored->load(svg.toUtf8()); + } + } +} + +QString MaterialsEditor::getColorHash(const QString& colorString, int colorRange) const +{ + /* + returns a '#000000' string from a '(0.1,0.2,0.3)' string. Optionally the string + has a fourth value for alpha (transparency) + */ + std::stringstream stream(colorString.toStdString()); + + char c; + stream >> c;// read "(" + double red; + stream >> red; + stream >> c;// "," + double green; + stream >> green; + stream >> c;// "," + double blue; + stream >> blue; + stream >> c;// "," + double alpha = 1.0; + if (c == ',') { + stream >> alpha; + } + + QColor color(static_cast(red * colorRange), + static_cast(green * colorRange), + static_cast(blue * colorRange), + static_cast(alpha * colorRange)); + return color.name(); +} + +void MaterialsEditor::updateMaterialAppearance() +{ + QTreeView* tree = ui->treeAppearance; + QStandardItemModel* treeModel = static_cast(tree->model()); + treeModel->clear(); + + QStringList headers; + headers.append(QString::fromStdString("Property")); + headers.append(QString::fromStdString("Value")); + headers.append(QString::fromStdString("Type")); + treeModel->setHorizontalHeaderLabels(headers); + + tree->setColumnWidth(0, 250); + tree->setColumnWidth(1, 250); + tree->setColumnHidden(2, true); + + const std::vector* models = _material.getAppearanceModels(); + if (models) { + for (auto it = models->begin(); it != models->end(); it++) { + QString uuid = *it; + try { + const Materials::Model& model = getModelManager().getModel(uuid); + QString name = model.getName(); + + auto modelRoot = new QStandardItem(name); + modelRoot->setFlags(Qt::ItemIsEnabled | Qt::ItemIsDragEnabled + | Qt::ItemIsDropEnabled); + addExpanded(tree, treeModel, modelRoot); + for (auto itp = model.begin(); itp != model.end(); itp++) { + QList items; + + QString key = itp->first; + auto propertyItem = new QStandardItem(key); + propertyItem->setToolTip(itp->second.getDescription()); + items.append(propertyItem); + + auto valueItem = new QStandardItem(_material.getAppearanceValueString(key)); + valueItem->setToolTip(itp->second.getDescription()); + QVariant variant; + variant.setValue(&_material); + valueItem->setData(variant); + items.append(valueItem); + + auto typeItem = new QStandardItem(itp->second.getPropertyType()); + items.append(typeItem); + + auto unitsItem = new QStandardItem(itp->second.getUnits()); + items.append(unitsItem); + + modelRoot->appendRow(items); + tree->setExpanded(modelRoot->index(), true); + } + } + catch (Materials::ModelNotFound const&) { + } + } + } +} + +void MaterialsEditor::updateMaterialProperties() +{ + QTreeView* tree = ui->treePhysicalProperties; + QStandardItemModel* treeModel = static_cast(tree->model()); + treeModel->clear(); + + QStringList headers; + headers.append(QString::fromStdString("Property")); + headers.append(QString::fromStdString("Value")); + headers.append(QString::fromStdString("Type")); + headers.append(QString::fromStdString("Units")); + treeModel->setHorizontalHeaderLabels(headers); + + tree->setColumnWidth(0, 250); + tree->setColumnWidth(1, 250); + tree->setColumnHidden(2, true); + tree->setColumnHidden(3, true); + + const std::vector* models = _material.getPhysicalModels(); + if (models) { + for (auto it = models->begin(); it != models->end(); it++) { + QString uuid = *it; + try { + const Materials::Model& model = getModelManager().getModel(uuid); + QString name = model.getName(); + + auto modelRoot = new QStandardItem(name); + modelRoot->setFlags(Qt::ItemIsEnabled | Qt::ItemIsDragEnabled + | Qt::ItemIsDropEnabled); + addExpanded(tree, treeModel, modelRoot); + for (auto itp = model.begin(); itp != model.end(); itp++) { + QList items; + + QString key = itp->first; + Materials::ModelProperty modelProperty = + static_cast(itp->second); + auto propertyItem = new QStandardItem(key); + propertyItem->setToolTip(modelProperty.getDescription()); + items.append(propertyItem); + + auto valueItem = new QStandardItem(_material.getPhysicalValueString(key)); + valueItem->setToolTip(modelProperty.getDescription()); + QVariant variant; + variant.setValue(&_material); + valueItem->setData(variant); + items.append(valueItem); + + auto typeItem = new QStandardItem(modelProperty.getPropertyType()); + items.append(typeItem); + + auto unitsItem = new QStandardItem(modelProperty.getUnits()); + items.append(unitsItem); + + // addExpanded(tree, modelRoot, propertyItem); + modelRoot->appendRow(items); + tree->setExpanded(modelRoot->index(), true); + } + } + catch (Materials::ModelNotFound const&) { + } + } + } +} + +void MaterialsEditor::updateMaterial() +{ + // Update the general information + ui->editName->setText(_material.getName()); + ui->editAuthorLicense->setText(_material.getAuthorAndLicense()); + // ui->editParent->setText(_material.getName()); + ui->editSourceURL->setText(_material.getURL()); + ui->editSourceReference->setText(_material.getReference()); + // ui->editTags->setText(_material.getName()); + ui->editDescription->setText(_material.getDescription()); + + updateMaterialProperties(); + updateMaterialAppearance(); + + updatePreview(); +} + +void MaterialsEditor::onSelectMaterial(const QItemSelection& selected, + const QItemSelection& deselected) +{ + Q_UNUSED(deselected); + + // Get the UUID before changing the underlying data model + QString uuid; + QStandardItemModel* model = static_cast(ui->treeMaterials->model()); + QModelIndexList indexes = selected.indexes(); + for (auto it = indexes.begin(); it != indexes.end(); it++) { + QStandardItem* item = model->itemFromIndex(*it); + + Base::Console().Log("%s\n", item->text().toStdString().c_str()); + if (item) { + uuid = item->data(Qt::UserRole).toString(); + break; + } + } + + if (uuid.isEmpty() || uuid == _material.getUUID()) { + Base::Console().Log("*** Unchanged material '%s'\n", uuid.toStdString().c_str()); + return; + } + + // Ensure data is saved (or discarded) before changing materials + if (_material.getEditState() != Materials::Material::ModelEdit_None) { + // Prompt the user to save or discard changes + Base::Console().Log("*** Material edited!!!\n"); + int res = confirmSave(this); + if (res == QMessageBox::Cancel) { + return; + } + } + + // Get the selected material + try { + _material = getMaterialManager().getMaterial(uuid); + } + catch (Materials::ModelNotFound const&) { + Base::Console().Log("*** Unable to load material '%s'\n", uuid.toStdString().c_str()); + Materials::Material empty; + _material = empty; + } + + updateMaterial(); + _material.resetEditState(); +} + +int MaterialsEditor::confirmSave(QWidget* parent) +{ + QMessageBox box(parent ? parent : this); + box.setIcon(QMessageBox::Question); + box.setWindowTitle(QObject::tr("Unsaved Material")); + box.setText(QObject::tr("Do you want to save your changes to the material before closing?")); + + box.setInformativeText(QObject::tr("If you don't save, your changes will be lost.")); + box.setStandardButtons(QMessageBox::Discard | QMessageBox::Cancel | QMessageBox::Save); + box.setDefaultButton(QMessageBox::Save); + box.setEscapeButton(QMessageBox::Cancel); + + // add shortcuts + QAbstractButton* saveBtn = box.button(QMessageBox::Save); + if (saveBtn->shortcut().isEmpty()) { + QString text = saveBtn->text(); + text.prepend(QLatin1Char('&')); + saveBtn->setShortcut(QKeySequence::mnemonic(text)); + } + + QAbstractButton* discardBtn = box.button(QMessageBox::Discard); + if (discardBtn->shortcut().isEmpty()) { + QString text = discardBtn->text(); + text.prepend(QLatin1Char('&')); + discardBtn->setShortcut(QKeySequence::mnemonic(text)); + } + + int res = QMessageBox::Cancel; + box.adjustSize();// Silence warnings from Qt on Windows + switch (box.exec()) { + case QMessageBox::Save: + saveMaterial(); + res = QMessageBox::Save; + break; + case QMessageBox::Discard: + res = QMessageBox::Discard; + break; + } + + return res; +} + +#include "moc_MaterialsEditor.cpp" diff --git a/src/Mod/Material/Gui/MaterialsEditor.h b/src/Mod/Material/Gui/MaterialsEditor.h new file mode 100644 index 0000000000..0776027c5c --- /dev/null +++ b/src/Mod/Material/Gui/MaterialsEditor.h @@ -0,0 +1,131 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATGUI_MATERIALSEDITOR_H +#define MATGUI_MATERIALSEDITOR_H + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace fs = boost::filesystem; + +namespace MatGui +{ + +class Ui_MaterialsEditor; + +class MaterialsEditor: public QDialog +{ + Q_OBJECT + +public: + explicit MaterialsEditor(QWidget* parent = nullptr); + ~MaterialsEditor() override = default; + + void propertyChange(const QString& property, const QString value); + void onFavourite(bool checked); + void onURL(bool checked); + void onPhysicalAdd(bool checked); + void onAppearanceAdd(bool checked); + void onOk(bool checked); + void onCancel(bool checked); + void onSave(bool checked); + void accept() override; + void reject() override; + + Materials::MaterialManager& getMaterialManager() + { + return _materialManager; + } + Materials::ModelManager& getModelManager() + { + return _modelManager; + } + + void updateMaterialAppearance(); + void updateMaterialProperties(); + void updateMaterial(); + void onSelectMaterial(const QItemSelection& selected, const QItemSelection& deselected); + +protected: + int confirmSave(QWidget* parent); + void saveMaterial(); + +private: + std::unique_ptr ui; + Materials::MaterialManager _materialManager; + Materials::ModelManager _modelManager; + Materials::Material _material; + QSvgWidget* _rendered; + QSvgWidget* _vectored; + bool _edited; + std::list _favorites; + std::list _recents; + int _recentMax; + + void getFavorites(); + void saveFavorites(); + void addFavorite(const QString& uuid); + void removeFavorite(const QString& uuid); + bool isFavorite(const QString& uuid) const; + + void getRecents(); + void saveRecents(); + void addRecent(const QString& uuid); + bool isRecent(const QString& uuid) const; + + void updatePreview() const; + QString getColorHash(const QString& colorString, int colorRange = 255) const; + + void addExpanded(QTreeView* tree, QStandardItem* parent, QStandardItem* child); + void addExpanded(QTreeView* tree, QStandardItemModel* parent, QStandardItem* child); + void addRecents(QStandardItem* parent); + void addFavorites(QStandardItem* parent); + void createPreviews(); + void createAppearanceTree(); + void createPhysicalTree(); + void createMaterialTree(); + void fillMaterialTree(); + void refreshMaterialTree(); + void addMaterials(QStandardItem& parent, + const std::map* modelTree, + const QIcon& folderIcon, + const QIcon& icon); + bool isMaterial(const fs::path& p) const + { + return Materials::MaterialManager::isMaterial(p); + } +}; + +}// namespace MatGui + +#endif// MATGUI_MATERIALSEDITOR_H diff --git a/src/Mod/Material/Gui/MaterialsEditor.ui b/src/Mod/Material/Gui/MaterialsEditor.ui new file mode 100644 index 0000000000..8533439e88 --- /dev/null +++ b/src/Mod/Material/Gui/MaterialsEditor.ui @@ -0,0 +1,288 @@ + + + MatGui::MaterialsEditor + + + + 0 + 0 + 835 + 542 + + + + + 0 + 0 + + + + Materials + + + false + + + + + + Qt::Horizontal + + + + QAbstractItemView::SelectItems + + + true + + + + + 0 + + + + + 0 + 0 + + + + General + + + + + + QLayout::SetMinAndMaxSize + + + 7 + + + 7 + + + 7 + + + 7 + + + + + + + + Description + + + + + + + + + + Name + + + + + + + Source Reference + + + + + + + Parent + + + + + + + + + + Author and License + + + + + + + + + + Tags + + + + + + + Source URL + + + + + + + + + + + + + + + + + + + 22 + 22 + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + * + + + + + + + + + + Properties + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + Appearance + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Save + + + + + + + + diff --git a/src/Mod/Material/Gui/ModelSelect.cpp b/src/Mod/Material/Gui/ModelSelect.cpp new file mode 100644 index 0000000000..39b6d9c348 --- /dev/null +++ b/src/Mod/Material/Gui/ModelSelect.cpp @@ -0,0 +1,545 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" +#ifndef _PreComp_ +#include +#include +#include +#include +#endif + +#include +#include +#include +#include +#include + +#include + +#include "ModelSelect.h" +#include "ui_ModelSelect.h" + + +using namespace MatGui; + +/* TRANSLATOR MatGui::ModelSelect */ + +ModelSelect::ModelSelect(QWidget* parent, Materials::ModelManager::ModelFilter filter) + : QDialog(parent) + , _filter(filter) + , ui(new Ui_ModelSelect) +{ + ui->setupUi(this); + + getFavorites(); + getRecents(); + + createModelTree(); + createModelProperties(); + + ui->buttonURL->setIcon(QIcon(QString::fromStdString(":/icons/internet-web-browser.svg"))); + ui->buttonDOI->setIcon(QIcon(QString::fromStdString(":/icons/internet-web-browser.svg"))); + + connect(ui->standardButtons, &QDialogButtonBox::accepted, this, &ModelSelect::accept); + connect(ui->standardButtons, &QDialogButtonBox::rejected, this, &ModelSelect::reject); + + QItemSelectionModel* selectionModel = ui->treeModels->selectionModel(); + connect(selectionModel, + &QItemSelectionModel::selectionChanged, + this, + &ModelSelect::onSelectModel); + + connect(ui->buttonURL, &QPushButton::clicked, this, &ModelSelect::onURL); + connect(ui->buttonDOI, &QPushButton::clicked, this, &ModelSelect::onDOI); + connect(ui->buttonFavorite, &QPushButton::clicked, this, &ModelSelect::onFavourite); + + ui->standardButtons->button(QDialogButtonBox::Ok)->setEnabled(false); + ui->buttonFavorite->setEnabled(false); +} + +void ModelSelect::getFavorites() +{ + _favorites.clear(); + + auto param = App::GetApplication().GetParameterGroupByPath( + "User parameter:BaseApp/Preferences/Mod/Material/Models/Favorites"); + int count = param->GetInt("Favorites", 0); + for (int i = 0; i < count; i++) { + QString key = QString::fromLatin1("FAV%1").arg(i); + QString uuid = QString::fromStdString(param->GetASCII(key.toStdString().c_str(), "")); + _favorites.push_back(uuid); + } +} + +void ModelSelect::saveFavorites() +{ + auto param = App::GetApplication().GetParameterGroupByPath( + "User parameter:BaseApp/Preferences/Mod/Material/Models/Favorites"); + + // Clear out the existing favorites + int count = param->GetInt("Favorites", 0); + for (int i = 0; i < count; i++) { + QString key = QString::fromLatin1("FAV%1").arg(i); + param->RemoveASCII(key.toStdString().c_str()); + } + + // Add the current values + param->SetInt("Favorites", _favorites.size()); + int j = 0; + for (auto favorite : _favorites) { + QString key = QString::fromLatin1("FAV%1").arg(j); + param->SetASCII(key.toStdString().c_str(), favorite.toStdString()); + + j++; + } +} + +void ModelSelect::addFavorite(const QString& uuid) +{ + if (!isFavorite(uuid)) { + _favorites.push_back(uuid); + saveFavorites(); + refreshModelTree(); + } +} + +void ModelSelect::removeFavorite(const QString& uuid) +{ + if (isFavorite(uuid)) { + _favorites.remove(uuid); + saveFavorites(); + refreshModelTree(); + } +} + +bool ModelSelect::isFavorite(const QString& uuid) const +{ + for (auto it : _favorites) { + if (it == uuid) { + return true; + } + } + return false; +} + + +void ModelSelect::getRecents() +{ + _recents.clear(); + + auto param = App::GetApplication().GetParameterGroupByPath( + "User parameter:BaseApp/Preferences/Mod/Material/Models/Recent"); + _recentMax = param->GetInt("RecentMax", 5); + int count = param->GetInt("Recent", 0); + for (int i = 0; i < count; i++) { + QString key = QString::fromLatin1("MRU%1").arg(i); + QString uuid = QString::fromStdString(param->GetASCII(key.toStdString().c_str(), "")); + _recents.push_back(uuid); + } +} + +void ModelSelect::saveRecents() +{ + auto param = App::GetApplication().GetParameterGroupByPath( + "User parameter:BaseApp/Preferences/Mod/Material/Models/Recent"); + + // Clear out the existing favorites + int count = param->GetInt("Recent", 0); + for (int i = 0; i < count; i++) { + QString key = QString::fromLatin1("MRU%1").arg(i); + param->RemoveASCII(key.toStdString().c_str()); + } + + // Add the current values + int size = _recents.size(); + if (size > _recentMax) { + size = _recentMax; + } + param->SetInt("Recent", size); + int j = 0; + for (auto recent : _recents) { + QString key = QString::fromLatin1("MRU%1").arg(j); + param->SetASCII(key.toStdString().c_str(), recent.toStdString()); + + j++; + if (j >= size) { + break; + } + } +} + +void ModelSelect::addRecent(const QString& uuid) +{ + // Ensure no duplicates + if (isRecent(uuid)) { + _recents.remove(uuid); + } + + _recents.push_front(uuid); + while (_recents.size() > static_cast(_recentMax)) { + _recents.pop_back(); + } + + saveRecents(); +} + +bool ModelSelect::isRecent(const QString& uuid) const +{ + for (auto it : _recents) { + if (it == uuid) { + return true; + } + } + return false; +} + +/* + * Destroys the object and frees any allocated resources + */ +ModelSelect::~ModelSelect() +{ + // no need to delete child widgets, Qt does it all for us +} + +void ModelSelect::addExpanded(QTreeView* tree, QStandardItem* parent, QStandardItem* child) +{ + parent->appendRow(child); + tree->setExpanded(child->index(), true); +} + +void ModelSelect::addExpanded(QTreeView* tree, QStandardItemModel* parent, QStandardItem* child) +{ + parent->appendRow(child); + tree->setExpanded(child->index(), true); +} + +void ModelSelect::addModels(QStandardItem& parent, + const std::map* modelTree, + const QIcon& icon) +{ + auto tree = ui->treeModels; + for (auto& mod : *modelTree) { + Materials::ModelTreeNode* nodePtr = mod.second; + if (nodePtr->getType() == Materials::ModelTreeNode::DataNode) { + const Materials::Model* model = nodePtr->getData(); + QString uuid = model->getUUID(); + + auto card = new QStandardItem(icon, model->getName()); + card->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled + | Qt::ItemIsDropEnabled); + card->setData(QVariant(uuid), Qt::UserRole); + + addExpanded(tree, &parent, card); + } + else { + auto node = new QStandardItem(mod.first); + addExpanded(tree, &parent, node); + node->setFlags(Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); + const std::map* treeMap = nodePtr->getFolder(); + addModels(*node, treeMap, icon); + } + } +} + +void ModelSelect::addRecents(QStandardItem* parent) +{ + auto tree = ui->treeModels; + for (auto& uuid : _recents) { + try { + const Materials::Model& model = getModelManager().getModel(uuid); + + if (getModelManager().passFilter(_filter, model.getType())) { + QIcon icon = QIcon(model.getLibrary().getIconPath()); + auto card = new QStandardItem(icon, model.getName()); + card->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled + | Qt::ItemIsDropEnabled); + card->setData(QVariant(uuid), Qt::UserRole); + + addExpanded(tree, parent, card); + } + } + catch (const Materials::ModelNotFound&) { + } + } +} + +void ModelSelect::addFavorites(QStandardItem* parent) +{ + auto tree = ui->treeModels; + for (auto& uuid : _favorites) { + try { + const Materials::Model& model = getModelManager().getModel(uuid); + + if (getModelManager().passFilter(_filter, model.getType())) { + QIcon icon = QIcon(model.getLibrary().getIconPath()); + auto card = new QStandardItem(icon, model.getName()); + card->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled + | Qt::ItemIsDropEnabled); + card->setData(QVariant(uuid), Qt::UserRole); + + addExpanded(tree, parent, card); + } + } + catch (const Materials::ModelNotFound&) { + } + } +} + +void ModelSelect::createModelTree() +{ + // Materials::ModelManager modelManager; + + auto tree = ui->treeModels; + auto model = new QStandardItemModel(); + tree->setModel(model); + tree->setHeaderHidden(true); + + fillTree(); +} + +void ModelSelect::refreshModelTree() +{ + auto tree = ui->treeModels; + auto model = static_cast(tree->model()); + model->clear(); + + fillTree(); +} + +void ModelSelect::fillTree() +{ + // Materials::ModelManager modelManager; + + auto tree = ui->treeModels; + auto model = static_cast(tree->model()); + + auto lib = new QStandardItem(QString::fromStdString("Favorites")); + lib->setFlags(Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); + addExpanded(tree, model, lib); + addFavorites(lib); + + lib = new QStandardItem(QString::fromStdString("Recent")); + lib->setFlags(Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); + addExpanded(tree, model, lib); + addRecents(lib); + + std::list* libraries = getModelManager().getModelLibraries(); + for (Materials::ModelLibrary* library : *libraries) { + lib = new QStandardItem(library->getName()); + lib->setFlags(Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); + addExpanded(tree, model, lib); + + // auto path = library->getDirectoryPath(); + std::map* modelTree = + getModelManager().getModelTree(*library, _filter); + // delete modelTree; + addModels(*lib, modelTree, QIcon(library->getIconPath())); + } +} + +void ModelSelect::setHeaders(QStandardItemModel* model) +{ + QStringList headers; + headers.append(QString::fromStdString("Inherited")); + headers.append(QString::fromStdString("Property")); + headers.append(QString::fromStdString("Units")); + headers.append(QString::fromStdString("Description")); + headers.append(QString::fromStdString("URL")); + + model->setHorizontalHeaderLabels(headers); +} + +void ModelSelect::setColumnWidths(QTableView* table) +{ + table->setColumnWidth(0, 75); + table->setColumnWidth(1, 200); + table->setColumnWidth(2, 200); + table->setColumnWidth(3, 200); + table->setColumnWidth(4, 200); +} + +void ModelSelect::createModelProperties() +{ + auto table = ui->tableProperties; + auto model = new QStandardItemModel(); + table->setModel(model); + table->setEditTriggers(QAbstractItemView::NoEditTriggers); + + setHeaders(model); + setColumnWidths(table); + + // table->setHeaderHidden(false); + // table->setUniformRowHeights(true); + // table->setItemDelegate(new MaterialDelegate(this)); +} + +void ModelSelect::updateModelProperties(const Materials::Model& model) +{ + QTableView* table = ui->tableProperties; + QStandardItemModel* tableModel = static_cast(table->model()); + tableModel->clear(); + + setHeaders(tableModel); + setColumnWidths(table); + + for (auto itp = model.begin(); itp != model.end(); itp++) { + QList items; + + QString key = itp->first; + const Materials::ModelProperty modelProperty = + static_cast(itp->second); + + auto inherited = + new QStandardItem(QString::fromStdString(modelProperty.isInherited() ? "*" : "")); + // inherited->setToolTip(QString::fromStdString(modelProperty.getDescription())); + items.append(inherited); + + auto propertyItem = new QStandardItem(key); + items.append(propertyItem); + + auto unitsItem = new QStandardItem(modelProperty.getUnits()); + items.append(unitsItem); + + auto descriptionItem = new QStandardItem(modelProperty.getDescription()); + items.append(descriptionItem); + + auto urlItem = new QStandardItem(modelProperty.getURL()); + items.append(urlItem); + + // addExpanded(tree, modelRoot, propertyItem); + tableModel->appendRow(items); + } +} + +void ModelSelect::updateMaterialModel(const QString& uuid) +{ + Materials::Model model = getModelManager().getModel(uuid); + + // Update the general information + ui->editName->setText(model.getName()); + ui->editURL->setText(model.getURL()); + ui->editDOI->setText(model.getDOI()); + ui->editDescription->setText(model.getDescription()); + + if (model.getType() == Materials::Model::ModelType_Physical) { + ui->tabWidget->setTabText(1, QString::fromStdString("Properties")); + } + else { + ui->tabWidget->setTabText(1, QString::fromStdString("Appearance")); + } + updateModelProperties(model); +} + +void ModelSelect::clearMaterialModel(void) +{ + // Update the general information + ui->editName->setText(QString::fromStdString("")); + ui->editURL->setText(QString::fromStdString("")); + ui->editDOI->setText(QString::fromStdString("")); + ui->editDescription->setText(QString::fromStdString("")); + + ui->tabWidget->setTabText(1, QString::fromStdString("Properties")); + + QTableView* table = ui->tableProperties; + QStandardItemModel* tableModel = static_cast(table->model()); + tableModel->clear(); + + setHeaders(tableModel); + setColumnWidths(table); +} + +void ModelSelect::onSelectModel(const QItemSelection& selected, const QItemSelection& deselected) +{ + Q_UNUSED(deselected); + + QStandardItemModel* model = static_cast(ui->treeModels->model()); + QModelIndexList indexes = selected.indexes(); + for (auto it = indexes.begin(); it != indexes.end(); it++) { + QStandardItem* item = model->itemFromIndex(*it); + Base::Console().Log("%s\n", item->text().toStdString().c_str()); + if (item) { + try { + _selected = item->data(Qt::UserRole).toString(); + Base::Console().Log("\t%s\n", _selected.toStdString().c_str()); + updateMaterialModel(_selected); + ui->standardButtons->button(QDialogButtonBox::Ok)->setEnabled(true); + ui->buttonFavorite->setEnabled(true); + } + catch (const std::exception& e) { + _selected = QString::fromStdString(""); + Base::Console().Log("Error %s\n", e.what()); + clearMaterialModel(); + ui->standardButtons->button(QDialogButtonBox::Ok)->setEnabled(false); + ui->buttonFavorite->setEnabled(false); + } + } + } +} + +void ModelSelect::onURL(bool checked) +{ + Q_UNUSED(checked) + + Base::Console().Log("URL\n"); + QString url = ui->editURL->text(); + if (url.length() > 0) { + QDesktopServices::openUrl(QUrl(url, QUrl::TolerantMode)); + } +} + +void ModelSelect::onDOI(bool checked) +{ + Q_UNUSED(checked) + + Base::Console().Log("DOI\n"); + QString url = QString::fromStdString("https://doi.org/") + ui->editDOI->text(); + if (url.length() > 0) { + QDesktopServices::openUrl(QUrl(url, QUrl::TolerantMode)); + } +} + +void ModelSelect::onFavourite(bool checked) +{ + Q_UNUSED(checked) + + Base::Console().Log("Favorite\n"); + if (isFavorite(_selected)) { + removeFavorite(_selected); + } + else { + addFavorite(_selected); + } +} + +void ModelSelect::accept() +{ + addRecent(_selected); + QDialog::accept(); +} + +void ModelSelect::reject() +{ + QDialog::reject(); +} + +#include "moc_ModelSelect.cpp" diff --git a/src/Mod/Material/Gui/ModelSelect.h b/src/Mod/Material/Gui/ModelSelect.h new file mode 100644 index 0000000000..444f4d3b92 --- /dev/null +++ b/src/Mod/Material/Gui/ModelSelect.h @@ -0,0 +1,109 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATGUI_MODELSELECT_H +#define MATGUI_MODELSELECT_H + +#include + +#include +#include +#include +#include +#include + +#include + +namespace fs = boost::filesystem; + +namespace MatGui +{ + +class Ui_ModelSelect; + +class ModelSelect: public QDialog +{ + Q_OBJECT + +public: + explicit ModelSelect( + QWidget* parent = nullptr, + Materials::ModelManager::ModelFilter filter = Materials::ModelManager::ModelFilter_None); + ~ModelSelect() override; + + void onURL(bool checked); + void onDOI(bool checked); + void onFavourite(bool checked); + void onSelectModel(const QItemSelection& selected, const QItemSelection& deselected); + const QString& selectedModel() const + { + return _selected; + } + void accept() override; + void reject() override; + +private: + void getFavorites(); + void saveFavorites(); + void addFavorite(const QString& uuid); + void removeFavorite(const QString& uuid); + bool isFavorite(const QString& uuid) const; + + void getRecents(); + void saveRecents(); + void addRecent(const QString& uuid); + bool isRecent(const QString& uuid) const; + + void addExpanded(QTreeView* tree, QStandardItem* parent, QStandardItem* child); + void addExpanded(QTreeView* tree, QStandardItemModel* parent, QStandardItem* child); + void addRecents(QStandardItem* parent); + void addFavorites(QStandardItem* parent); + void addModels(QStandardItem& parent, + const std::map* modelTree, + const QIcon& icon); + void updateMaterialModel(const QString& uuid); + void clearMaterialModel(void); + void createModelTree(); + void refreshModelTree(); + void fillTree(); + + void setHeaders(QStandardItemModel* model); + void setColumnWidths(QTableView* table); + void updateModelProperties(const Materials::Model& model); + void createModelProperties(); + Materials::ModelManager& getModelManager() + { + return _modelManager; + } + + Materials::ModelManager::ModelFilter _filter; + std::unique_ptr ui; + Materials::ModelManager _modelManager; + QString _selected; + std::list _favorites; + std::list _recents; + int _recentMax; +}; + +}// namespace MatGui + +#endif// MATGUI_MODELSELECT_H diff --git a/src/Mod/Material/Gui/ModelSelect.ui b/src/Mod/Material/Gui/ModelSelect.ui new file mode 100644 index 0000000000..5debe4e047 --- /dev/null +++ b/src/Mod/Material/Gui/ModelSelect.ui @@ -0,0 +1,197 @@ + + + MatGui::ModelSelect + + + + 0 + 0 + 705 + 489 + + + + Material Models + + + + + + Qt::Horizontal + + + + + 0 + + + + + 0 + 0 + + + + + 365 + 409 + + + + General + + + + + + + + URL + + + + + + + Description + + + + + + + DOI + + + + + + + true + + + + + + + true + + + true + + + + + + + Name + + + + + + + + + true + + + + + + + + 22 + 22 + + + + + + + + + + + + + + + true + + + + + + + + 22 + 22 + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Add to favorites + + + * + + + + + + + + + + Properties + + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + diff --git a/src/Mod/Material/Gui/PreCompiled.cpp b/src/Mod/Material/Gui/PreCompiled.cpp new file mode 100644 index 0000000000..c2507f9804 --- /dev/null +++ b/src/Mod/Material/Gui/PreCompiled.cpp @@ -0,0 +1,24 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#include "PreCompiled.h" diff --git a/src/Mod/Material/Gui/PreCompiled.h b/src/Mod/Material/Gui/PreCompiled.h new file mode 100644 index 0000000000..8d8aeec82a --- /dev/null +++ b/src/Mod/Material/Gui/PreCompiled.h @@ -0,0 +1,77 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#ifndef MATGUI_PRECOMPILED_H +#define MATGUI_PRECOMPILED_H + +#include + +#include + +// point at which warnings of overly long specifiers disabled (needed for VC6) +#ifdef _MSC_VER +#pragma warning(disable : 4251) +#pragma warning(disable : 4503) +#pragma warning(disable : 4786)// specifier longer then 255 chars +#pragma warning(disable : 4273) +#endif + +#ifdef FC_OS_WIN32 +#ifndef NOMINMAX +#define NOMINMAX +#endif +#include +#endif + +#ifdef _PreComp_ + +// standard +#include +#include + +// STL +#include +#include +#include +#include +#include + +// OpenCasCade +// #include + +// Boost +#include +#include + +// Qt Toolkit +#ifndef __QtAll__ +#include +#endif + +// // Inventor includes OpenGL +// #ifndef __InventorAll__ +// # include +// #endif + +#endif//_PreComp_ + +#endif// MATGUI_PRECOMPILED_H diff --git a/src/Mod/Material/Gui/Resources/Material.qrc b/src/Mod/Material/Gui/Resources/Material.qrc new file mode 100644 index 0000000000..467818d552 --- /dev/null +++ b/src/Mod/Material/Gui/Resources/Material.qrc @@ -0,0 +1,10 @@ + + + icons/MaterialWorkbench.svg + icons/Materials_Edit.svg + icons/preferences-material.svg + icons/preview-rendered.svg + icons/preview-vector.svg + icons/table.svg + + diff --git a/src/Mod/Material/Gui/Resources/icons/MaterialWorkbench.svg b/src/Mod/Material/Gui/Resources/icons/MaterialWorkbench.svg new file mode 100644 index 0000000000..a2937dbb71 --- /dev/null +++ b/src/Mod/Material/Gui/Resources/icons/MaterialWorkbench.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + [Yorik van Havre] + + + Arch_Material + 2015-04-15 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Arch/Resources/icons/Arch_Material.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + + + + + + + + + + + diff --git a/src/Mod/Material/Gui/Resources/icons/Materials_Edit.svg b/src/Mod/Material/Gui/Resources/icons/Materials_Edit.svg new file mode 100644 index 0000000000..a2937dbb71 --- /dev/null +++ b/src/Mod/Material/Gui/Resources/icons/Materials_Edit.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + [Yorik van Havre] + + + Arch_Material + 2015-04-15 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Arch/Resources/icons/Arch_Material.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + + + + + + + + + + + diff --git a/src/Mod/Material/Gui/Resources/icons/preferences-material.svg b/src/Mod/Material/Gui/Resources/icons/preferences-material.svg new file mode 100644 index 0000000000..a2937dbb71 --- /dev/null +++ b/src/Mod/Material/Gui/Resources/icons/preferences-material.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + [Yorik van Havre] + + + Arch_Material + 2015-04-15 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Arch/Resources/icons/Arch_Material.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + + + + + + + + + + + diff --git a/src/Mod/Material/Gui/Resources/icons/preview-rendered.svg b/src/Mod/Material/Gui/Resources/icons/preview-rendered.svg new file mode 100644 index 0000000000..415ceccce3 --- /dev/null +++ b/src/Mod/Material/Gui/Resources/icons/preview-rendered.svg @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + $committer + + + preview-rendered + 2013-11-19 + http://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Material/Resources/icons/preview-rendered.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + + + + + + + + + + + + diff --git a/src/Mod/Material/Gui/Resources/icons/preview-vector.svg b/src/Mod/Material/Gui/Resources/icons/preview-vector.svg new file mode 100644 index 0000000000..a35d81e5b0 --- /dev/null +++ b/src/Mod/Material/Gui/Resources/icons/preview-vector.svg @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + $committer + + + preview-vector + 2013-11-19 + http://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Material/Resources/icons/preview-vector.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + + + + + + + + + + + + + + diff --git a/src/Mod/Material/Gui/Resources/icons/table.svg b/src/Mod/Material/Gui/Resources/icons/table.svg new file mode 100644 index 0000000000..864b5da518 --- /dev/null +++ b/src/Mod/Material/Gui/Resources/icons/table.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Material/Gui/Resources/translations/Material.ts b/src/Mod/Material/Gui/Resources/translations/Material.ts new file mode 100644 index 0000000000..181e028255 --- /dev/null +++ b/src/Mod/Material/Gui/Resources/translations/Material.ts @@ -0,0 +1,85 @@ + + + + + MaterialEditor + + + Material Editor + + + + + Material card + + + + + Opens the Product URL of this material in an external browser + + + + + Existing material cards + + + + + Opens an existing material card + + + + + Open... + + + + + Saves this material as a card + + + + + Save as... + + + + + Material parameter + + + + + Add / remove parameter + + + + + Add property + + + + + Delete property + + + + + Material + + + Product URL + + + + + UserDefined + + + + + Name + + + + diff --git a/src/Mod/Material/Init.py b/src/Mod/Material/Init.py index 0d9a0df6b9..2f8d2ca577 100644 --- a/src/Mod/Material/Init.py +++ b/src/Mod/Material/Init.py @@ -23,3 +23,5 @@ import FreeCAD # import for the FreeCAD Material card FreeCAD.addImportType("FreeCAD Material Card (*.FCMat)", "importFCMat") + +FreeCAD.__unit_test__ += [ "TestMaterialsApp" ] diff --git a/src/Mod/Material/InitGui.py b/src/Mod/Material/InitGui.py index 56c021e2f3..125e63647d 100644 --- a/src/Mod/Material/InitGui.py +++ b/src/Mod/Material/InitGui.py @@ -19,3 +19,7 @@ #* * #*************************************************************************** +# import FreeCADGui + +# import Material_rc +# FreeCADGui.addPreferencePage(":/ui/preferences-material.ui","Material") diff --git a/src/Mod/Material/Material.py b/src/Mod/Material/Material.py deleted file mode 100644 index e6a628c6e2..0000000000 --- a/src/Mod/Material/Material.py +++ /dev/null @@ -1,135 +0,0 @@ -# *************************************************************************** -# * Copyright (c) 2013-2015 Juergen Riegel * -# * * -# * This program is free software; you can redistribute it and/or modify * -# * it under the terms of the GNU Lesser General Public License (LGPL) * -# * as published by the Free Software Foundation; either version 2 of * -# * the License, or (at your option) any later version. * -# * for detail see the LICENCE text file. * -# * * -# * This program is distributed in the hope that it will be useful, * -# * but WITHOUT ANY WARRANTY; without even the implied warranty of * -# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -# * GNU Library General Public License for more details. * -# * * -# * You should have received a copy of the GNU Library General Public * -# * License along with this program; if not, write to the Free Software * -# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * -# * USA * -# * * -# *************************************************************************** - -import sys -import FreeCAD - - -# The usage description if you use this tool from the command line ("__main__") -CommandlineUsage = """Material - Tool to work with FreeCAD Material definition cards - -Usage: - Material [Options] card-file-name - -Options: - -c, --output-csv=filename write a comma separated grid with the material data - -Exit: - 0 No Error or Warning found - 1 Argument error, wrong or too few Arguments given - -Tool to work with FreeCAD Material definition cards - -Examples: - - Material "StandardMaterial/Steel.FCMat" - -Author: - (c) 2013 Juergen Riegel - mail@juergen-riegel.net - Licence: LGPL - -Version: - 0.1 -""" - - -# see comments in module importFCMat, there is an independent parser implementation -# for reading and writing FCMat files -# inside FreeCAD mostly the one from importFCMat.py is used - - -def importFCMat(fileName): - "Read a FCMat file into a dictionary" - try: - import ConfigParser as configparser - except ImportError: - import configparser - - FreeCAD.Console.PrintError( - 'This mat card reader is probably deprecated and not widely used in FreeCAD. ' - 'See comment in Material.py module.\n' - ) - Config = configparser.RawConfigParser() - Config.optionxform = str - Config.read(fileName, encoding='utf-8') # respect unicode filenames - dict1 = {} - for section in Config.sections(): - options = Config.options(section) - for option in options: - dict1[option] = Config.get(section, option) - - return dict1 - - -def exportFCMat(fileName, matDict): - "Write a material dictionary to a FCMat file" - try: - import ConfigParser as configparser - except ImportError: - import configparser - import string - Config = configparser.RawConfigParser() - - FreeCAD.Console.PrintError( - 'This mat card writer is probably deprecated and not widely used in FreeCAD. ' - 'See comment in Material.py module.\n' - ) - # create groups - for x in matDict.keys(): - grp, key = string.split(x, sep='_') - if not Config.has_section(grp): - Config.add_section(grp) - - # fill groups - for x in matDict.keys(): - grp, key = string.split(x, sep='_') - Config.set(grp, key, matDict[x]) - - Preamble = "# This is a FreeCAD material-card file\n\n" - # Writing our configuration file to 'example.cfg' - with open(fileName, 'wb') as configfile: - configfile.write(Preamble) - Config.write(configfile) - - -if __name__ == '__main__': - import getopt - try: - opts, args = getopt.getopt(sys.argv[1:], "c:", ["output-csv="]) - except getopt.GetoptError: - # print help information and exit: - sys.stderr.write(CommandlineUsage) - sys.exit(1) - - # checking on the options - for o, a in opts: - if o in ("-c", "--output-csv"): - print("writing file: " + a + "\n") - OutPath = a - - # running through the files - FileName = args[0] - - kv_map = importFCMat(FileName) - for k in kv_map.keys(): - print(repr(k) + " : " + repr(kv_map[k])) - sys.exit(0) # no error diff --git a/src/Mod/Material/MaterialEditor.py b/src/Mod/Material/MaterialEditor.py index 044bd2f2f5..a21ded9da7 100644 --- a/src/Mod/Material/MaterialEditor.py +++ b/src/Mod/Material/MaterialEditor.py @@ -25,12 +25,15 @@ __author__ = "Yorik van Havre, Bernd Hahnebach" __url__ = "http://www.freecad.org" import os +from pathlib import PurePath import sys from PySide import QtCore, QtGui, QtSvg import FreeCAD import FreeCADGui # import Material_rc +from materialtools.cardutils import get_material_preferred_directory, get_material_preferred_save_directory + # is this still needed after the move to card utils??? unicode = str @@ -52,17 +55,21 @@ class MaterialEditor: self.customprops = [] self.internalprops = [] self.groups = [] - self.directory = FreeCAD.getResourceDir() + "Mod/Material" + self.directory = get_material_preferred_directory() + self.save_directory = get_material_preferred_save_directory() + if self.directory is None: + self.directory = FreeCAD.getResourceDir() + "Mod/Material" self.materials = {} self.cards = {} self.icons = {} self.initialIndex = -1 + self.edited = False self.card_path = card_path filePath = os.path.dirname(__file__) + os.sep self.iconPath = (filePath + "Resources" + os.sep + "icons" + os.sep) # load the UI file from the same directory as this script - self.widget = FreeCADGui.PySideUic.loadUi(filePath + "materials-editor.ui") + self.widget = FreeCADGui.PySideUic.loadUi(filePath + "Resources" + os.sep + "ui" + os.sep + "materials-editor.ui") # remove unused Help button self.widget.setWindowFlags(self.widget.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) @@ -104,7 +111,7 @@ class MaterialEditor: # currently closes the dialog standardButtons.rejected.connect(self.reject) - standardButtons.accepted.connect(self.accept) + standardButtons.button(QtGui.QDialogButtonBox.Ok).clicked.connect(self.verify) buttonOpen.clicked.connect(self.openfile) buttonSave.clicked.connect(self.savefile) buttonURL.clicked.connect(self.openProductURL) @@ -117,6 +124,7 @@ class MaterialEditor: treeView.setModel(model) treeView.setUniformRowHeights(True) treeView.setItemDelegate(MaterialsDelegate()) + model.itemChanged.connect(self.modelChange) # init model self.implementModel() @@ -181,6 +189,7 @@ class MaterialEditor: # top.sortChildren(0) # treeView.expandAll() + self.edited = False def updateMatParamsInTree(self, data): @@ -220,10 +229,20 @@ class MaterialEditor: it = QtGui.QStandardItem(i) userGroup.appendRow([item, it]) self.customprops.append(k) + self.edited = False def chooseMaterial(self, index): if index < 0: return + + if self.verifyMaterial(): + """ + Save any unchanged data + """ + self.edited = False + else: + return + self.card_path = self.widget.ComboMaterial.itemData(index) FreeCAD.Console.PrintMessage( "choose_material in material editor:\n" @@ -239,6 +258,21 @@ class MaterialEditor: else: FreeCAD.Console.PrintError("Material card not found: {}\n".format(self.card_path)) + def verifyMaterial(self): + if self.edited: + reply = QtGui.QMessageBox.question(self.widget, #FreeCADGui.getMainWindow(), + translate("Material","The document has been modified."), + translate("Material","Do you want to save your changes?"), + QtGui.QMessageBox.Save | QtGui.QMessageBox.Discard | QtGui.QMessageBox.Cancel, + QtGui.QMessageBox.Save) + + if reply == QtGui.QMessageBox.Cancel: + return False + if reply == QtGui.QMessageBox.Save: + self.savefile() + + return True + def updateCardsInCombo(self): """updates the contents of the materials combo with existing material cards""" @@ -280,6 +314,32 @@ class MaterialEditor: if url: QtGui.QDesktopServices.openUrl(QtCore.QUrl(url, QtCore.QUrl.TolerantMode)) + def modelChange(self, item): + """ + Called when an item in the tree is modified. This will set edited to True, but this + will be reset in the event of mass updates, such as loading a card + """ + self.edited = True + + def verify(self, button): + """ + Verify that the user wants to save any changed data before exiting + """ + + if self.edited: + reply = QtGui.QMessageBox.question(self.widget, #FreeCADGui.getMainWindow(), + translate("Material","The document has been modified."), + translate("Material","Do you want to save your changes?"), + QtGui.QMessageBox.Save | QtGui.QMessageBox.Discard | QtGui.QMessageBox.Cancel, + QtGui.QMessageBox.Save) + + if reply == QtGui.QMessageBox.Cancel: + return + if reply == QtGui.QMessageBox.Save: + self.savefile() + + self.accept() + def accept(self): "" @@ -340,6 +400,7 @@ class MaterialEditor: it = QtGui.QStandardItem(value) top.appendRow([item, it]) self.customprops.append(key) + self.edited = True def deleteCustomProperty(self, key=None): @@ -376,6 +437,8 @@ class MaterialEditor: it.setText("") buttonDeleteProperty.setProperty("text", "Delete value") + self.edited = True + buttonDeleteProperty.setEnabled(False) def onClickTree(self, index): @@ -505,12 +568,20 @@ class MaterialEditor: return color.name() def openfile(self): + if self.verifyMaterial(): + """ + Save any unchanged data + """ + self.edited = False + else: + return + "Opens a FCMat file" if self.category == "Solid": directory = self.directory + os.sep + "StandardMaterial" else: directory = self.directory + os.sep + "FluidMaterial" - if self.card_path is None: + if self.card_path is None or len(self.card_path) == 0: self.card_path = directory filetuple = QtGui.QFileDialog.getOpenFileName( QtGui.QApplication.activeWindow(), @@ -529,8 +600,11 @@ class MaterialEditor: # D:/FreeCAD-build/data/Mod\Material\FluidMaterial\Air.FCMat # To keep it simple, we take a path from the ComboMaterial and change only the # material card filename - if self.initialIndex > -1: - path = self.widget.ComboMaterial.itemData(self.initialIndex) + # + # Using the initialIndex variable won't work before a card os selected for the + # first time, so use index 1. Index 0 is a blank entry + if self.widget.ComboMaterial.count() > 1: + path = self.widget.ComboMaterial.itemData(1) # at first check if we have a uniform usage # (if a character is not present, rsplit delivers the initial string) testBackslash = path.rsplit('\\', 1)[0] @@ -590,19 +664,27 @@ class MaterialEditor: filetuple = QtGui.QFileDialog.getSaveFileName( QtGui.QApplication.activeWindow(), "Save FreeCAD Material file", - self.directory + "/" + name + ".FCMat", + self.save_directory + "/" + name + ".FCMat", "*.FCMat" ) # a tuple of two empty strings returns True, so use the filename directly filename = filetuple[0] if filename: - self.directory = os.path.dirname(filename) - # should not be resource dir but user result dir instead + # Update the directories to the current save value + self.save_directory = os.path.dirname(filename) + self.directory = self.save_directory + self.card_path = filename + d = self.getDict() # self.outputDict(d) if d: + # Set the card name to match the filename + path = PurePath(filename) + d["CardName"] = path.stem + from importFCMat import write write(filename, d) + self.edited = False self.updateCardsInCombo() def show(self): @@ -854,8 +936,13 @@ def translate(context, text): def openEditor(obj=None, prop=None): """openEditor([obj,prop]): opens the editor, optionally with an object name and material property name to edit""" - editor = MaterialEditor(obj, prop) - editor.exec_() + param = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Material/Cards") + legacy = param.GetBool("LegacyEditor", True) + if legacy: + editor = MaterialEditor(obj, prop) + editor.exec_() + else: + FreeCADGui.runCommand('Materials_Edit',0) def editMaterial(material=None, card_path=None, category="Solid"): diff --git a/src/Mod/Material/MaterialGlobal.h b/src/Mod/Material/MaterialGlobal.h new file mode 100644 index 0000000000..c1c4ce429a --- /dev/null +++ b/src/Mod/Material/MaterialGlobal.h @@ -0,0 +1,46 @@ +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include + +#ifndef MATERIAL_GLOBAL_H +#define MATERIAL_GLOBAL_H + +// Material +#ifndef MaterialsExport +#ifdef Material_EXPORTS +# define MaterialsExport FREECAD_DECL_EXPORT +#else +# define MaterialsExport FREECAD_DECL_IMPORT +#endif +#endif + +// MatGui +#ifndef MatGuiExport +#ifdef MatGui_EXPORTS +# define MatGuiExport FREECAD_DECL_EXPORT +#else +# define MatGuiExport FREECAD_DECL_IMPORT +#endif +#endif + +#endif //MATERIAL_GLOBAL_H diff --git a/src/Mod/Material/Resources/Material.qrc b/src/Mod/Material/Resources/Material.qrc index e3cc6f00c1..f5f3ad827c 100644 --- a/src/Mod/Material/Resources/Material.qrc +++ b/src/Mod/Material/Resources/Material.qrc @@ -2,5 +2,6 @@ icons/preview-rendered.svg icons/preview-vector.svg + ui/materials-editor.ui diff --git a/src/Mod/Material/Resources/Materials/Appearance/Aluminum.FCMat b/src/Mod/Material/Resources/Materials/Appearance/Aluminum.FCMat new file mode 100644 index 0000000000..d33f1d0ef4 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/Appearance/Aluminum.FCMat @@ -0,0 +1,15 @@ +# File created by ConvertFCMat.py +General: + UUID: "d1f317f0-5ffa-4798-8ab3-af2ff0b5182c" + AuthorAndLicense: "(c) 2023 David Carter" + Name: "Aluminum" + Description: "Defines the Aluminum appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(0.3000, 0.3000, 0.3000, 1.0)" + DiffuseColor: "(0.3000, 0.3000, 0.3000, 1.0)" + EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)" + Shininess: "0.0900" + SpecularColor: "(0.3000, 0.3000, 0.3000, 1.0)" + Transparency: "0.0" diff --git a/src/Mod/Material/Resources/Materials/Appearance/Brass.FCMat b/src/Mod/Material/Resources/Materials/Appearance/Brass.FCMat new file mode 100644 index 0000000000..f17c932862 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/Appearance/Brass.FCMat @@ -0,0 +1,15 @@ +# File created by ConvertFCMat.py +General: + UUID: "4151e19c-fd6a-4ca4-83d4-d5e17d76cb9c" + AuthorAndLicense: "(c) 2023 David Carter" + Name: "Brass" + Description: "Defines the Brass appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(0.3294, 0.2235, 0.0275, 1.0)" + DiffuseColor: "(0.7804, 0.5686, 0.1137, 1.0)" + EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)" + Shininess: "0.2179" + SpecularColor: "(0.9922, 0.9412, 0.8078, 1.0)" + Transparency: "0.0" diff --git a/src/Mod/Material/Resources/Materials/Appearance/Bronze.FCMat b/src/Mod/Material/Resources/Materials/Appearance/Bronze.FCMat new file mode 100644 index 0000000000..bc6c294526 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/Appearance/Bronze.FCMat @@ -0,0 +1,15 @@ +# File created by ConvertFCMat.py +General: + UUID: "ae194589-02d4-4e9b-98a7-f523f660d510" + AuthorAndLicense: "(c) 2023 David Carter" + Name: "Bronze" + Description: "Defines the Bronze appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(0.2125, 0.1275, 0.0540, 1.0)" + DiffuseColor: "(0.7140, 0.4284, 0.1814, 1.0)" + EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)" + Shininess: "0.2000" + SpecularColor: "(0.3935, 0.2719, 0.1667, 1.0)" + Transparency: "0.0" diff --git a/src/Mod/Material/Resources/Materials/Appearance/Chrome.FCMat b/src/Mod/Material/Resources/Materials/Appearance/Chrome.FCMat new file mode 100644 index 0000000000..dccbfaec0e --- /dev/null +++ b/src/Mod/Material/Resources/Materials/Appearance/Chrome.FCMat @@ -0,0 +1,15 @@ +# File created by ConvertFCMat.py +General: + UUID: "a9544b88-dde7-4d05-9bdb-c008a4e88dc1" + AuthorAndLicense: "(c) 2023 David Carter" + Name: "Chrome" + Description: "Defines the Chrome appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(0.3500, 0.3500, 0.3500, 1.0)" + DiffuseColor: "(0.9176, 0.9176, 0.9176, 1.0)" + EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)" + Shininess: "0.1000" + SpecularColor: "(0.9746, 0.9746, 0.9746, 1.0)" + Transparency: "0.0" diff --git a/src/Mod/Material/Resources/Materials/Appearance/Copper.FCMat b/src/Mod/Material/Resources/Materials/Appearance/Copper.FCMat new file mode 100644 index 0000000000..643ca6ed06 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/Appearance/Copper.FCMat @@ -0,0 +1,15 @@ +# File created by ConvertFCMat.py +General: + UUID: "524cad9b-b841-4037-9851-badeca7dcee2" + AuthorAndLicense: "(c) 2023 David Carter" + Name: "Copper" + Description: "Defines the Copper appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(0.3300, 0.2600, 0.2300, 1.0)" + DiffuseColor: "(0.5000, 0.1100, 0.0000, 1.0)" + EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)" + Shininess: "0.9300" + SpecularColor: "(0.9500, 0.7300, 0.0000, 1.0)" + Transparency: "0.0" diff --git a/src/Mod/Material/Resources/Materials/Appearance/DefaultAppearance.FCMat b/src/Mod/Material/Resources/Materials/Appearance/DefaultAppearance.FCMat new file mode 100644 index 0000000000..9795ceae40 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/Appearance/DefaultAppearance.FCMat @@ -0,0 +1,15 @@ +# File created by ConvertFCMat.py +General: + UUID: "5dbb7be6-8b63-479b-ab4c-87be02ead973" + AuthorAndLicense: "(c) 2023 David Carter" + Name: "Default Appearance" + Description: "Defines the default appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(0.2000, 0.2000, 0.2000, 1.0)" + DiffuseColor: "(0.8000, 0.8000, 0.8000, 1.0)" + EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)" + Shininess: "0.2000" + SpecularColor: "(0.0000, 0.0000, 0.0000, 1.0)" + Transparency: "0.0" diff --git a/src/Mod/Material/Resources/Materials/Appearance/Emerald.FCMat b/src/Mod/Material/Resources/Materials/Appearance/Emerald.FCMat new file mode 100644 index 0000000000..d98a8f1153 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/Appearance/Emerald.FCMat @@ -0,0 +1,15 @@ +# File created by ConvertFCMat.py +General: + UUID: "54def35f-a6bf-472e-8410-dc9fb4b143cf" + AuthorAndLicense: "(c) 2023 David Carter" + Name: "Emerald" + Description: "Defines the Emerald appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(0.0215, 0.1745, 0.0215, 1.0)" + DiffuseColor: "(0.0757, 0.6142, 0.0757, 1.0)" + EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)" + Shininess: "0.6000" + SpecularColor: "(0.6330, 0.7278, 0.6330, 1.0)" + Transparency: "0.0" diff --git a/src/Mod/Material/Resources/Materials/Appearance/Gold.FCMat b/src/Mod/Material/Resources/Materials/Appearance/Gold.FCMat new file mode 100644 index 0000000000..170b7d1302 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/Appearance/Gold.FCMat @@ -0,0 +1,15 @@ +# File created by ConvertFCMat.py +General: + UUID: "85257e2c-be3f-40a1-b03f-0bd4ba58ca08" + AuthorAndLicense: "(c) 2023 David Carter" + Name: "Gold" + Description: "Defines the Gold appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(0.3000, 0.2306, 0.0953, 1.0)" + DiffuseColor: "(0.4000, 0.2760, 0.0000, 1.0)" + EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)" + Shininess: "0.0625" + SpecularColor: "(0.9000, 0.8820, 0.7020, 1.0)" + Transparency: "0.0" diff --git a/src/Mod/Material/Resources/Materials/Appearance/Jade.FCMat b/src/Mod/Material/Resources/Materials/Appearance/Jade.FCMat new file mode 100644 index 0000000000..3a956ebff2 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/Appearance/Jade.FCMat @@ -0,0 +1,15 @@ +# File created by ConvertFCMat.py +General: + UUID: "cddfa21f-0715-49dd-b35b-951c076fa52c" + AuthorAndLicense: "(c) 2023 David Carter" + Name: "Jade" + Description: "Defines the Jade appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(0.1350, 0.2225, 0.1575, 1.0)" + DiffuseColor: "(0.5400, 0.8900, 0.6300, 1.0)" + EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)" + Shininess: "0.1000" + SpecularColor: "(0.3162, 0.3162, 0.3162, 1.0)" + Transparency: "0.0" diff --git a/src/Mod/Material/Resources/Materials/Appearance/Metalized.FCMat b/src/Mod/Material/Resources/Materials/Appearance/Metalized.FCMat new file mode 100644 index 0000000000..11892dc311 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/Appearance/Metalized.FCMat @@ -0,0 +1,15 @@ +# File created by ConvertFCMat.py +General: + UUID: "d149a177-07f1-4e53-9bad-0b5bf0663600" + AuthorAndLicense: "(c) 2023 David Carter" + Name: "Metalized" + Description: "Defines the Metalized appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(0.1800, 0.1800, 0.1800, 1.0)" + DiffuseColor: "(0.0000, 0.0000, 0.0000, 1.0)" + EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)" + Shininess: "0.1300" + SpecularColor: "(0.4500, 0.4500, 0.4500, 1.0)" + Transparency: "0.0" diff --git a/src/Mod/Material/Resources/Materials/Appearance/NeonGNC.FCMat b/src/Mod/Material/Resources/Materials/Appearance/NeonGNC.FCMat new file mode 100644 index 0000000000..ddf2092e1c --- /dev/null +++ b/src/Mod/Material/Resources/Materials/Appearance/NeonGNC.FCMat @@ -0,0 +1,15 @@ +# File created by ConvertFCMat.py +General: + UUID: "c0341eef-0897-4fcf-a7f7-eddf1a2600a5" + AuthorAndLicense: "(c) 2023 David Carter" + Name: "Neon GNC" + Description: "Defines the Neon GNC appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(0.2000, 0.2000, 0.2000, 1.0)" + DiffuseColor: "(0.0000, 0.0000, 0.0000, 1.0)" + EmissiveColor: "(1.0000, 1.0000, 0.0000, 1.0)" + Shininess: "0.0500" + SpecularColor: "(0.6200, 0.6200, 0.6200, 1.0)" + Transparency: "0.0" diff --git a/src/Mod/Material/Resources/Materials/Appearance/NeonPHC.FCMat b/src/Mod/Material/Resources/Materials/Appearance/NeonPHC.FCMat new file mode 100644 index 0000000000..ed315a25b6 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/Appearance/NeonPHC.FCMat @@ -0,0 +1,15 @@ +# File created by ConvertFCMat.py +General: + UUID: "add2d6b2-c8fb-4777-a80a-52bae97300ae" + AuthorAndLicense: "(c) 2023 David Carter" + Name: "Neon PHC" + Description: "Defines the Neon PHC appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(1.0000, 1.0000, 1.0000, 1.0)" + DiffuseColor: "(1.0000, 1.0000, 1.0000, 1.0)" + EmissiveColor: "(0.0000, 0.9000, 0.4140, 1.0)" + Shininess: "0.0500" + SpecularColor: "(0.6200, 0.6200, 0.6200, 1.0)" + Transparency: "0.0" diff --git a/src/Mod/Material/Resources/Materials/Appearance/Obsidian.FCMat b/src/Mod/Material/Resources/Materials/Appearance/Obsidian.FCMat new file mode 100644 index 0000000000..e4f366cff9 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/Appearance/Obsidian.FCMat @@ -0,0 +1,15 @@ +# File created by ConvertFCMat.py +General: + UUID: "a004c270-7d2c-4898-bec6-b1120edacea9" + AuthorAndLicense: "(c) 2023 David Carter" + Name: "Obsidian" + Description: "Defines the Obsidian appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(0.0538, 0.0500, 0.0662, 1.0)" + DiffuseColor: "(0.1828, 0.1700, 0.2253, 1.0)" + EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)" + Shininess: "0.3000" + SpecularColor: "(0.3327, 0.3286, 0.3464, 1.0)" + Transparency: "0.0" diff --git a/src/Mod/Material/Resources/Materials/Appearance/Pewter.FCMat b/src/Mod/Material/Resources/Materials/Appearance/Pewter.FCMat new file mode 100644 index 0000000000..b7592ea3df --- /dev/null +++ b/src/Mod/Material/Resources/Materials/Appearance/Pewter.FCMat @@ -0,0 +1,15 @@ +# File created by ConvertFCMat.py +General: + UUID: "a61853b9-ec9f-403e-9726-0a938731aecd" + AuthorAndLicense: "(c) 2023 David Carter" + Name: "Pewter" + Description: "Defines the Pewter appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(0.1059, 0.0588, 0.1137, 1.0)" + DiffuseColor: "(0.4275, 0.4706, 0.5412, 1.0)" + EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)" + Shininess: "0.0769" + SpecularColor: "(0.3333, 0.3333, 0.5216, 1.0)" + Transparency: "0.0" diff --git a/src/Mod/Material/Resources/Materials/Appearance/Plaster.FCMat b/src/Mod/Material/Resources/Materials/Appearance/Plaster.FCMat new file mode 100644 index 0000000000..70f6c8932a --- /dev/null +++ b/src/Mod/Material/Resources/Materials/Appearance/Plaster.FCMat @@ -0,0 +1,15 @@ +# File created by ConvertFCMat.py +General: + UUID: "569dccb6-c64b-4dd0-9d3c-1b78f40ad1a5" + AuthorAndLicense: "(c) 2023 David Carter" + Name: "Plaster" + Description: "Defines the Plaster appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(0.0500, 0.0500, 0.0500, 1.0)" + DiffuseColor: "(0.1167, 0.1167, 0.1167, 1.0)" + EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)" + Shininess: "0.0078" + SpecularColor: "(0.0305, 0.0305, 0.0305, 1.0)" + Transparency: "0.0" diff --git a/src/Mod/Material/Resources/Materials/Appearance/Plastic.FCMat b/src/Mod/Material/Resources/Materials/Appearance/Plastic.FCMat new file mode 100644 index 0000000000..2484521dca --- /dev/null +++ b/src/Mod/Material/Resources/Materials/Appearance/Plastic.FCMat @@ -0,0 +1,15 @@ +# File created by ConvertFCMat.py +General: + UUID: "a74622cd-0e2d-4a96-b8c4-fefcc82ac694" + AuthorAndLicense: "(c) 2023 David Carter" + Name: "Plastic" + Description: "Defines the Plastic appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(0.1000, 0.1000, 0.1000, 1.0)" + DiffuseColor: "(0.0000, 0.0000, 0.0000, 1.0)" + EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)" + Shininess: "0.0078" + SpecularColor: "(0.0600, 0.0600, 0.0600, 1.0)" + Transparency: "0.0" diff --git a/src/Mod/Material/Resources/Materials/Appearance/Ruby.FCMat b/src/Mod/Material/Resources/Materials/Appearance/Ruby.FCMat new file mode 100644 index 0000000000..5a8138ba39 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/Appearance/Ruby.FCMat @@ -0,0 +1,15 @@ +# File created by ConvertFCMat.py +General: + UUID: "953261a0-cc48-41f8-a3f9-7b20ae3f9b56" + AuthorAndLicense: "(c) 2023 David Carter" + Name: "Ruby" + Description: "Defines the Ruby appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(0.1745, 0.0118, 0.0118, 1.0)" + DiffuseColor: "(0.6142, 0.0414, 0.0414, 1.0)" + EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)" + Shininess: "0.6000" + SpecularColor: "(0.7278, 0.6279, 0.6279, 1.0)" + Transparency: "0.0" diff --git a/src/Mod/Material/Resources/Materials/Appearance/Satin.FCMat b/src/Mod/Material/Resources/Materials/Appearance/Satin.FCMat new file mode 100644 index 0000000000..97a198c206 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/Appearance/Satin.FCMat @@ -0,0 +1,15 @@ +# File created by ConvertFCMat.py +General: + UUID: "951b54ae-86b6-46d2-b452-60bd6a3ba1bb" + AuthorAndLicense: "(c) 2023 David Carter" + Name: "Satin" + Description: "Defines the Satin appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(0.0660, 0.0660, 0.0660, 1.0)" + DiffuseColor: "(0.0000, 0.0000, 0.0000, 1.0)" + EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)" + Shininess: "0.0938" + SpecularColor: "(0.4400, 0.4400, 0.4400, 1.0)" + Transparency: "0.0" diff --git a/src/Mod/Material/Resources/Materials/Appearance/ShinyPlastic.FCMat b/src/Mod/Material/Resources/Materials/Appearance/ShinyPlastic.FCMat new file mode 100644 index 0000000000..75853c01bc --- /dev/null +++ b/src/Mod/Material/Resources/Materials/Appearance/ShinyPlastic.FCMat @@ -0,0 +1,15 @@ +# File created by ConvertFCMat.py +General: + UUID: "591c4c4a-22ba-4a9a-869d-e5610107d69a" + AuthorAndLicense: "(c) 2023 David Carter" + Name: "Shiny Plastic" + Description: "Defines the Shiny Plastic appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(0.0880, 0.0880, 0.0880, 1.0)" + DiffuseColor: "(0.0000, 0.0000, 0.0000, 1.0)" + EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)" + Shininess: "1.0000" + SpecularColor: "(1.0000, 1.0000, 1.0000, 1.0)" + Transparency: "0.0" diff --git a/src/Mod/Material/Resources/Materials/Appearance/Silver.FCMat b/src/Mod/Material/Resources/Materials/Appearance/Silver.FCMat new file mode 100644 index 0000000000..b3354a150a --- /dev/null +++ b/src/Mod/Material/Resources/Materials/Appearance/Silver.FCMat @@ -0,0 +1,15 @@ +# File created by ConvertFCMat.py +General: + UUID: "62839fb0-d854-4b44-92df-b7249213de49" + AuthorAndLicense: "(c) 2023 David Carter" + Name: "Silver" + Description: "Defines the Silver appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(0.1922, 0.1922, 0.1922, 1.0)" + DiffuseColor: "(0.5075, 0.5075, 0.5075, 1.0)" + EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)" + Shininess: "0.2000" + SpecularColor: "(0.5083, 0.5083, 0.5083, 1.0)" + Transparency: "0.0" diff --git a/src/Mod/Material/Resources/Materials/Appearance/Steel.FCMat b/src/Mod/Material/Resources/Materials/Appearance/Steel.FCMat new file mode 100644 index 0000000000..7bebcd8a90 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/Appearance/Steel.FCMat @@ -0,0 +1,15 @@ +# File created by ConvertFCMat.py +General: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" + AuthorAndLicense: "(c) 2023 David Carter" + Name: "Steel" + Description: "Defines the Steel appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(0.0020, 0.0020, 0.0020, 1.0)" + DiffuseColor: "(0.0000, 0.0000, 0.0000, 1.0)" + EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)" + Shininess: "0.0600" + SpecularColor: "(0.9800, 0.9800, 0.9800, 1.0)" + Transparency: "0.0" diff --git a/src/Mod/Material/Resources/Materials/Appearance/Stone.FCMat b/src/Mod/Material/Resources/Materials/Appearance/Stone.FCMat new file mode 100644 index 0000000000..8c3910ee5d --- /dev/null +++ b/src/Mod/Material/Resources/Materials/Appearance/Stone.FCMat @@ -0,0 +1,15 @@ +# File created by ConvertFCMat.py +General: + UUID: "a9f54d61-cc98-46df-8734-b0543ceb4e45" + AuthorAndLicense: "(c) 2023 David Carter" + Name: "Stone" + Description: "Defines the Stone appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(0.1900, 0.1520, 0.1178, 1.0)" + DiffuseColor: "(0.7500, 0.6000, 0.4650, 1.0)" + EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)" + Shininess: "0.1700" + SpecularColor: "(0.0784, 0.0800, 0.0480, 1.0)" + Transparency: "0.0" diff --git a/src/Mod/Material/Resources/Materials/FluidMaterial/Air.FCMat b/src/Mod/Material/Resources/Materials/FluidMaterial/Air.FCMat new file mode 100644 index 0000000000..6a5be9c27c --- /dev/null +++ b/src/Mod/Material/Resources/Materials/FluidMaterial/Air.FCMat @@ -0,0 +1,25 @@ +# File created by ConvertFCMat.py +General: + UUID: "94370b96-c97e-4a3f-83b2-11d7461f7da7" + Name: "Air" + Description: "Dry air properties at 20 Degrees Celsius and 1 atm" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Gas" + Fluid: + UUID: '1ae66d8c-1ba1-4211-ad12-b9917573b202' + Density: "1.204 kg/m^3" + DynamicViscosity: "1.80e-5 kg/m/s" + KinematicViscosity: "1.511e-5 m^2/s" + PrandtlNumber: "0.7" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "1.01 kJ/kg/K" + ThermalConductivity: "0.02587 W/m/K" + ThermalExpansionCoefficient: "3.43e-3 1/K" + Electromagnetic: + UUID: 'b2eb5f48-74b3-4193-9fbb-948674f427f3' + RelativePermittivity: "1.00059" + ElectricalConductivity: "1e-12 S/m" + RelativePermeability: "1.0" diff --git a/src/Mod/Material/Resources/Materials/FluidMaterial/Argon.FCMat b/src/Mod/Material/Resources/Materials/FluidMaterial/Argon.FCMat new file mode 100644 index 0000000000..1607bd59da --- /dev/null +++ b/src/Mod/Material/Resources/Materials/FluidMaterial/Argon.FCMat @@ -0,0 +1,25 @@ +# File created by ConvertFCMat.py +General: + UUID: "e359c5b5-eae2-42b1-9ef6-edde21d706ee" + Name: "Argon" + Description: "Argon properties at 20 Degrees Celsius and 1 atm" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Gas" + Fluid: + UUID: '1ae66d8c-1ba1-4211-ad12-b9917573b202' + Density: "1.641 kg/m^3" + DynamicViscosity: "22.3e-6 kg/m/s" + KinematicViscosity: "13.59-6 m^2/s" + PrandtlNumber: "0.7" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "0.520 kJ/kg/K" + ThermalConductivity: "0.018 W/m/K" + ThermalExpansionCoefficient: "3.43e-3 1/K" + Electromagnetic: + UUID: 'b2eb5f48-74b3-4193-9fbb-948674f427f3' + RelativePermittivity: "1.000513" + ElectricalConductivity: "1e-15 S/m" + RelativePermeability: "1.0" diff --git a/src/Mod/Material/Resources/Materials/FluidMaterial/Carbon_dioxide.FCMat b/src/Mod/Material/Resources/Materials/FluidMaterial/Carbon_dioxide.FCMat new file mode 100644 index 0000000000..7ffe282fed --- /dev/null +++ b/src/Mod/Material/Resources/Materials/FluidMaterial/Carbon_dioxide.FCMat @@ -0,0 +1,25 @@ +# File created by ConvertFCMat.py +General: + UUID: "ef0e4040-a498-48c3-a87b-e996bfd89195" + Name: "Carbon dioxide" + Description: "Carbon dioxide properties at 20 Degrees Celsius and 1 atm" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Gas" + Fluid: + UUID: '1ae66d8c-1ba1-4211-ad12-b9917573b202' + Density: "1.8393 kg/m^3" + DynamicViscosity: "14.7e-6 kg/m/s" + KinematicViscosity: "8.09e-6 m^2/s" + PrandtlNumber: "0.7651" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "0.8460 kJ/kg/K" + ThermalConductivity: "0.016242 W/m/K" + ThermalExpansionCoefficient: "3.43e-3 1/K" + Electromagnetic: + UUID: 'b2eb5f48-74b3-4193-9fbb-948674f427f3' + RelativePermittivity: "1.0009217" + ElectricalConductivity: "1e-12 S/m" + RelativePermeability: "1.0" diff --git a/src/Mod/Material/Resources/Materials/FluidMaterial/Nitrogen.FCMat b/src/Mod/Material/Resources/Materials/FluidMaterial/Nitrogen.FCMat new file mode 100644 index 0000000000..bd5fd3ea07 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/FluidMaterial/Nitrogen.FCMat @@ -0,0 +1,25 @@ +# File created by ConvertFCMat.py +General: + UUID: "8d02a797-5e0a-4e40-803a-75fc66de8de6" + Name: "Nitrogen" + Description: "Nitrogen properties at 20 Degrees Celsius and 1 atm" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Gas" + Fluid: + UUID: '1ae66d8c-1ba1-4211-ad12-b9917573b202' + Density: "1.2506 kg/m^3" + DynamicViscosity: "17.58e-6 kg/m/s" + KinematicViscosity: "14.06e-6 m^2/s" + PrandtlNumber: "0.7" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "1.04 kJ/kg/K" + ThermalConductivity: "25.83e-3 W/m/K" + ThermalExpansionCoefficient: "3.43e-3 1/K" + Electromagnetic: + UUID: 'b2eb5f48-74b3-4193-9fbb-948674f427f3' + RelativePermittivity: "1.00058" + ElectricalConductivity: "1e-12 S/m" + RelativePermeability: "1.0" diff --git a/src/Mod/Material/Resources/Materials/FluidMaterial/None.FCMat b/src/Mod/Material/Resources/Materials/FluidMaterial/None.FCMat new file mode 100644 index 0000000000..40094e2d06 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/FluidMaterial/None.FCMat @@ -0,0 +1,16 @@ +# File created by ConvertFCMat.py +General: + UUID: "944a8018-09bf-48f6-a7b3-aa8f6a00a310" + Name: "None" + Description: "None" +Models: + Fluid: + UUID: '1ae66d8c-1ba1-4211-ad12-b9917573b202' + Density: "0 kg/m^3" + DynamicViscosity: "0 kg/m/s" + KinematicViscosity: "0 m^2/s" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "0 J/kg/K" + ThermalConductivity: "0 W/m/K" + ThermalExpansionCoefficient: "0 1/K" diff --git a/src/Mod/Material/Resources/Materials/FluidMaterial/Water.FCMat b/src/Mod/Material/Resources/Materials/FluidMaterial/Water.FCMat new file mode 100644 index 0000000000..aa4c8d35cc --- /dev/null +++ b/src/Mod/Material/Resources/Materials/FluidMaterial/Water.FCMat @@ -0,0 +1,26 @@ +# File created by ConvertFCMat.py +General: + UUID: "7e5559d5-be15-4571-a72f-20c39edd41cf" + Name: "Water" + Description: "Standard distilled water properties at 20 Degrees Celsius and 1 atm" + ReferenceSource: "''" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Gas" + Fluid: + UUID: '1ae66d8c-1ba1-4211-ad12-b9917573b202' + Density: "998 kg/m^3" + DynamicViscosity: "1.003e-3 kg/m/s" + KinematicViscosity: "1.005e-6 m^2/s" + PrandtlNumber: "7.56" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "4182 J/kg/K" + ThermalConductivity: "0.591 W/m/K" + ThermalExpansionCoefficient: "2.07e-4 m/m/K" + Electromagnetic: + UUID: 'b2eb5f48-74b3-4193-9fbb-948674f427f3' + RelativePermittivity: "80.0" + ElectricalConductivity: "5.5e-6 S/m" + RelativePermeability: "0.999992" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Aggregate/Concrete-EN-C35_45.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Aggregate/Concrete-EN-C35_45.FCMat new file mode 100644 index 0000000000..fa6eabb71f --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Aggregate/Concrete-EN-C35_45.FCMat @@ -0,0 +1,23 @@ +# File created by ConvertFCMat.py +General: + UUID: "dba76940-a910-4a3b-ab73-a9f412ac69d9" + AuthorAndLicense: "(c) 2019 Bernd Hahnebach (CC-BY 3.0)" + Name: "Concrete-EN-C35/45" + Description: "Concrete matrix for reinforcement material examples, 0.6 x 0.75 x 35 MPa = 15.75 MPa (https://forum.freecad.org/viewtopic.php?f=18&t=33106&start=200#p311075)" +Inherits: + Stone: + UUID: "a9f54d61-cc98-46df-8734-b0543ceb4e45" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Aggregate" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + AngleOfFriction: "30 deg" + CompressiveStrength: "15.75 MPa" + Density: "2500 kg/m^3" + PoissonRatio: "0.17" + YoungsModulus: "32000 MPa" + Costs: + UUID: '881df808-8726-4c2e-be38-688bb6cce466' + ProductURL: "https://en.wikipedia.org/wiki/Concrete" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Aggregate/Concrete-Generic.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Aggregate/Concrete-Generic.FCMat new file mode 100644 index 0000000000..994874548d --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Aggregate/Concrete-Generic.FCMat @@ -0,0 +1,25 @@ +# File created by ConvertFCMat.py +General: + UUID: "26042aa5-56e6-4d99-8b63-dd8b9ea5a37a" + AuthorAndLicense: "(c) 2013 Yorik van Havre (CC-BY 3.0)" + Name: "Concrete" + Description: "A standard C-25 construction concrete" +Inherits: + Stone: + UUID: "a9f54d61-cc98-46df-8734-b0543ceb4e45" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Aggregate" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + StandardCode: "Masterformat 03 33 13" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + CompressiveStrength: "25 MPa" + Density: "2400 kg/m^3" + PoissonRatio: "0.17" + YoungsModulus: "32000 MPa" + Costs: + UUID: '881df808-8726-4c2e-be38-688bb6cce466' + ProductURL: "https://en.wikipedia.org/wiki/Concrete" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Aggregate/Reinforcement-FIB-B500.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Aggregate/Reinforcement-FIB-B500.FCMat new file mode 100644 index 0000000000..13ac6afc77 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Aggregate/Reinforcement-FIB-B500.FCMat @@ -0,0 +1,16 @@ +# File created by ConvertFCMat.py +General: + UUID: "57507cd4-d22f-4d86-9794-fdb1ec8cd098" + AuthorAndLicense: "(c) 2019 Bernd Hahnebach (CC-BY 3.0)" + Name: "Reinforcement-Harry" + Description: "Reinforcement inside concrete for reinforcement material examples, from fib examples, 0.84 x 0.75 x 500 MPa = 315 MPa (https://forum.freecad.org/viewtopic.php?f=18&t=33106&start=200#p311705)" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7850 kg/m^3" + PoissonRatio: "0.3" + YieldStrength: "315 MPa" + YoungsModulus: "210000 MPa" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Carbon/Graphite.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Carbon/Graphite.FCMat new file mode 100644 index 0000000000..e66b987f2e --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Carbon/Graphite.FCMat @@ -0,0 +1,32 @@ +# File created by ConvertFCMat.py +General: + UUID: "5c67b675-69a2-4782-902a-bb90c3952f07" + AuthorAndLicense: "Uwe Stöhr, LGPL" + Name: "Graphite" + Description: "Typical material properties for pure graphite" + ReferenceSource: "Properties and characteristics of graphite" + SourceURL: "https://www.entegris.com/content/dam/web/resources/manuals-and-guides/manual-properties-and-characteristics-of-graphite-109441.pdf" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Carbon" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Solid" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + CompressiveStrength: "120.000 MPa" + Density: "1750.000 kg/m^3" + PoissonRatio: "0.20" + UltimateTensileStrength: "34 MPa" + YoungsModulus: "11.7 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "0.72 kJ/kg/K" + ThermalConductivity: "96.000 W/m/K" + ThermalExpansionCoefficient: "8e-6 1/K" + Electromagnetic: + UUID: 'b2eb5f48-74b3-4193-9fbb-948674f427f3' + RelativePermittivity: "0.7" + ElectricalConductivity: "2e4 S/m" + RelativePermeability: "1.0" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Glass/Glass-E-GlassFibre.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Glass/Glass-E-GlassFibre.FCMat new file mode 100644 index 0000000000..034f5271f0 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Glass/Glass-E-GlassFibre.FCMat @@ -0,0 +1,18 @@ +# File created by ConvertFCMat.py +General: + UUID: "a02bf9d7-6e3e-4e36-881b-10779ee9f706" + AuthorAndLicense: "(c) 2015 DaviKaur (CC-BY 3.0)" + Name: "Glass-E" + Description: "Glass Fibre" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Glass" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + CompressiveStrength: "1080 MPa" + Density: "2580 kg/m^3" + UltimateTensileStrength: "3445 MPa" + Costs: + UUID: '881df808-8726-4c2e-be38-688bb6cce466' + ProductURL: "https://en.wikipedia.org/wiki/Glass_fiber" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Glass/Glass-Generic.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Glass/Glass-Generic.FCMat new file mode 100644 index 0000000000..1502a1e85b --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Glass/Glass-Generic.FCMat @@ -0,0 +1,23 @@ +# File created by ConvertFCMat.py +General: + UUID: "3e3a3e13-04a4-410e-8e36-bbd83ca66847" + AuthorAndLicense: "(c) 2015 Przemo Firszt (CC-BY 3.0)" + Name: "Glass" + Description: "Generic soda-lime glass" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Glass" + Density: + UUID: '454661e5-265b-4320-8e6f-fcf6223ac3af' + Density: "2520 kg/m^3" + IsotropicLinearElastic: + UUID: 'f6f9e48c-b116-4e82-ad7f-3659a9219c50' + PoissonRatio: "0.22" + YoungsModulus: "72000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000009 m/m/K" + Costs: + UUID: '881df808-8726-4c2e-be38-688bb6cce466' + ProductURL: "https://en.wikipedia.org/wiki/Soda-lime_glass" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Glass/Glass-S2-GlassFibre.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Glass/Glass-S2-GlassFibre.FCMat new file mode 100644 index 0000000000..79d993d62d --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Glass/Glass-S2-GlassFibre.FCMat @@ -0,0 +1,18 @@ +# File created by ConvertFCMat.py +General: + UUID: "0c4943e0-248b-4df9-88d9-3b4dd84dfc68" + AuthorAndLicense: "(c) 2015 DaviKaur (CC-BY 3.0)" + Name: "Glass-S2" + Description: "Glass Fibre" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Glass" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + CompressiveStrength: "1600 MPa" + Density: "2460 kg/m^3" + UltimateTensileStrength: "4890 MPa" + Costs: + UUID: '881df808-8726-4c2e-be38-688bb6cce466' + ProductURL: "https://en.wikipedia.org/wiki/Glass_fiber" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Alloys/Invar-Generic.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Alloys/Invar-Generic.FCMat new file mode 100644 index 0000000000..1653bde1ae --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Alloys/Invar-Generic.FCMat @@ -0,0 +1,27 @@ +# File created by ConvertFCMat.py +General: + UUID: "27745e16-2a10-4c8e-bd22-59971806909c" + AuthorAndLicense: "Uwe Stöhr" + Name: "Invar Generic" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Nickel Iron Alloy" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "8150 kg/m^3" + PoissonRatio: "0.29" + ShearModulus: "56.0 GPa" + UltimateTensileStrength: "600 MPa" + YoungsModulus: "140.0 GPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "515.0 J/kg/K" + ThermalConductivity: "13.5 W/m/K" + ThermalExpansionCoefficient: "1.25 µm/m/K" + Electromagnetic: + UUID: 'b2eb5f48-74b3-4193-9fbb-948674f427f3' + ElectricalConductivity: "1250000 S/m" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Aluminum/AlMg3F24.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Aluminum/AlMg3F24.FCMat new file mode 100644 index 0000000000..d3ea2edf4c --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Aluminum/AlMg3F24.FCMat @@ -0,0 +1,31 @@ +# File created by ConvertFCMat.py +General: + UUID: "0051bddf-6f62-4406-b8c9-569322880564" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "AlMg3F24" +Inherits: + Aluminum: + UUID: "d1f317f0-5ffa-4798-8ab3-af2ff0b5182c" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Aluminium" + MaterialNumber: "3.3535.26" + StandardCode: "DIN 1725" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "2700 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "27000 MPa" + UltimateStrain: "5" + UltimateTensileStrength: "250 MPa" + YieldStrength: "180 MPa" + YoungsModulus: "70000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "900 J/kg/K" + ThermalConductivity: "150 W/m/K" + ThermalExpansionCoefficient: "23 µm/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Aluminum/AlMgSi1F31.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Aluminum/AlMgSi1F31.FCMat new file mode 100644 index 0000000000..ce7ad3a053 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Aluminum/AlMgSi1F31.FCMat @@ -0,0 +1,31 @@ +# File created by ConvertFCMat.py +General: + UUID: "460e02a3-b6cd-4662-b2f6-8c9d44146c66" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "AlMgSi1F31" +Inherits: + Aluminum: + UUID: "d1f317f0-5ffa-4798-8ab3-af2ff0b5182c" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Aluminium" + MaterialNumber: "3.2315.72" + StandardCode: "DIN 1725" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "2700 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "27000 MPa" + UltimateStrain: "10" + UltimateTensileStrength: "310 MPa" + YieldStrength: "260 MPa" + YoungsModulus: "70000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "896 J/kg/K" + ThermalConductivity: "160 W/m/K" + ThermalExpansionCoefficient: "23 µm/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Aluminum/AlZn4-5Mg1F35.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Aluminum/AlZn4-5Mg1F35.FCMat new file mode 100644 index 0000000000..9ff117b0ed --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Aluminum/AlZn4-5Mg1F35.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "05f8f1b2-b92b-4e41-8de9-1e064e78a165" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "AlZn4,5Mg1F35" +Inherits: + Aluminum: + UUID: "d1f317f0-5ffa-4798-8ab3-af2ff0b5182c" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Aluminium" + MaterialNumber: "3.4335.71" + StandardCode: "DIN 1725" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "2700 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "27000 MPa" + UltimateStrain: "10" + UltimateTensileStrength: "350 MPa" + YieldStrength: "290 MPa" + YoungsModulus: "70000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000023 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Aluminum/Aluminum-6061-T6.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Aluminum/Aluminum-6061-T6.FCMat new file mode 100644 index 0000000000..648350b109 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Aluminum/Aluminum-6061-T6.FCMat @@ -0,0 +1,28 @@ +# File created by ConvertFCMat.py +General: + UUID: "68b152b2-fd5e-4f10-8db0-1a2df3fe0fda" + AuthorAndLicense: "(c) 2016 Mandeep Singh (CC-BY 3.0)" + Name: "Aluminum 6061-T6" + Description: "Precipitation-hardened, Nonferrous Aluminum alloy" +Inherits: + Aluminum: + UUID: "d1f317f0-5ffa-4798-8ab3-af2ff0b5182c" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Aluminium" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "2700 kg/m^3" + PoissonRatio: "0.33" + UltimateTensileStrength: "310 MPa" + YoungsModulus: "69000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalConductivity: "167 W/m/K" + Costs: + UUID: '881df808-8726-4c2e-be38-688bb6cce466' + ProductURL: "https://en.wikipedia.org/wiki/6061_aluminium_alloy" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Aluminum/Aluminum-Generic.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Aluminum/Aluminum-Generic.FCMat new file mode 100644 index 0000000000..c518eaf674 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Aluminum/Aluminum-Generic.FCMat @@ -0,0 +1,31 @@ +# File created by ConvertFCMat.py +General: + UUID: "9bf060e9-1663-44a2-88e2-2ff6ee858efe" + AuthorAndLicense: "Uwe Stöhr" + Name: "Aluminum Generic" +Inherits: + Aluminum: + UUID: "d1f317f0-5ffa-4798-8ab3-af2ff0b5182c" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Aluminium" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "2700 kg/m^3" + PoissonRatio: "0.35" + ShearModulus: "25.0 GPa" + UltimateTensileStrength: "310 MPa" + YoungsModulus: "70000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "897.0 J/kg/K" + ThermalConductivity: "237.0 W/m/K" + ThermalExpansionCoefficient: "23.1 µm/m/K" + Electromagnetic: + UUID: 'b2eb5f48-74b3-4193-9fbb-948674f427f3' + ElectricalConductivity: "370370.4 S/m" + RelativePermeability: "1.0" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Copper/Copper-Generic.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Copper/Copper-Generic.FCMat new file mode 100644 index 0000000000..8188c3a553 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Copper/Copper-Generic.FCMat @@ -0,0 +1,32 @@ +# File created by ConvertFCMat.py +General: + UUID: "6c03899d-496e-4c60-a41b-3d66f2337fb9" + AuthorAndLicense: "Uwe Stöhr" + Name: "Copper Generic" +Inherits: + Copper: + UUID: "524cad9b-b841-4037-9851-badeca7dcee2" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Copper" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "8960 kg/m^3" + PoissonRatio: "0.343" + ShearModulus: "46.0 GPa" + UltimateTensileStrength: "210 MPa" + YieldStrength: "33.3 MPa" + YoungsModulus: "119 GPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "385.0 J/kg/K" + ThermalConductivity: "398.0 W/m/K" + ThermalExpansionCoefficient: "16.5 µm/m/K" + Electromagnetic: + UUID: 'b2eb5f48-74b3-4193-9fbb-948674f427f3' + ElectricalConductivity: "59.59 MS/m" + RelativePermeability: "0.999994" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Iron/Iron-Generic.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Iron/Iron-Generic.FCMat new file mode 100644 index 0000000000..f99d52a37f --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Iron/Iron-Generic.FCMat @@ -0,0 +1,32 @@ +# File created by ConvertFCMat.py +General: + UUID: "1826c364-d26a-43fb-8f61-288281236836" + AuthorAndLicense: "Uwe Stöhr" + Name: "Iron Generic" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Iron" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7874 kg/m^3" + PoissonRatio: "0.29" + ShearModulus: "82.0 GPa" + UltimateTensileStrength: "497 MPa" + YieldStrength: "428 MPa" + YoungsModulus: "211 GPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "460.5 J/kg/K" + ThermalConductivity: "80.4 W/m/K" + ThermalExpansionCoefficient: "11.8 µm/m/K" + Electromagnetic: + UUID: 'b2eb5f48-74b3-4193-9fbb-948674f427f3' + ElectricalConductivity: "10.3 MS/m" + RelativePermeability: "5000.0" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/CalculiX-Steel.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/CalculiX-Steel.FCMat new file mode 100644 index 0000000000..7763a27728 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/CalculiX-Steel.FCMat @@ -0,0 +1,25 @@ +# File created by ConvertFCMat.py +General: + UUID: "92589471-a6cb-4bbc-b748-d425a17dea7d" + AuthorAndLicense: "(c) 2013 Juergen Riegel (CC-BY 3.0)" + Name: "CalculiX-Steel" + Description: "Standard steel material for CalculiX sample calculations" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + Density: + UUID: '454661e5-265b-4320-8e6f-fcf6223ac3af' + Density: "7900 kg/m^3" + IsotropicLinearElastic: + UUID: 'f6f9e48c-b116-4e82-ad7f-3659a9219c50' + PoissonRatio: "0.3" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "590 J/kg/K" + ThermalConductivity: "43 W/m/K" + ThermalExpansionCoefficient: "0.000012 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-15CrNi6.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-15CrNi6.FCMat new file mode 100644 index 0000000000..c1be13ce98 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-15CrNi6.FCMat @@ -0,0 +1,30 @@ +# File created by ConvertFCMat.py +General: + UUID: "6822df30-db32-4a68-a8d7-aaddcb9649d1" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "15CrNi6" + Description: "High-strength carbon steel" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Case-hardened steel" + MaterialNumber: "1.5919" + StandardCode: "EN 10084" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "9" + UltimateTensileStrength: "1000 MPa" + YieldStrength: "680 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-17CrNiMo6.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-17CrNiMo6.FCMat new file mode 100644 index 0000000000..462e784536 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-17CrNiMo6.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "e4c76f15-00af-4498-ac57-beaf49c150e9" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "17CrNiMo6" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Case-hardened steel" + MaterialNumber: "1.6587" + StandardCode: "EN 10084" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "8" + UltimateTensileStrength: "1150 MPa" + YieldStrength: "830 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-1C22.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-1C22.FCMat new file mode 100644 index 0000000000..f36307b08d --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-1C22.FCMat @@ -0,0 +1,30 @@ +# File created by ConvertFCMat.py +General: + UUID: "c424fe3d-5f49-4c39-9467-8a2a800076aa" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "1C22" + Description: "Case hardened alloy steel" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Heat-treatable steel" + MaterialNumber: "1.0402" + StandardCode: "EN 10083-1" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "27" + UltimateTensileStrength: "400 MPa" + YieldStrength: "230 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-1C35.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-1C35.FCMat new file mode 100644 index 0000000000..8cc577729a --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-1C35.FCMat @@ -0,0 +1,30 @@ +# File created by ConvertFCMat.py +General: + UUID: "cd932bad-4085-459f-aea6-1da737ae38ae" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "1C35" + Description: "Non-alloy quality steel" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Heat-treatable steel" + MaterialNumber: "1.0501" + StandardCode: "EN 10083-1" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "21" + UltimateTensileStrength: "480 MPa" + YieldStrength: "300 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-1C45.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-1C45.FCMat new file mode 100644 index 0000000000..9433799bcb --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-1C45.FCMat @@ -0,0 +1,30 @@ +# File created by ConvertFCMat.py +General: + UUID: "958b7a5c-4764-4a2f-a450-2153a41fb5ec" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "1C45" + Description: "Non-alloy quality steel" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Heat-treatable steel" + MaterialNumber: "1.0503" + StandardCode: "EN 10083-1" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "14" + UltimateTensileStrength: "580 MPa" + YieldStrength: "340 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-1C60.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-1C60.FCMat new file mode 100644 index 0000000000..dac83e2809 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-1C60.FCMat @@ -0,0 +1,30 @@ +# File created by ConvertFCMat.py +General: + UUID: "9717f953-1cfc-41a6-8974-3ad45188ad48" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "1C60" + Description: "Non-alloy quality steel" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Heat-treatable steel" + MaterialNumber: "1.0601" + StandardCode: "EN 10083-1" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "11" + UltimateTensileStrength: "650 MPa" + YieldStrength: "380 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-20NiCrMo2.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-20NiCrMo2.FCMat new file mode 100644 index 0000000000..f63fc2cd6b --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-20NiCrMo2.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "1c759697-7aef-4a14-92c5-5bf84b99a4f0" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "20NiCrMo2" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Case-hardened steel" + MaterialNumber: "1.6523" + StandardCode: "EN 10084" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "10" + UltimateTensileStrength: "900 MPa" + YieldStrength: "630 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-28Mn6.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-28Mn6.FCMat new file mode 100644 index 0000000000..5166ff1d58 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-28Mn6.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "6894c597-5771-4b56-825f-ce7d5e4689f4" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "28Mn6" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Heat-treatable steel" + MaterialNumber: "1.117" + StandardCode: "EN 10083-1" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "13" + UltimateTensileStrength: "800 MPa" + YieldStrength: "590 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-2C10.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-2C10.FCMat new file mode 100644 index 0000000000..bb25674809 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-2C10.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "a7be39a1-1686-4fee-a1d5-81ef73b82d16" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "2C10" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Case-hardened steel" + MaterialNumber: "1.1121" + StandardCode: "EN 10084" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "0" + UltimateTensileStrength: "640 MPa" + YieldStrength: "390 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-30CrNiMo8.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-30CrNiMo8.FCMat new file mode 100644 index 0000000000..b8edc93d8e --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-30CrNiMo8.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "a6d96264-affc-4406-9816-75099c1fa0d9" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "30CrNiMo8" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Heat-treatable steel" + MaterialNumber: "1.658" + StandardCode: "EN 10083-1" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "9" + UltimateTensileStrength: "1250 MPa" + YieldStrength: "1050 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-34CrNiMo6.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-34CrNiMo6.FCMat new file mode 100644 index 0000000000..4c02195cf8 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-34CrNiMo6.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "e69448d5-2517-4c00-9e70-ebeb11ca017f" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "34CrNiMo6" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Heat-treatable steel" + MaterialNumber: "1.6582" + StandardCode: "EN 10083-1" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "9" + UltimateTensileStrength: "1200 MPa" + YieldStrength: "1000 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-36CrNiMo4.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-36CrNiMo4.FCMat new file mode 100644 index 0000000000..f1635de298 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-36CrNiMo4.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "3e78b767-5530-4d69-a541-cf33a5a2ad19" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "36CrNiMo4" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Heat-treatable steel" + MaterialNumber: "1.6511" + StandardCode: "EN 10083-1" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "10" + UltimateTensileStrength: "1100 MPa" + YieldStrength: "900 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-36NiCrMo16.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-36NiCrMo16.FCMat new file mode 100644 index 0000000000..1a9e29753a --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-36NiCrMo16.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "3fdf729c-bec4-4bfa-ba94-b0c9e51a2040" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "36NiCrMo16" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Heat-treatable steel" + MaterialNumber: "1.6773" + StandardCode: "EN 10083-1" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "9" + UltimateTensileStrength: "1250 MPa" + YieldStrength: "1050 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-3C15.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-3C15.FCMat new file mode 100644 index 0000000000..6ad2a41287 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-3C15.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "605fd7b6-caa3-400d-b6d7-ed52c0f5da21" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "3C15" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Case-hardened steel" + MaterialNumber: "1.114" + StandardCode: "EN 10084" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "0" + UltimateTensileStrength: "740 MPa" + YieldStrength: "440 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-3C22.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-3C22.FCMat new file mode 100644 index 0000000000..19c035f0a4 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-3C22.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "7313f076-faf4-41dd-8dae-1b9a586990dc" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "3C22" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Heat-treatable steel" + MaterialNumber: "1.1149" + StandardCode: "EN 10083-1" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "24" + UltimateTensileStrength: "550 MPa" + YieldStrength: "350 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-3C35.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-3C35.FCMat new file mode 100644 index 0000000000..583523ea88 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-3C35.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "251cc54e-4a5a-4cd3-9c9e-006c416d7ce9" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "3C35" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Heat-treatable steel" + MaterialNumber: "1.118" + StandardCode: "EN 10083-1" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "17" + UltimateTensileStrength: "630 MPa" + YieldStrength: "430 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-3V45.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-3V45.FCMat new file mode 100644 index 0000000000..193f19e1b9 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-3V45.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "d2e12a80-fd17-42db-99d8-62971f65ee84" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "3V45" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Heat-treatable steel" + MaterialNumber: "1.1201" + StandardCode: "EN 10083-1" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "14" + UltimateTensileStrength: "700 MPa" + YieldStrength: "500 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C10.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C10.FCMat new file mode 100644 index 0000000000..b72f563c88 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C10.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "9086ae2f-3b2e-4654-9665-0fe31effb8a2" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "C10" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Case-hardened steel" + MaterialNumber: "1.0301" + StandardCode: "DIN 17210" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "16" + UltimateTensileStrength: "650 MPa" + YieldStrength: "380 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C15.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C15.FCMat new file mode 100644 index 0000000000..6a11819478 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C15.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "06ae5c92-de7b-46c9-984d-4dd87964bc5c" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "C15" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Case-hardened steel" + MaterialNumber: "1.0401" + StandardCode: "DIN 17210" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "14" + UltimateTensileStrength: "750 MPa" + YieldStrength: "430 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C22E.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C22E.FCMat new file mode 100644 index 0000000000..932930426e --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C22E.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "befa2489-dba0-41c5-aa83-7cca2ac8947b" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "C22E" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Heat-treatable steel" + MaterialNumber: "1.1151" + StandardCode: "EN 10083-1" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "20" + UltimateTensileStrength: "500 MPa" + YieldStrength: "340 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C25E.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C25E.FCMat new file mode 100644 index 0000000000..12f65b3acc --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C25E.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "b95d3de5-36af-41cd-a6dd-3f647b1d4eee" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "C25E" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Heat-treatable steel" + MaterialNumber: "1.1158" + StandardCode: "EN 10083-1" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "19" + UltimateTensileStrength: "550 MPa" + YieldStrength: "370 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C30E.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C30E.FCMat new file mode 100644 index 0000000000..d6cfe2d8c3 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C30E.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "e88e1e86-fad2-4c70-b185-4b2975e7fba5" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "C30E" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Heat-treatable steel" + MaterialNumber: "1.1178" + StandardCode: "EN 10083-1" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "18" + UltimateTensileStrength: "600 MPa" + YieldStrength: "400 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C40E.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C40E.FCMat new file mode 100644 index 0000000000..c777dc3028 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C40E.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "5b33f177-b0da-4ffa-acb5-a3b23ab6e630" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "C40E" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Heat-treatable steel" + MaterialNumber: "1.1186" + StandardCode: "EN 10083-1" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "16" + UltimateTensileStrength: "650 MPa" + YieldStrength: "460 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C50E.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C50E.FCMat new file mode 100644 index 0000000000..3a73bb97f7 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C50E.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "6821be5f-5471-4939-bb1d-866f83018090" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "C50E" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Heat-treatable steel" + MaterialNumber: "1.1206" + StandardCode: "EN 10083-1" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "13" + UltimateTensileStrength: "750 MPa" + YieldStrength: "520 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C55E.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C55E.FCMat new file mode 100644 index 0000000000..be4341ad95 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C55E.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "d60a21c9-9c4b-4463-b133-bb0e84ce46b2" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "C55E" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Heat-treatable steel" + MaterialNumber: "1.1203" + StandardCode: "EN 10083-1" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "13" + UltimateTensileStrength: "800 MPa" + YieldStrength: "550 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C60E.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C60E.FCMat new file mode 100644 index 0000000000..7c0c04301b --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-C60E.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "56027b3e-876e-4c0e-9f39-242feaa67e13" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "C60E" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Heat-treatable steel" + MaterialNumber: "1.1221" + StandardCode: "EN 10083-1" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "13" + UltimateTensileStrength: "850 MPa" + YieldStrength: "580 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E295-GC.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E295-GC.FCMat new file mode 100644 index 0000000000..9b314d4c01 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E295-GC.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "fc010ef8-91de-4099-9a73-605c01dd117c" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "E295 GC" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Mild steel" + MaterialNumber: "1.0533" + StandardCode: "EN 10025" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "0" + UltimateTensileStrength: "590 MPa" + YieldStrength: "420 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E295.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E295.FCMat new file mode 100644 index 0000000000..e74c218799 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E295.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "f1567a1c-995f-4feb-8baf-09ade3e830c5" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "E295" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Mild steel" + MaterialNumber: "1.005" + StandardCode: "EN 10025" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "20" + UltimateTensileStrength: "490 MPa" + YieldStrength: "295 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E335-GC.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E335-GC.FCMat new file mode 100644 index 0000000000..9612056c9b --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E335-GC.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "ab901ecc-d880-4cb4-b400-dbe4fd9b0f0a" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "E335 GC" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Mild steel" + MaterialNumber: "1.0543" + StandardCode: "EN 10025" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "0" + UltimateTensileStrength: "690 MPa" + YieldStrength: "490 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E335.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E335.FCMat new file mode 100644 index 0000000000..7ca7e2a764 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E335.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "da418876-f80e-4793-8fc8-a6040a694389" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "E335" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Mild steel" + MaterialNumber: "1.006" + StandardCode: "EN 10025" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "16" + UltimateTensileStrength: "590 MPa" + YieldStrength: "335 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E360-GC.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E360-GC.FCMat new file mode 100644 index 0000000000..aa14d78d49 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E360-GC.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "4c311592-659b-4ef0-bac9-5cffe9e70612" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "E360 GC" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Mild steel" + MaterialNumber: "1.0633" + StandardCode: "EN 10025" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "0" + UltimateTensileStrength: "780 MPa" + YieldStrength: "560 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E360.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E360.FCMat new file mode 100644 index 0000000000..6ed1535ce0 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-E360.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "dfba065e-2bfb-4fe3-8eec-dfb1cb6274fe" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "E360" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Mild steel" + MaterialNumber: "1.007" + StandardCode: "EN 10025" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "11" + UltimateTensileStrength: "690 MPa" + YieldStrength: "360 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-100.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-100.FCMat new file mode 100644 index 0000000000..282a042e41 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-100.FCMat @@ -0,0 +1,28 @@ +# File created by ConvertFCMat.py +General: + UUID: "5a1d56e3-8180-4f81-a0d7-887fb08e3752" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "EN-GJL-100" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast iron" + MaterialNumber: "0.601" + StandardCode: "EN 1561" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7200 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "34000 MPa" + UltimateStrain: "0" + UltimateTensileStrength: "100 MPa" + YoungsModulus: "88000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.00001 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-150.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-150.FCMat new file mode 100644 index 0000000000..f4c9e2ca3c --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-150.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "7a2aa3c4-10fa-44b0-9420-37ae74207fa3" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "EN-GJL-150" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast iron" + MaterialNumber: "0.6015" + StandardCode: "EN 1561" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7200 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "37000 MPa" + UltimateStrain: "0" + UltimateTensileStrength: "150 MPa" + YieldStrength: "98 MPa" + YoungsModulus: "95000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.00001 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-200.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-200.FCMat new file mode 100644 index 0000000000..aca3e5b83a --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-200.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "8ae26e72-65b6-4f93-9fbe-9e3f17a2e1b5" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "EN-GJL-200" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast iron" + MaterialNumber: "0.602" + StandardCode: "EN 1561" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7200 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "40000 MPa" + UltimateStrain: "0" + UltimateTensileStrength: "200 MPa" + YieldStrength: "130 MPa" + YoungsModulus: "105000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.00001 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-250.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-250.FCMat new file mode 100644 index 0000000000..13d4da1f70 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-250.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "71f32e31-656e-4f94-a5f0-5b656b9367c6" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "EN-GJL-250" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast iron" + MaterialNumber: "0.6025" + StandardCode: "EN 1561" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7200 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "44000 MPa" + UltimateStrain: "0" + UltimateTensileStrength: "250 MPa" + YieldStrength: "165 MPa" + YoungsModulus: "115000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.00001 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-300.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-300.FCMat new file mode 100644 index 0000000000..489a2e3c24 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-300.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "6db01463-7772-4d0e-ab81-fae6d45ce669" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "EN-GJL-300" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast iron" + MaterialNumber: "0.603" + StandardCode: "EN 1561" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7200 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "48000 MPa" + UltimateStrain: "0" + UltimateTensileStrength: "300 MPa" + YieldStrength: "195 MPa" + YoungsModulus: "125000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.00001 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-350.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-350.FCMat new file mode 100644 index 0000000000..9922275365 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJL-350.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "c4ff4bef-4885-41d5-904f-9c71a8018c98" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "EN-GJL-350" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast iron" + MaterialNumber: "0.6035" + StandardCode: "EN 1561" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7200 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "52000 MPa" + UltimateStrain: "15" + UltimateTensileStrength: "350 MPa" + YieldStrength: "228 MPa" + YoungsModulus: "135000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.00001 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMB-350-10.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMB-350-10.FCMat new file mode 100644 index 0000000000..05dc53a302 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMB-350-10.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "eec1833a-424a-4c4f-bdf2-6f8377845d54" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "EN-GJMB-350-10" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast iron" + MaterialNumber: "0.8135" + StandardCode: "EN 1562" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7200 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "67000 MPa" + UltimateStrain: "10" + UltimateTensileStrength: "350 MPa" + YieldStrength: "200 MPa" + YoungsModulus: "175000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.00001 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMB-550-4.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMB-550-4.FCMat new file mode 100644 index 0000000000..7e8b518d5c --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMB-550-4.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "095140bb-df01-4bb9-8ff3-062aa91ec48c" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "EN-GJMB-550-4" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast iron" + MaterialNumber: "0.8155" + StandardCode: "EN 1562" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7200 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "67000 MPa" + UltimateStrain: "2" + UltimateTensileStrength: "550 MPa" + YieldStrength: "340 MPa" + YoungsModulus: "175000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.00001 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMB-650-2.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMB-650-2.FCMat new file mode 100644 index 0000000000..d22fcd93ad --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMB-650-2.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "490a348c-f508-4599-a5e0-2f6b211126d5" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "EN-GJMB-650-2" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast iron" + MaterialNumber: "0.8165" + StandardCode: "EN 1562" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7200 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "67000 MPa" + UltimateStrain: "2" + UltimateTensileStrength: "650 MPa" + YieldStrength: "430 MPa" + YoungsModulus: "175000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.00001 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMW-350-4.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMW-350-4.FCMat new file mode 100644 index 0000000000..148e26a9b3 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMW-350-4.FCMat @@ -0,0 +1,28 @@ +# File created by ConvertFCMat.py +General: + UUID: "a97c3eab-a1e8-472b-ba40-519a0d660019" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "EN-GJMW-350-4" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast iron" + MaterialNumber: "0.8035" + StandardCode: "EN 1562" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7200 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "67000 MPa" + UltimateStrain: "4" + UltimateTensileStrength: "350 MPa" + YoungsModulus: "175000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.00001 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMW-360-12.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMW-360-12.FCMat new file mode 100644 index 0000000000..604538d200 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMW-360-12.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "81a865af-79b6-4e0b-98ad-5cde134ad99e" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "EN-GJMW-360-12" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast iron" + MaterialNumber: "0.8038" + StandardCode: "EN 1562" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7200 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "67000 MPa" + UltimateStrain: "5" + UltimateTensileStrength: "380 MPa" + YieldStrength: "200 MPa" + YoungsModulus: "175000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.00001 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMW-400-5.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMW-400-5.FCMat new file mode 100644 index 0000000000..db74ef871c --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMW-400-5.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "9d71fc9c-960a-47e8-afa8-a86a24b3ff89" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "EN-GJMW-400-5" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast iron" + MaterialNumber: "0.804" + StandardCode: "EN 1562" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7200 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "67000 MPa" + UltimateStrain: "7" + UltimateTensileStrength: "400 MPa" + YieldStrength: "220 MPa" + YoungsModulus: "175000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.00001 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMW-450-7.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMW-450-7.FCMat new file mode 100644 index 0000000000..0e6de5ac4e --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJMW-450-7.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "c0eedc49-d63b-429d-be63-ef0ea442f45c" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "EN-GJMW-450-7" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast iron" + MaterialNumber: "0.8045" + StandardCode: "EN 1562" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7200 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "67000 MPa" + UltimateStrain: "10" + UltimateTensileStrength: "450 MPa" + YieldStrength: "260 MPa" + YoungsModulus: "175000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.00001 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-400-15.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-400-15.FCMat new file mode 100644 index 0000000000..ab7c0b2163 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-400-15.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "f6300691-ecf0-4846-acb1-8c2bad3359a8" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "EN-GJS-400-15" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast iron" + MaterialNumber: "0.704" + StandardCode: "EN 1563" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7200 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "65000 MPa" + UltimateStrain: "15" + UltimateTensileStrength: "400 MPa" + YieldStrength: "250 MPa" + YoungsModulus: "167000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-500-7.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-500-7.FCMat new file mode 100644 index 0000000000..5a28f4356f --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-500-7.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "51aabe6f-642b-4f47-9006-1c8c3613a422" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "EN-GJS-500-7" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast iron" + MaterialNumber: "0.705" + StandardCode: "EN 1563" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7200 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "66000 MPa" + UltimateStrain: "2" + UltimateTensileStrength: "500 MPa" + YieldStrength: "320 MPa" + YoungsModulus: "170000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-600-3.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-600-3.FCMat new file mode 100644 index 0000000000..0f3f5d7ed9 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-600-3.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "eb573f18-5a7b-493b-bfda-d711f03f7f71" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "EN-GJS-600-3" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast iron" + MaterialNumber: "0.706" + StandardCode: "EN 1563" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7200 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "67000 MPa" + UltimateStrain: "2" + UltimateTensileStrength: "600 MPa" + YieldStrength: "370 MPa" + YoungsModulus: "177000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-700-2.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-700-2.FCMat new file mode 100644 index 0000000000..28c327f104 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-700-2.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "9a194e62-d2e4-466d-92ba-2707107c4e3c" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "EN-GJS-700-2" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast iron" + MaterialNumber: "0.707" + StandardCode: "EN 1563" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7200 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "67000 MPa" + UltimateStrain: "2" + UltimateTensileStrength: "700 MPa" + YieldStrength: "420 MPa" + YoungsModulus: "180000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-800-1.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-800-1.FCMat new file mode 100644 index 0000000000..071d813334 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-EN-GJS-800-1.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "97c444f9-83ae-48d8-98e5-603349d06f7e" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "EN-GJS-800-1" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast iron" + MaterialNumber: "0.708" + StandardCode: "EN 1563" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7200 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "67000 MPa" + UltimateStrain: "2" + UltimateTensileStrength: "800 MPa" + YieldStrength: "480 MPa" + YoungsModulus: "180000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G16Mn5.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G16Mn5.FCMat new file mode 100644 index 0000000000..97d45db1ae --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G16Mn5.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "fc5c14ba-4885-4c75-aaf6-0ec4f2365f40" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "G16Mn5" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast steel" + MaterialNumber: "1.1131" + StandardCode: "DIN 1681" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "0" + UltimateTensileStrength: "430 MPa" + YieldStrength: "260 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G200.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G200.FCMat new file mode 100644 index 0000000000..51965ab4d2 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G200.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "8d799def-e941-4cb6-b48d-72b9a292fafe" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "G200" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast steel" + MaterialNumber: "1.042" + StandardCode: "DIN 1681" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "25" + UltimateTensileStrength: "380 MPa" + YieldStrength: "200 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G20Mn5.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G20Mn5.FCMat new file mode 100644 index 0000000000..7e1e9c8e6d --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G20Mn5.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "d384d1e5-e2fe-4e09-9a0f-78e5670425ee" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "G20Mn5" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast steel" + MaterialNumber: "1.112" + StandardCode: "DIN 1681" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "0" + UltimateTensileStrength: "500 MPa" + YieldStrength: "360 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G230.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G230.FCMat new file mode 100644 index 0000000000..2c11dcd9f6 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G230.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "53931707-6fe7-4ac0-ac7a-e9ddfec70fa5" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "G230" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast steel" + MaterialNumber: "1.0446" + StandardCode: "DIN 1681" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "22" + UltimateTensileStrength: "450 MPa" + YieldStrength: "230 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G260.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G260.FCMat new file mode 100644 index 0000000000..4c4b62744e --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G260.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "22971112-d137-4db1-9349-edf5e281e333" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "G260" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast steel" + MaterialNumber: "1.0552" + StandardCode: "DIN 1681" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "18" + UltimateTensileStrength: "520 MPa" + YieldStrength: "260 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G300.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G300.FCMat new file mode 100644 index 0000000000..8c0acbd1cd --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G300.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "33f1c891-7488-4324-9af9-cbdde6726b49" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "G300" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast steel" + MaterialNumber: "1.0558" + StandardCode: "DIN 1681" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "15" + UltimateTensileStrength: "600 MPa" + YieldStrength: "300 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G30Mn5.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G30Mn5.FCMat new file mode 100644 index 0000000000..bb11cbee52 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-G30Mn5.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "e03df70c-ceb8-4317-825d-1195c8c178d0" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "G30Mn5" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cast steel" + MaterialNumber: "1.1165" + StandardCode: "DIN 17205" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "14" + UltimateTensileStrength: "520 MPa" + YieldStrength: "400 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-Generic.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-Generic.FCMat new file mode 100644 index 0000000000..c2fead712a --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-Generic.FCMat @@ -0,0 +1,28 @@ +# File created by ConvertFCMat.py +General: + UUID: "90bbd8ef-8623-4d78-b3bf-e0bdb9b74dd3" + AuthorAndLicense: "(c) 2013 Juergen Riegel (CC-BY 3.0)" + Name: "Steel-Generic" + Description: "This is a blend Steel material card. The values are at the low end of the spectrum. If you need a more precise material definition use the more specialised steel cards." +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + Density: + UUID: '454661e5-265b-4320-8e6f-fcf6223ac3af' + Density: "7900 kg/m^3" + IsotropicLinearElastic: + UUID: 'f6f9e48c-b116-4e82-ad7f-3659a9219c50' + PoissonRatio: "0.3" + YoungsModulus: "200000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "500 J/kg/K" + ThermalConductivity: "50 W/m/K" + ThermalExpansionCoefficient: "0.000012 m/m/K" + Costs: + UUID: '881df808-8726-4c2e-be38-688bb6cce466' + ProductURL: "https://en.wikipedia.org/wiki/Steel" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S185.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S185.FCMat new file mode 100644 index 0000000000..ebba16c9d5 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S185.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "6f32981a-7bbf-49a1-842c-7567a195fa7e" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "S185" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Mild steel" + MaterialNumber: "1.0035" + StandardCode: "EN 10025" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "18" + UltimateTensileStrength: "310 MPa" + YieldStrength: "190 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S235JO.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S235JO.FCMat new file mode 100644 index 0000000000..3f26e56e56 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S235JO.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "5b13e02a-b173-4e2d-95fd-a30d9e0f7cf5" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "S235JO" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Mild steel" + MaterialNumber: "1.0114" + StandardCode: "EN 10025" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "26" + UltimateTensileStrength: "360 MPa" + YieldStrength: "235 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S235JR.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S235JR.FCMat new file mode 100644 index 0000000000..5c4cf2a2ca --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S235JR.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "4a96627d-6518-458c-8ccf-846f69fd8a50" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "S235JR" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Mild steel" + MaterialNumber: "1.0037" + StandardCode: "EN 10025" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "26" + UltimateTensileStrength: "360 MPa" + YieldStrength: "235 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S235JRG1.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S235JRG1.FCMat new file mode 100644 index 0000000000..a4949171a9 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S235JRG1.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "d8cc450d-7d6d-4377-8a8d-ffe3cf30fcb2" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "S235JRG1" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Mild steel" + MaterialNumber: "1.0036" + StandardCode: "EN 10025" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "26" + UltimateTensileStrength: "360 MPa" + YieldStrength: "235 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S260NC.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S260NC.FCMat new file mode 100644 index 0000000000..09cf375caa --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S260NC.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "4994efd8-fc7b-41b3-ad61-9d98d1bdbe6e" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "S260NC" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cold forming steel" + MaterialNumber: "1.0971" + StandardCode: "SEW 092" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "30" + UltimateTensileStrength: "350 MPa" + YieldStrength: "280 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S275JO.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S275JO.FCMat new file mode 100644 index 0000000000..95a8ec460a --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S275JO.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "f9deac5f-91a4-41aa-b49c-ef09ec4613e2" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "S275JO" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Mild steel" + MaterialNumber: "1.0143" + StandardCode: "EN 10025" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "22" + UltimateTensileStrength: "430 MPa" + YieldStrength: "275 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S275JR.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S275JR.FCMat new file mode 100644 index 0000000000..9d57c21c9d --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S275JR.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "30e4da7d-1fe3-41de-911a-a42e3405bb7b" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "S275JR" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Mild steel" + MaterialNumber: "1.0044" + StandardCode: "EN 10025" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "22" + UltimateTensileStrength: "430 MPa" + YieldStrength: "275 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S275N.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S275N.FCMat new file mode 100644 index 0000000000..18c0439561 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S275N.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "07592e35-3e1a-470f-8eda-f4bee7d9cb4a" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "S275N" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Fine grain steel" + MaterialNumber: "1.049" + StandardCode: "EN 10113-2" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "24" + UltimateTensileStrength: "370 MPa" + YieldStrength: "275 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S335JO.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S335JO.FCMat new file mode 100644 index 0000000000..c8ae2510e0 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S335JO.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "c50ad549-b4f4-47ab-9bc6-4eb5191da111" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "S335JO" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Mild steel" + MaterialNumber: "1.0553" + StandardCode: "EN 10025" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "22" + UltimateTensileStrength: "510 MPa" + YieldStrength: "355 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S335JR.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S335JR.FCMat new file mode 100644 index 0000000000..931e9d418f --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S335JR.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "dbd04cee-3b92-4b79-a208-58547ebe3807" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "S335JR" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Mild steel" + MaterialNumber: "1.0045" + StandardCode: "EN 10025" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "22" + UltimateTensileStrength: "510 MPa" + YieldStrength: "355 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S335N.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S335N.FCMat new file mode 100644 index 0000000000..231271d7cd --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S335N.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "16d7f1d5-449f-4b9e-b57a-7ea114fda115" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "S335N" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Fine grain steel" + MaterialNumber: "1.0545" + StandardCode: "EN 10113-2" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "22" + UltimateTensileStrength: "470 MPa" + YieldStrength: "355 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S340MC.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S340MC.FCMat new file mode 100644 index 0000000000..a3e0a90eb4 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S340MC.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "5785ea5e-3376-47dd-8dc2-f1267c47e9bc" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "S340MC" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cold forming steel" + MaterialNumber: "1.0974" + StandardCode: "SEW 092" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "25" + UltimateTensileStrength: "480 MPa" + YieldStrength: "340 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S355J2G3.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S355J2G3.FCMat new file mode 100644 index 0000000000..71b783d323 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S355J2G3.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "b9e861ee-93fb-4eca-a2de-03579bc503c1" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "S355J2G3" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Mild steel" + MaterialNumber: "1.057" + StandardCode: "EN 10025" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "22" + UltimateTensileStrength: "510 MPa" + YieldStrength: "355 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S380MC.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S380MC.FCMat new file mode 100644 index 0000000000..aa8d2c2c94 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S380MC.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "da2a429b-8763-4586-be3d-620e7dd30271" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "S380MC" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cold forming steel" + MaterialNumber: "1.0978" + StandardCode: "SEW 092" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "23" + UltimateTensileStrength: "520 MPa" + YieldStrength: "380 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S420MC.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S420MC.FCMat new file mode 100644 index 0000000000..41b6518bed --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S420MC.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "c3452eff-f68e-4cfd-a24e-27e2abcd01ac" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "S420MC" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cold forming steel" + MaterialNumber: "1.098" + StandardCode: "EN 10149" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "21" + UltimateTensileStrength: "550 MPa" + YieldStrength: "420 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S420N.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S420N.FCMat new file mode 100644 index 0000000000..a8a2d0b6cd --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S420N.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "902f2d4a-5bd0-44bf-9c14-54462ba6778b" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "S420N" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Fine grain steel" + MaterialNumber: "1.8902" + StandardCode: "EN 10113-2" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "19" + UltimateTensileStrength: "520 MPa" + YieldStrength: "420 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S460MC.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S460MC.FCMat new file mode 100644 index 0000000000..2b972e87ef --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S460MC.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "c254dac5-3ee3-49b9-b8d4-16d20d21c94f" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "S460MC" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cold forming steel" + MaterialNumber: "1.0982" + StandardCode: "SEW 092" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "19" + UltimateTensileStrength: "590 MPa" + YieldStrength: "460 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S460N.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S460N.FCMat new file mode 100644 index 0000000000..d3c96c9639 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S460N.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "f0ae245a-1041-4674-ac4f-bf212dda6009" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "S460N" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Fine grain steel" + MaterialNumber: "1.8901" + StandardCode: "EN 10113-2" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "17" + UltimateTensileStrength: "550 MPa" + YieldStrength: "460 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S500MC.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S500MC.FCMat new file mode 100644 index 0000000000..7703c36586 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S500MC.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "ad8e2007-ee73-4b71-8830-6d40a8407284" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "S500MC" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cold forming steel" + MaterialNumber: "1.0984" + StandardCode: "EN 10149" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "17" + UltimateTensileStrength: "620 MPa" + YieldStrength: "500 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S550MC.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S550MC.FCMat new file mode 100644 index 0000000000..9ac063cd0d --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S550MC.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "b7308026-9278-4346-b157-2b3da280b61b" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "S550MC" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cold forming steel" + MaterialNumber: "1.0986" + StandardCode: "SEW 092" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "15" + UltimateTensileStrength: "680 MPa" + YieldStrength: "550 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S690MC.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S690MC.FCMat new file mode 100644 index 0000000000..1d979fd02c --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-S690MC.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "41360af5-98ed-4125-a89c-ff711e4dd2bf" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "S690MC" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Cold forming steel" + MaterialNumber: "1.0966" + StandardCode: "SEW 092" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "15" + UltimateTensileStrength: "790 MPa" + YieldStrength: "690 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-37-2K.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-37-2K.FCMat new file mode 100644 index 0000000000..0478534039 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-37-2K.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "e97be20f-246a-48b5-9718-3d39486e7af2" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "St 37-2K" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Mild steel" + MaterialNumber: "1.0161" + StandardCode: "EN 10025" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "0" + UltimateTensileStrength: "460 MPa" + YieldStrength: "320 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-255.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-255.FCMat new file mode 100644 index 0000000000..230b39f30a --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-255.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "1078eb9f-ac3e-4b24-b40e-b9ead77828e0" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "St E 255" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Fine grain steel" + MaterialNumber: "1.0461" + StandardCode: "DIN 17102" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "0" + UltimateTensileStrength: "360 MPa" + YieldStrength: "260 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-315.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-315.FCMat new file mode 100644 index 0000000000..efcc99b6f9 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-315.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "74ca3b08-d561-4440-a4c2-d9b839b66670" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "St E 315" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Fine grain steel" + MaterialNumber: "1.0505" + StandardCode: "DIN 17102" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "0" + UltimateTensileStrength: "440 MPa" + YieldStrength: "320 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-380.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-380.FCMat new file mode 100644 index 0000000000..f2d7b9df43 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-380.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "a1b62461-7abc-45da-9a3c-3068367d2990" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "St E 380" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Fine grain steel" + MaterialNumber: "1.89" + StandardCode: "DIN 17102" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "0" + UltimateTensileStrength: "500 MPa" + YieldStrength: "380 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-460.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-460.FCMat new file mode 100644 index 0000000000..9ec5596e74 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-460.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "b312ad7b-95d4-4ca5-9736-360dbed918ee" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "St E 460" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Fine grain steel" + MaterialNumber: "1.8905" + StandardCode: "DIN 17102" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "0" + UltimateTensileStrength: "560 MPa" + YieldStrength: "460 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-500.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-500.FCMat new file mode 100644 index 0000000000..7c08645652 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-St-E-500.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "90fb6bd4-05db-4d44-ba89-280b5a060921" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "St E 500" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Fine grain steel" + MaterialNumber: "1.8907" + StandardCode: "DIN 17102" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "0" + UltimateTensileStrength: "610 MPa" + YieldStrength: "500 MPa" + YoungsModulus: "210000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X2CrNiMoN17-13-3.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X2CrNiMoN17-13-3.FCMat new file mode 100644 index 0000000000..104b026672 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X2CrNiMoN17-13-3.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "a05b5f9b-27b9-4554-8feb-553f9d6027ef" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "X2CrNiMoN17-13-3" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Stainless steel" + MaterialNumber: "1.4429" + StandardCode: "EN 10088" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "35" + UltimateTensileStrength: "580 MPa" + YieldStrength: "295 MPa" + YoungsModulus: "200000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X2CrNiN24-4.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X2CrNiN24-4.FCMat new file mode 100644 index 0000000000..f59cd81717 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X2CrNiN24-4.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "be74ada5-2775-41fc-a44b-36df6fb5e0b8" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "X2CrNiN24-4" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Stainless steel" + MaterialNumber: "1.4362" + StandardCode: "EN 10088" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "25" + UltimateTensileStrength: "600 MPa" + YieldStrength: "400 MPa" + YoungsModulus: "200000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X39CrMo17-1.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X39CrMo17-1.FCMat new file mode 100644 index 0000000000..ec90558bbe --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X39CrMo17-1.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "9e7069ef-296d-401d-9331-d3e11267c2e0" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "X39CrMo17-1" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Stainless steel" + MaterialNumber: "1.4122" + StandardCode: "EN 10088" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "12" + UltimateTensileStrength: "750 MPa" + YieldStrength: "500 MPa" + YoungsModulus: "213000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X3CrNiMo13-14.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X3CrNiMo13-14.FCMat new file mode 100644 index 0000000000..b4fc5986dd --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X3CrNiMo13-14.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "88632101-8868-407a-a95f-01773b5f2245" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "X3CrNiMo13-14" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Stainless steel" + MaterialNumber: "1.4313" + StandardCode: "EN 10088" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "11" + UltimateTensileStrength: "900 MPa" + YieldStrength: "800 MPa" + YoungsModulus: "216000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X5CrNi18-10.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X5CrNi18-10.FCMat new file mode 100644 index 0000000000..e8c5f023bf --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X5CrNi18-10.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "e5329208-0c38-47ec-8c59-e7bf6a35801d" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "X5CrNi18-10" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Stainless steel" + MaterialNumber: "1.4301" + StandardCode: "EN 10088" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "40" + UltimateTensileStrength: "520 MPa" + YieldStrength: "210 MPa" + YoungsModulus: "200000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X5CrNiMo17-12-2.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X5CrNiMo17-12-2.FCMat new file mode 100644 index 0000000000..5bf2b0b38b --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X5CrNiMo17-12-2.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "7625a484-96de-438d-b251-2b71044cfa88" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "X5CrNiMo17-12-2" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Stainless steel" + MaterialNumber: "1.4401" + StandardCode: "EN 10088" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "68000 MPa" + UltimateStrain: "40" + UltimateTensileStrength: "520 MPa" + YieldStrength: "220 MPa" + YoungsModulus: "180000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X6CrNiTi18-10.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X6CrNiTi18-10.FCMat new file mode 100644 index 0000000000..8e04da41e5 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Steel/Steel-X6CrNiTi18-10.FCMat @@ -0,0 +1,29 @@ +# File created by ConvertFCMat.py +General: + UUID: "2c577c45-ebae-46b2-9e36-e41fbcce9286" + AuthorAndLicense: "(c) 2014 M. Münch - GNU Lesser General Public License (LGPL)" + Name: "X6CrNiTi18-10" +Inherits: + Steel: + UUID: "4b849c55-6b3a-4f75-a055-40c0d0324596" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Stainless steel" + MaterialNumber: "1.4541" + StandardCode: "EN 10088" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "7800 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "81000 MPa" + UltimateStrain: "40" + UltimateTensileStrength: "500 MPa" + YieldStrength: "200 MPa" + YoungsModulus: "200000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + ThermalExpansionCoefficient: "0.000011 m/m/K" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Titanium/Ti-6Al-4V.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Titanium/Ti-6Al-4V.FCMat new file mode 100644 index 0000000000..b68cc7b6d0 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Metal/Titanium/Ti-6Al-4V.FCMat @@ -0,0 +1,31 @@ +# File created by ConvertFCMat.py +General: + UUID: "f8013463-8008-4063-818c-ab6884cfa015" + AuthorAndLicense: "vlk" + Name: "Ti-6Al-4V (Grade 5)" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Titanium" + MaterialNumber: "3.7165" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "4430 kg/m^3" + PoissonRatio: "0.330" + ShearModulus: "44 GPa" + UltimateTensileStrength: "975.5 MPa" + YieldStrength: "910 MPa" + YoungsModulus: "114 GPa" + Hardness: "35 HRC" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "553.0 J/kg/K" + ThermalConductivity: "6.7 W/m/K" + ThermalExpansionCoefficient: "8.6 µm/m/K" + Electromagnetic: + UUID: 'b2eb5f48-74b3-4193-9fbb-948674f427f3' + ElectricalConductivity: "580012.8 S/m" + RelativePermeability: "1.00005" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/ABS-Generic.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/ABS-Generic.FCMat new file mode 100644 index 0000000000..d85813be24 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/ABS-Generic.FCMat @@ -0,0 +1,26 @@ +# File created by ConvertFCMat.py +General: + UUID: "73371529-2983-47dd-b988-6739a2e20029" + AuthorAndLicense: "(c) 2013 Juergen Riegel (CC-BY 3.0)" + Name: "ABS" + Description: "This is a blend AcrylnitrilButadienStyrol (ABS) material card. The values are at the low end of the spectrum. If you need a more precise material definition use the more specialised ABS-blend cards." + SourceURL: "http://www.matweb.com/search/DataSheet.aspx?MatGUID=eb7a78f5948d481c9493a67f0d089646" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Thermoplast" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "1060 kg/m^3" + PoissonRatio: "0.37" + UltimateTensileStrength: "38.8 MPa" + YieldStrength: "44.1 MPa" + YoungsModulus: "2300 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "2050 J/kg/K" + ThermalConductivity: "0.158 W/m/K" + ThermalExpansionCoefficient: "0.000093 m/m/K" + Costs: + UUID: '881df808-8726-4c2e-be38-688bb6cce466' + ProductURL: "https://en.wikipedia.org/wiki/Acrylonitrile_butadiene_styrene" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/Acrylic-Glass-Generic.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/Acrylic-Glass-Generic.FCMat new file mode 100644 index 0000000000..086f0b1ad5 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/Acrylic-Glass-Generic.FCMat @@ -0,0 +1,28 @@ +# File created by ConvertFCMat.py +General: + UUID: "f255cd82-91d5-4e97-9032-1843128a2eaa" + AuthorAndLicense: "(c) 2016 Przemo Firszt (CC-BY 3.0)" + Name: "Acrylic Glass" + Description: "Poly(methyl methacrylate) (PMMA, acrylic, acrylic glass, trade names Plexiglas, Acrylite, Lucite, Perspex) a transparent thermoplastic often used in sheet form as a lightweight or shatter-resistant alternative to glass." + SourceURL: "http://www.matweb.com/search/DataSheet.aspx?MatGUID=632572aeef2a4224b5ac8fbd4f1b6f77" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "of the material, i.e. for PLA is Thermoplast, for Steel is Metal Thermoplast" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + CompressiveStrength: "103 MPa" + Density: "1160 kg/m^3" + PoissonRatio: "0.38" + ShearModulus: "1.08 GPa" + UltimateTensileStrength: "57.7 MPa" + YieldStrength: "73.7 MPa" + YoungsModulus: "2550 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "1480 J/kg/K" + ThermalConductivity: "0.193 W/m/K" + ThermalExpansionCoefficient: "0.000075 m/m/K" + Costs: + UUID: '881df808-8726-4c2e-be38-688bb6cce466' + ProductURL: "https://en.wikipedia.org/wiki/Poly(methyl_methacrylate)" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PA6-Generic.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PA6-Generic.FCMat new file mode 100644 index 0000000000..1a16486a01 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PA6-Generic.FCMat @@ -0,0 +1,23 @@ +# File created by ConvertFCMat.py +General: + UUID: "9d59dc3b-ce66-4bec-82c9-b962082e7c9e" + AuthorAndLicense: "(c) 2019 Uwe Stöhr (CC-BY 3.0)" + Name: "Polyamide 6" + SourceURL: "http://www.matweb.com/search/datasheet.aspx?MatGUID=8d78f3cfcb6f49d595896ce6ce6a2ef1" +Models: + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + CompressiveStrength: "67.6 MPa" + Density: "1150 kg/m^3" + PoissonRatio: "0.39" + UltimateTensileStrength: "75.5 MPa" + YieldStrength: "70.5 MPa" + YoungsModulus: "2930 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "1670 J/kg/K" + ThermalConductivity: "0.262 W/m/K" + ThermalExpansionCoefficient: "0.000082 m/m/K" + Costs: + UUID: '881df808-8726-4c2e-be38-688bb6cce466' + ProductURL: "https://en.wikipedia.org/wiki/Nylon_6" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PET-Generic.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PET-Generic.FCMat new file mode 100644 index 0000000000..6822285250 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PET-Generic.FCMat @@ -0,0 +1,24 @@ +# File created by ConvertFCMat.py +General: + UUID: "f73004e3-6fb4-4591-8be7-89d1370be312" + AuthorAndLicense: "(c) 2019 Uwe Stöhr (CC-BY 3.0)" + Name: "PET" + SourceURL: "http://www.matweb.com/search/DataSheet.aspx?MatGUID=a696bdcdff6f41dd98f8eec3599eaa20" +Models: + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + CompressiveStrength: "38.0 MPa" + Density: "1380 kg/m^3" + PoissonRatio: "0.36" + ShearModulus: "0.0385 GPa" + UltimateTensileStrength: "38.8 MPa" + YieldStrength: "62.8 MPa" + YoungsModulus: "3150 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "1140 J/kg/K" + ThermalConductivity: "0.181 W/m/K" + ThermalExpansionCoefficient: "0.000072 m/m/K" + Costs: + UUID: '881df808-8726-4c2e-be38-688bb6cce466' + ProductURL: "https://en.wikipedia.org/wiki/Polyethylene_terephthalate" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PLA-Generic.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PLA-Generic.FCMat new file mode 100644 index 0000000000..f1f23fd796 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PLA-Generic.FCMat @@ -0,0 +1,26 @@ +# File created by ConvertFCMat.py +General: + UUID: "93861244-fbbe-41a9-a7e0-aeed53abd782" + AuthorAndLicense: "(c) 2019 Uwe Stöhr (CC-BY 3.0)" + Name: "PLA" + Description: "Polylactic acid or polylactide (PLA, Poly) is a biodegradable thermoplastic aliphatic polyester derived from renewable resources, such as corn starch, tapioca roots, chips, starch or sugarcane." + SourceURL: "https://www.sd3d.com/wp-content/uploads/2017/06/MaterialTDS-PLA_01.pdf" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Thermoplast" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "1240 kg/m^3" + PoissonRatio: "0.36" + UltimateTensileStrength: "26.4 MPa" + YieldStrength: "35.9 MPa" + YoungsModulus: "3640 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "1800 J/kg/K" + ThermalConductivity: "0.130 W/m/K" + ThermalExpansionCoefficient: "0.000041 m/m/K" + Costs: + UUID: '881df808-8726-4c2e-be38-688bb6cce466' + ProductURL: "https://en.wikipedia.org/wiki/Polylactic_acid" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PP-Generic.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PP-Generic.FCMat new file mode 100644 index 0000000000..19a8d81b6b --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PP-Generic.FCMat @@ -0,0 +1,23 @@ +# File created by ConvertFCMat.py +General: + UUID: "0e669f57-de27-4915-9a02-124f36047972" + AuthorAndLicense: "(c) 2019 Uwe Stöhr (CC-BY 3.0)" + Name: "Polypropylene" + SourceURL: "http://www.matweb.com/search/DataSheet.aspx?MatGUID=a882a1c603374e278d062f106dfda95b" +Models: + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + CompressiveStrength: "10 MPa" + Density: "916 kg/m^3" + PoissonRatio: "0.44" + UltimateTensileStrength: "79.7 MPa" + YieldStrength: "32.8 MPa" + YoungsModulus: "1470 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "1920 J/kg/K" + ThermalConductivity: "0.249 W/m/K" + ThermalExpansionCoefficient: "0.000123 m/m/K" + Costs: + UUID: '881df808-8726-4c2e-be38-688bb6cce466' + ProductURL: "https://en.wikipedia.org/wiki/Polypropylene" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PTFE-Generic.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PTFE-Generic.FCMat new file mode 100644 index 0000000000..b7091e9e05 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PTFE-Generic.FCMat @@ -0,0 +1,23 @@ +# File created by ConvertFCMat.py +General: + UUID: "8ce226db-43ef-4471-93f1-07e7276aa276" + AuthorAndLicense: "(c) 2019 Uwe Stöhr (CC-BY 3.0)" + Name: "PTFE" + SourceURL: "http://www.matweb.com/search/datasheet.aspx?MatGUID=4d14eac958e5401a8fd152e1261b6843" +Models: + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + CompressiveStrength: "10.2 MPa" + Density: "2070 kg/m^3" + PoissonRatio: "0.46" + UltimateTensileStrength: "34.6 MPa" + YieldStrength: "20.5 MPa" + YoungsModulus: "564 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "1010 J/kg/K" + ThermalConductivity: "0.263 W/m/K" + ThermalExpansionCoefficient: "0.000108 m/m/K" + Costs: + UUID: '881df808-8726-4c2e-be38-688bb6cce466' + ProductURL: "https://en.wikipedia.org/wiki/Polytetrafluoroethylene" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PVC-Generic.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PVC-Generic.FCMat new file mode 100644 index 0000000000..dfde218e7f --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Thermoplast/PVC-Generic.FCMat @@ -0,0 +1,21 @@ +# File created by ConvertFCMat.py +General: + UUID: "758cfc44-f4ad-4605-8645-75e9e6b053ab" + AuthorAndLicense: "(c) 2019 Uwe Stöhr (CC-BY 3.0)" + Name: "PVC" + SourceURL: "http://www.matweb.com/search/DataSheet.aspx?MatGUID=1f650966ec834bb8833dd4c6e3116079" +Models: + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "1380 kg/m^3" + PoissonRatio: "0.38" + UltimateTensileStrength: "50 MPa" + YoungsModulus: "2800 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "1000 J/kg/K" + ThermalConductivity: "0.150 W/m/K" + ThermalExpansionCoefficient: "0.000075 m/m/K" + Costs: + UUID: '881df808-8726-4c2e-be38-688bb6cce466' + ProductURL: "https://en.wikipedia.org/wiki/Polyvinyl_chloride" diff --git a/src/Mod/Material/Resources/Materials/StandardMaterial/Wood/Wood-Generic.FCMat b/src/Mod/Material/Resources/Materials/StandardMaterial/Wood/Wood-Generic.FCMat new file mode 100644 index 0000000000..9c64883f91 --- /dev/null +++ b/src/Mod/Material/Resources/Materials/StandardMaterial/Wood/Wood-Generic.FCMat @@ -0,0 +1,20 @@ +# File created by ConvertFCMat.py +General: + UUID: "b588224e-e8d6-47ad-ba1f-a058333fd1c6" + AuthorAndLicense: "(c) 2015 Bernd Hahnebach (CC-BY 3.0)" + Name: "Wood" + Description: "A standard construction wood" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Aggregate" + Density: + UUID: '454661e5-265b-4320-8e6f-fcf6223ac3af' + Density: "700 kg/m^3" + IsotropicLinearElastic: + UUID: 'f6f9e48c-b116-4e82-ad7f-3659a9219c50' + PoissonRatio: "0.05" + YoungsModulus: "12000 MPa" + Costs: + UUID: '881df808-8726-4c2e-be38-688bb6cce466' + ProductURL: "https://en.wikipedia.org/wiki/Wood" diff --git a/src/Mod/Material/Resources/Models/Architectural/Architectural.yml b/src/Mod/Material/Resources/Models/Architectural/Architectural.yml new file mode 100644 index 0000000000..348c69ecc3 --- /dev/null +++ b/src/Mod/Material/Resources/Models/Architectural/Architectural.yml @@ -0,0 +1,69 @@ +--- +# *************************************************************************** +# * * +# * Copyright (c) 2023 David Carter * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Library General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + +Model: + Name: "Architectural" + UUID: '32439c3b-262f-4b7b-99a8-f7f44e5894c8' + URL: '' + Description: "default architectural model" + DOI: "" + Color: + Type: 'String' + Units: '' + URL: '' + Description: " " + EnvironmentalEfficiencyClass: + Type: 'String' + Units: '' + URL: '' + Description: " " + ExecutionInstructions: + Type: 'String' + Units: '' + URL: '' + Description: " " + Finish: + Type: 'String' + Units: '' + URL: '' + Description: " " + FireResistanceClass: + Type: 'String' + Units: '' + URL: '' + Description: " " + Model: + Type: 'String' + Units: '' + URL: '' + Description: " " + SoundTransmissionClass: + Type: 'String' + Units: '' + URL: '' + Description: " " + UnitsPerQuantity: + Type: 'Float' + Units: '' + URL: '' + Description: " " diff --git a/src/Mod/Material/Resources/Models/Costs/Costs.yml b/src/Mod/Material/Resources/Models/Costs/Costs.yml new file mode 100644 index 0000000000..92eb8323e4 --- /dev/null +++ b/src/Mod/Material/Resources/Models/Costs/Costs.yml @@ -0,0 +1,47 @@ +--- +# *************************************************************************** +# * * +# * Copyright (c) 2023 David Carter * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Library General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + +Model: + Name: "Costs" + UUID: '881df808-8726-4c2e-be38-688bb6cce466' + URL: '' + Description: "default cost model" + DOI: "" + ProductURL: + Type: 'URL' + Units: '' + URL: 'https://de.wikipedia.org/wiki/Hyperlink' + Description: "Product URL, recommended are wikipedia links" + SpecificPrice: + Type: 'Float' + Units: '' + URL: '' + Description: > + Specific price in currency / mass. A currency is not supported by + FreeCAD unit system. Will be empty in all FreeCAD cards. Means the + user needs to put in himself. + Vendor: + Type: 'String' + Units: '' + URL: '' + Description: "Vendor of the material" diff --git a/src/Mod/Material/Resources/Models/Electromagnetic/Electromagnetic.yml b/src/Mod/Material/Resources/Models/Electromagnetic/Electromagnetic.yml new file mode 100644 index 0000000000..1f70ab439c --- /dev/null +++ b/src/Mod/Material/Resources/Models/Electromagnetic/Electromagnetic.yml @@ -0,0 +1,45 @@ +--- +# *************************************************************************** +# * * +# * Copyright (c) 2023 David Carter * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Library General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + +Model: + Name: "Electromagnetic" + UUID: 'b2eb5f48-74b3-4193-9fbb-948674f427f3' + URL: '' + Description: "default electromagnetic model" + DOI: "" + RelativePermittivity: + Type: 'Float' + Units: '' + URL: 'https://en.wikipedia.org/wiki/Relative_permittivity' + Description: "The ratio to the permittivity of the vacuum" + ElectricalConductivity: + Type: 'Quantity' + Units: 'S/m' + URL: 'https://en.wikipedia.org/wiki/Electrical_resistivity_and_conductivity' + Description: > + The electrical conductivity in [FreeCAD ElectricalConductivity unit] + RelativePermeability: + Type: 'Float' + Units: '' + URL: 'https://en.wikipedia.org/wiki/Permeability_(electromagnetism)' + Description: "The ratio to the permeability of the vacuum" diff --git a/src/Mod/Material/Resources/Models/Fluid/Fluid.yml b/src/Mod/Material/Resources/Models/Fluid/Fluid.yml new file mode 100644 index 0000000000..4ddea05de3 --- /dev/null +++ b/src/Mod/Material/Resources/Models/Fluid/Fluid.yml @@ -0,0 +1,51 @@ +--- +# *************************************************************************** +# * * +# * Copyright (c) 2023 David Carter * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Library General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** +Model: + Name: "Fluid" + UUID: '1ae66d8c-1ba1-4211-ad12-b9917573b202' + URL: '' + Description: "default fluid model" + DOI: "" + Inherits: + - Density: + UUID: '454661e5-265b-4320-8e6f-fcf6223ac3af' + DynamicViscosity: + Type: 'Quantity' + Units: 'Pa*s' + URL: 'https://en.wikipedia.org/wiki/Viscosity' + Description: > + Dynamic viscosity is defined as the ability of a material to resist + flow and deform during mechanical oscillation as a function of + temperature, frequency, time, or both + KinematicViscosity: + Type: 'Quantity' + Units: 'm^2/s' + URL: 'https://en.wikipedia.org/wiki/Viscosity' + Description: "Kinematic Viscosity = Dynamic Viscosity / Density" + PrandtlNumber: + Type: 'Float' + Units: '' + URL: 'https://en.wikipedia.org/wiki/Prandtl_number' + Description: > + The Prandtl number is a dimensionless number defined as the ratio + of momentum diffusivity to thermal diffusivity diff --git a/src/Mod/Material/Resources/Models/Legacy/Father.yml b/src/Mod/Material/Resources/Models/Legacy/Father.yml new file mode 100644 index 0000000000..fccb79eda1 --- /dev/null +++ b/src/Mod/Material/Resources/Models/Legacy/Father.yml @@ -0,0 +1,36 @@ +--- +# *************************************************************************** +# * * +# * Copyright (c) 2023 David Carter * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Library General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + +Model: + Name: 'Father' + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + URL: '' + Description: "Used to define a class of materials" + DOI: "" + Father: + Type: 'String' + Units: '' + URL: '' + Description: > + Father of the material, ex. the father of PLA is Thermoplast, the + father of Steel is Metal diff --git a/src/Mod/Material/Resources/Models/Legacy/MaterialStandard.yml b/src/Mod/Material/Resources/Models/Legacy/MaterialStandard.yml new file mode 100644 index 0000000000..c1d2cf9d27 --- /dev/null +++ b/src/Mod/Material/Resources/Models/Legacy/MaterialStandard.yml @@ -0,0 +1,46 @@ +--- +# *************************************************************************** +# * * +# * Copyright (c) 2023 David Carter * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Library General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + +Model: + Name: 'Material Standard' + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + URL: '' + Description: "Describes the norm or standards referenced by this material" + DOI: "" + KindOfMaterial: + Type: 'String' + Units: '' + URL: '' + Description: " " + MaterialNumber: + Type: 'String' + Units: '' + URL: '' + Description: " " + StandardCode: + Type: 'String' + Units: '' + URL: '' + Description: > + This is a reference to a norm or standards system where this material + is referenced by a precise ID or number diff --git a/src/Mod/Material/Resources/Models/Mechanical/Density.yml b/src/Mod/Material/Resources/Models/Mechanical/Density.yml new file mode 100644 index 0000000000..fc040675fb --- /dev/null +++ b/src/Mod/Material/Resources/Models/Mechanical/Density.yml @@ -0,0 +1,34 @@ +--- +# *************************************************************************** +# * * +# * Copyright (c) 2023 David Carter * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Library General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + +Model: + Name: 'Density' + UUID: '454661e5-265b-4320-8e6f-fcf6223ac3af' + URL: '' + Description: 'Density is the most basic physical model' + DOI: '' + Density: + Type: 'Quantity' + Units: 'kg/m^3' + URL: 'https://en.wikipedia.org/wiki/Density' + Description: "Density in [FreeCAD Density unit]" diff --git a/src/Mod/Material/Resources/Models/Mechanical/HypotheticalExample.yml b/src/Mod/Material/Resources/Models/Mechanical/HypotheticalExample.yml new file mode 100644 index 0000000000..396f53c3b2 --- /dev/null +++ b/src/Mod/Material/Resources/Models/Mechanical/HypotheticalExample.yml @@ -0,0 +1,41 @@ +--- +# *************************************************************************** +# * * +# * Copyright (c) 2023 David Carter * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Library General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + +Model: + Name: 'Hypothetical Example' + UUID: 'a401af74-e4a2-4bad-8dd5-0f3d1748c462' + URL: 'https://en.wikipedia.org/wiki/Linear_elasticity' + Description: > + This is not a real physical model. It is intended as an example of a new + physical model + DOI: "" + GigaWatts: + Type: 'Quantity' + Units: '' + URL: '' + Description: "" + TimeFluxDensity: + Type: 'Quantity' + Units: '' + URL: '' + Description: "" diff --git a/src/Mod/Material/Resources/Models/Mechanical/IsotropicLinearElastic.yml b/src/Mod/Material/Resources/Models/Mechanical/IsotropicLinearElastic.yml new file mode 100644 index 0000000000..71eb1c519e --- /dev/null +++ b/src/Mod/Material/Resources/Models/Mechanical/IsotropicLinearElastic.yml @@ -0,0 +1,51 @@ +--- +# *************************************************************************** +# * * +# * Copyright (c) 2023 David Carter * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Library General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + +Model: + Name: 'Isotropic Linear Elastic' + UUID: 'f6f9e48c-b116-4e82-ad7f-3659a9219c50' + URL: 'https://en.wikipedia.org/wiki/Linear_elasticity' + Description: > + Materials that are linearly elastic obey Hooke's law i.e. the stress + and strain relationship is linear + DOI: "10.1016/j.ijplas.2004.06.004" + BulkModulus: + Type: 'Quantity' + Units: 'kPa' + URL: 'https://en.wikipedia.org/wiki/Bulk_modulus' + Description: "Bulk modulus in [FreeCAD Pressure unit]" + PoissonRatio: + Type: 'Float' + Units: '' + URL: 'https://en.wikipedia.org/wiki/Poisson%27s_ratio' + Description: "Poisson's ratio [unitless]" + ShearModulus: + Type: 'Quantity' + Units: 'kPa' + URL: 'https://en.wikipedia.org/wiki/Shear_modulus' + Description: "Shear modulus in [FreeCAD Pressure unit]" + YoungsModulus: + Type: 'Quantity' + Units: 'kPa' + URL: 'https://en.wikipedia.org/wiki/Young%27s_modulus' + Description: "Young's modulus (or E-Module) in [FreeCAD Pressure unit]" diff --git a/src/Mod/Material/Resources/Models/Mechanical/LinearElastic.yml b/src/Mod/Material/Resources/Models/Mechanical/LinearElastic.yml new file mode 100644 index 0000000000..83b02a264f --- /dev/null +++ b/src/Mod/Material/Resources/Models/Mechanical/LinearElastic.yml @@ -0,0 +1,81 @@ +--- +# *************************************************************************** +# * * +# * Copyright (c) 2023 David Carter * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Library General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + +Model: + Name: 'Linear Elastic' + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + URL: 'https://en.wikipedia.org/wiki/Linear_elasticity' + Description: > + Materials that are linearly elastic obey Hooke's law i.e. the stress and + strain relationship is linear + DOI: "10.1016/j.ijplas.2004.06.004" + Inherits: + - Density: + UUID: '454661e5-265b-4320-8e6f-fcf6223ac3af' + - IsotropicLinearElastic: + UUID: 'f6f9e48c-b116-4e82-ad7f-3659a9219c50' + AngleOfFriction: + Type: 'Quantity' + Units: 'deg' + URL: 'https://en.wikipedia.org/wiki/Friction#Angle_of_friction' + Description: > + Further information can be found at + https://en.wikipedia.org/wiki/Mohr%E2%80%93Coulomb_theory + CompressiveStrength: + Type: 'Quantity' + Units: 'kPa' + URL: 'https://en.wikipedia.org/wiki/Compressive_strength' + Description: "Compressive strength in [FreeCAD Pressure unit]" + FractureToughness: + Type: 'Float' + Units: '' + URL: 'https://en.wikipedia.org/wiki/Fracture_toughness' + Description: > + Unit MPa * m^0.5 is not possible ATM in FreeCAD thus String. Keep in mind + the unit is fixed MPa * m^0.5. + https://github.com/FreeCAD/FreeCAD/pull/2156 + UltimateStrain: + Type: 'Quantity' + Units: 'kPa' + URL: 'https://en.wikipedia.org/wiki/Deformation_(mechanics)' + Description: " " + UltimateTensileStrength: + Type: 'Quantity' + Units: 'kPa' + URL: 'https://en.wikipedia.org/wiki/Ultimate_tensile_strength' + Description: "Ultimate tensile strength in [FreeCAD Pressure unit]" + YieldStrength: + Type: 'Quantity' + Units: 'kPa' + URL: 'https://en.wikipedia.org/wiki/Yield_Strength' + Description: "Yield strength in [FreeCAD Pressure unit]" + Stiffness: + Type: 'Quantity' + Units: 'N/m' + URL: 'https://en.wikipedia.org/wiki/Stiffness' + Description: "Stiffness (or Spring Stiffness) in [FreeCAD Stiffness unit]" + Hardness: + Type: 'Quantity' + Units: '' + URL: 'https://en.wikipedia.org/wiki/Mohs_scale' + Description: "Hardness. FreeCAD does not currently support hardness units" diff --git a/src/Mod/Material/Resources/Models/Mechanical/OgdenYld2004p18.yml b/src/Mod/Material/Resources/Models/Mechanical/OgdenYld2004p18.yml new file mode 100644 index 0000000000..7bf43f619b --- /dev/null +++ b/src/Mod/Material/Resources/Models/Mechanical/OgdenYld2004p18.yml @@ -0,0 +1,65 @@ +--- +# *************************************************************************** +# * * +# * Copyright (c) 2023 David Carter * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Library General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + +Model: + Name: 'OgdenYld2004p18' + UUID: '3ef9e427-cc25-43f7-817f-79ff0d49625f' + URL: 'https://en.wikipedia.org/wiki/Linear_elasticity' + Description: > + Materials that are linearly elastic obey Hooke's law i.e. the stress and + strain relationship is linear + DOI: "10.1016/j.ijplas.2004.06.004" + OgdenModuli: + Type: 'List' + Units: 'kPa' + URL: 'https://en.wikipedia.org/wiki/Ogden_hyperelastic_model' + Description: "Elastic moduli μ for Ogden [FreeCAD Pressure unit]" + OgdenExponent: + Type: 'Integer' + Units: '' + URL: 'https://en.wikipedia.org/wiki/Ogden_hyperelastic_model' + Description: "Exponent ɑ for Ogden [unitless]" + InitialYieldStress: + Type: 'Quantity' + Units: 'kPa' + URL: '' + Description: > + Saturation stress for Voce isotropic hardening [FreeCAD Pressure unit] + VoceSaturationStress: + Type: 'Quantity' + Units: 'kPa' + URL: '' + Description: > + Saturation stress for Voce isotropic hardening [FreeCAD Pressure unit] + VoceStrainScale: + Type: 'Float' + Units: '' + URL: '' + Description: "Strain scale in Voce isotropic hardening [unitless]" + Yld2004p18Coefficients: + Type: 'List' + Units: '' + URL: '' + Description: > + Coefficients (c_12, c_13, c_21, c_23, c_31, c_32, c_44, c_55, c_66) + in Yld2004-18p yield surface [unitless] diff --git a/src/Mod/Material/Resources/Models/Mechanical/OrthotropicLinearElastic.yml b/src/Mod/Material/Resources/Models/Mechanical/OrthotropicLinearElastic.yml new file mode 100644 index 0000000000..b63302dc96 --- /dev/null +++ b/src/Mod/Material/Resources/Models/Mechanical/OrthotropicLinearElastic.yml @@ -0,0 +1,76 @@ +--- +# *************************************************************************** +# * * +# * Copyright (c) 2023 David Carter * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Library General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + +Model: + Name: 'Orthotropic Linear Elastic' + UUID: 'b19ccc6b-a431-418e-91c2-0ac8c649d146' + URL: 'https://en.wikipedia.org/wiki/Linear_elasticity' + Description: > + Materials that are linearly elastic obey Hooke's law i.e. the stress and + strain relationship is linear + DOI: "" + PoissonRatioXY: + Type: 'Float' + Units: '' + URL: 'https://en.wikipedia.org/wiki/Poisson%27s_ratio' + Description: "Poisson's ratio [unitless]" + PoissonRatioXZ: + Type: 'Float' + Units: '' + URL: 'https://en.wikipedia.org/wiki/Poisson%27s_ratio' + Description: "Poisson's ratio [unitless]" + PoissonRatioYZ: + Type: 'Float' + Units: 'Pressure' + URL: 'https://en.wikipedia.org/wiki/Poisson%27s_ratio' + Description: "Poisson's ratio [unitless]" + ShearModulusXY: + Type: 'Quantity' + Units: 'kPa' + URL: 'https://en.wikipedia.org/wiki/Shear_modulus' + Description: "Shear modulus in [FreeCAD Pressure unit]" + ShearModulusXZ: + Type: 'Quantity' + Units: 'kPa' + URL: 'https://en.wikipedia.org/wiki/Shear_modulus' + Description: "Shear modulus in [FreeCAD Pressure unit]" + ShearModulusYZ: + Type: 'Quantity' + Units: 'kPa' + URL: 'https://en.wikipedia.org/wiki/Shear_modulus' + Description: "Shear modulus in [FreeCAD Pressure unit]" + YoungsModulusX: + Type: 'Quantity' + Units: 'kPa' + URL: 'https://en.wikipedia.org/wiki/Young%27s_modulus' + Description: "Young's modulus (or E-Module) in [FreeCAD Pressure unit]" + YoungsModulusY: + Type: 'Quantity' + Units: 'kPa' + URL: 'https://en.wikipedia.org/wiki/Young%27s_modulus' + Description: "Young's modulus (or E-Module) in [FreeCAD Pressure unit]" + YoungsModulusZ: + Type: 'Quantity' + Units: 'kPa' + URL: 'https://en.wikipedia.org/wiki/Young%27s_modulus' + Description: "Young's modulus (or E-Module) in [FreeCAD Pressure unit]" diff --git a/src/Mod/Material/Resources/Models/Rendering/AdvancedRendering.yml b/src/Mod/Material/Resources/Models/Rendering/AdvancedRendering.yml new file mode 100644 index 0000000000..84223de33b --- /dev/null +++ b/src/Mod/Material/Resources/Models/Rendering/AdvancedRendering.yml @@ -0,0 +1,42 @@ +--- +# *************************************************************************** +# * * +# * Copyright (c) 2023 David Carter * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Library General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + +AppearanceModel: + Name: "Advanced Rendering" + UUID: 'c880f092-cdae-43d6-a24b-55e884aacbbf' + URL: '' + Description: "default rendering model" + DOI: "" + Inherits: + - BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + FragmentShader: + Type: 'String' + Units: '' + URL: '' + Description: " " + VertexShader: + Type: 'String' + Units: '' + URL: '' + Description: " " diff --git a/src/Mod/Material/Resources/Models/Rendering/BasicRendering.yml b/src/Mod/Material/Resources/Models/Rendering/BasicRendering.yml new file mode 100644 index 0000000000..c5d145ba2d --- /dev/null +++ b/src/Mod/Material/Resources/Models/Rendering/BasicRendering.yml @@ -0,0 +1,59 @@ +--- +# *************************************************************************** +# * * +# * Copyright (c) 2023 David Carter * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Library General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + +AppearanceModel: + Name: "Basic Rendering" + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + URL: '' + Description: "default rendering model" + DOI: "" + AmbientColor: + Type: 'Color' + Units: '' + URL: '' + Description: " " + DiffuseColor: + Type: 'Color' + Units: '' + URL: '' + Description: " " + EmissiveColor: + Type: 'Color' + Units: '' + URL: '' + Description: " " + Shininess: + Type: 'Float' + Units: '' + URL: '' + Description: " " + SpecularColor: + Type: 'Color' + Units: '' + URL: '' + Description: " " + Transparency: + Type: 'Float' + Units: '' + URL: '' + Description: " " diff --git a/src/Mod/Material/Resources/Models/Rendering/TextureRendering.yml b/src/Mod/Material/Resources/Models/Rendering/TextureRendering.yml new file mode 100644 index 0000000000..c2fadfa0ad --- /dev/null +++ b/src/Mod/Material/Resources/Models/Rendering/TextureRendering.yml @@ -0,0 +1,42 @@ +--- +# *************************************************************************** +# * * +# * Copyright (c) 2023 David Carter * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Library General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + +AppearanceModel: + Name: "Texture Rendering" + UUID: 'bbdcc65b-67ca-489c-bd5c-a36e33d1c160' + URL: '' + Description: "default rendering model" + DOI: "" + Inherits: + - BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + TexturePath: + Type: 'File' + Units: '' + URL: '' + Description: " " + TextureScaling: + Type: 'Float' + Units: '' + URL: '' + Description: " " diff --git a/src/Mod/Material/Resources/Models/Rendering/VectorRendering.yml b/src/Mod/Material/Resources/Models/Rendering/VectorRendering.yml new file mode 100644 index 0000000000..a1eb05213e --- /dev/null +++ b/src/Mod/Material/Resources/Models/Rendering/VectorRendering.yml @@ -0,0 +1,59 @@ +--- +# *************************************************************************** +# * * +# * Copyright (c) 2023 David Carter * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Library General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + +AppearanceModel: + Name: "Vector Rendering" + UUID: 'fdf5a80e-de50-4157-b2e5-b6e5f88b680e' + URL: '' + Description: "default vector rendering model" + DOI: "" + SectionFillPattern: + Type: 'File' + Units: '' + URL: '' + Description: " " + SectionLinewidth: + Type: 'Float' + Units: '' + URL: '' + Description: " " + SectionColor: + Type: 'Color' + Units: '' + URL: '' + Description: " " + ViewColor: + Type: 'Color' + Units: '' + URL: '' + Description: " " + ViewFillPattern: + Type: 'Boolean' + Units: '' + URL: '' + Description: " " + ViewLinewidth: + Type: 'Float' + Units: '' + URL: '' + Description: " " diff --git a/src/Mod/Material/Resources/Models/Thermal/Thermal.yml b/src/Mod/Material/Resources/Models/Thermal/Thermal.yml new file mode 100644 index 0000000000..f8154af60b --- /dev/null +++ b/src/Mod/Material/Resources/Models/Thermal/Thermal.yml @@ -0,0 +1,47 @@ +--- +# *************************************************************************** +# * * +# * Copyright (c) 2023 David Carter * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Library General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + +Model: + Name: "Thermal" + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + URL: '' + Description: "default thermal model" + DOI: "" + SpecificHeat: + Type: 'Quantity' + Units: 'J/kg/K' + URL: 'https://en.wikipedia.org/wiki/Heat_capacity' + Description: "Specific capacity in [FreeCAD SpecificHeat unit]" + ThermalConductivity: + Type: 'Quantity' + Units: 'W/m/K' + URL: 'https://en.wikipedia.org/wiki/Thermal_conductivity' + Description: "Thermal conductivity in [FreeCAD ThermalConductivity unit]" + ThermalExpansionCoefficient: + Type: 'Quantity' + Units: 'm/m/K' + URL: + 'https://en.wikipedia.org/wiki/Volumetric_thermal_expansion_coefficient' + Description: > + Thermal expansion coefficient (linear) in [FreeCAD + ThermalExpansionCoefficient unit] diff --git a/src/Mod/Material/materials-editor.ui b/src/Mod/Material/Resources/ui/materials-editor.ui similarity index 100% rename from src/Mod/Material/materials-editor.ui rename to src/Mod/Material/Resources/ui/materials-editor.ui diff --git a/src/Mod/Material/StandardMaterial/ABS-Generic.FCMat b/src/Mod/Material/StandardMaterial/ABS-Generic.FCMat deleted file mode 100644 index f0062310f1..0000000000 --- a/src/Mod/Material/StandardMaterial/ABS-Generic.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; ABS-Generic -; (c) 2013 Juergen Riegel (CC-BY 3.0) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = ABS -Description = This is a blend AcrylnitrilButadienStyrol (ABS) material card. The values are at the low end of the spectrum. If you need a more precise material definition use the more specialised ABS-blend cards. -Father = Thermoplast -SourceURL = http://www.matweb.com/search/DataSheet.aspx?MatGUID=eb7a78f5948d481c9493a67f0d089646 - -[Mechanical] -Density = 1060 kg/m^3 -PoissonRatio = 0.37 -UltimateTensileStrength = 38.8 MPa -YieldStrength = 44.1 MPa -YoungsModulus = 2300 MPa - -[Thermal] -SpecificHeat = 2050 J/kg/K -ThermalConductivity = 0.158 W/m/K -ThermalExpansionCoefficient = 0.000093 m/m/K - -[Cost] -ProductURL = https://en.wikipedia.org/wiki/Acrylonitrile_butadiene_styrene diff --git a/src/Mod/Material/StandardMaterial/Acrylic-Glass-Generic.FCMat b/src/Mod/Material/StandardMaterial/Acrylic-Glass-Generic.FCMat deleted file mode 100644 index 76b9b3b352..0000000000 --- a/src/Mod/Material/StandardMaterial/Acrylic-Glass-Generic.FCMat +++ /dev/null @@ -1,29 +0,0 @@ -; Acrylic-Glass-Generic -; (c) 2016 Przemo Firszt (CC-BY 3.0) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = Acrylic Glass -Description = Poly(methyl methacrylate) (PMMA, acrylic, acrylic glass, trade names Plexiglas, Acrylite, Lucite, Perspex) a transparent thermoplastic often used in sheet form as a lightweight or shatter-resistant alternative to glass. -DescriptionPL = Szkło akrylowe (szkło organiczne; inaczej pleksi, pleksiglas, metapleks) – przezroczyste tworzywo sztuczne, którego głównym składnikiem jest polimer – poli(metakrylan metylu) (PMMA). -Father = of the material, i.e. for PLA is Thermoplast, for Steel is Metal Thermoplast -SourceURL = http://www.matweb.com/search/DataSheet.aspx?MatGUID=632572aeef2a4224b5ac8fbd4f1b6f77 - -[Mechanical] -CompressiveStrength = 103 MPa -Density = 1160 kg/m^3 -PoissonRatio = 0.38 -ShearModulus = 1.08 GPa -UltimateTensileStrength = 57.7 MPa -YieldStrength = 73.7 MPa -YoungsModulus = 2550 MPa - -[Thermal] -SpecificHeat = 1480 J/kg/K -ThermalConductivity = 0.193 W/m/K -ThermalExpansionCoefficient = 0.000075 m/m/K - -[Cost] -ProductURL = https://en.wikipedia.org/wiki/Poly(methyl_methacrylate) diff --git a/src/Mod/Material/StandardMaterial/AlMg3F24.FCMat b/src/Mod/Material/StandardMaterial/AlMg3F24.FCMat deleted file mode 100644 index ef6234d1ef..0000000000 --- a/src/Mod/Material/StandardMaterial/AlMg3F24.FCMat +++ /dev/null @@ -1,28 +0,0 @@ -; AlMg3F24 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = AlMg3F24 -NameDE = AlMg3F24 -Father = Metal -KindOfMaterial = Aluminium -KindOfMaterialDE = Aluminium -MaterialNumber = 3.3535.26 -Norm = DIN 1725 - -[Mechanical] -Density = 2700 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 27000 MPa -UltimateStrain = 5 -UltimateTensileStrength = 250 MPa -YieldStrength = 180 MPa -YoungsModulus = 70000 MPa - -[Thermal] -SpecificHeat = 900 J/kg/K -ThermalConductivity = 150 W/m/K -ThermalExpansionCoefficient = 23 µm/m/K diff --git a/src/Mod/Material/StandardMaterial/AlMgSi1F31.FCMat b/src/Mod/Material/StandardMaterial/AlMgSi1F31.FCMat deleted file mode 100644 index 3e0734a0e8..0000000000 --- a/src/Mod/Material/StandardMaterial/AlMgSi1F31.FCMat +++ /dev/null @@ -1,28 +0,0 @@ -; AlMgSi1F31 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = AlMgSi1F31 -NameDE = AlMgSi1F31 -Father = Metal -KindOfMaterial = Aluminium -KindOfMaterialDE = Aluminium -MaterialNumber = 3.2315.72 -Norm = DIN 1725 - -[Mechanical] -Density = 2700 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 27000 MPa -UltimateStrain = 10 -UltimateTensileStrength = 310 MPa -YieldStrength = 260 MPa -YoungsModulus = 70000 MPa - -[Thermal] -SpecificHeat = 896 J/kg/K -ThermalConductivity = 160 W/m/K -ThermalExpansionCoefficient = 23 µm/m/K diff --git a/src/Mod/Material/StandardMaterial/AlZn4-5Mg1F35.FCMat b/src/Mod/Material/StandardMaterial/AlZn4-5Mg1F35.FCMat deleted file mode 100644 index c38cc5d6bc..0000000000 --- a/src/Mod/Material/StandardMaterial/AlZn4-5Mg1F35.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; AlZn4-5Mg1F35 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = AlZn4,5Mg1F35 -NameDE = AlZn4,5Mg1F35 -Father = Metal -KindOfMaterial = Aluminium -KindOfMaterialDE = Aluminium -MaterialNumber = 3.4335.71 -Norm = DIN 1725 - -[Mechanical] -Density = 2700 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 27000 MPa -UltimateStrain = 10 -UltimateTensileStrength = 350 MPa -YieldStrength = 290 MPa -YoungsModulus = 70000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000023 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Aluminum-6061-T6.FCMat b/src/Mod/Material/StandardMaterial/Aluminum-6061-T6.FCMat deleted file mode 100644 index 250ed9bbd1..0000000000 --- a/src/Mod/Material/StandardMaterial/Aluminum-6061-T6.FCMat +++ /dev/null @@ -1,24 +0,0 @@ -; Aluminum-6061-T6 -; (c) 2016 Mandeep Singh (CC-BY 3.0) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = Aluminum 6061-T6 -Description = Precipitation-hardened, Nonferrous Aluminum alloy -Father = Metal -KindOfMaterial = Aluminium -KindOfMaterialDE = Aluminium - -[Mechanical] -Density = 2700 kg/m^3 -PoissonRatio = 0.33 -UltimateTensileStrength = 310 MPa -YoungsModulus = 69000 MPa - -[Thermal] -ThermalConductivity = 167 W/m/K - -[Cost] -ProductURL = https://en.wikipedia.org/wiki/6061_aluminium_alloy diff --git a/src/Mod/Material/StandardMaterial/Aluminum-Generic.FCMat b/src/Mod/Material/StandardMaterial/Aluminum-Generic.FCMat deleted file mode 100644 index 949895a84b..0000000000 --- a/src/Mod/Material/StandardMaterial/Aluminum-Generic.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Aluminum-Generic -; Uwe Stöhr -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD 0.21.29751 (Git) - -[General] -Name = Aluminum Generic -Father = Metal -KindOfMaterial = Aluminium - -[Mechanical] -Density = 2700 kg/m^3 -PoissonRatio = 0.35 -ShearModulus = 25.0 GPa -UltimateTensileStrength = 310 MPa -YoungsModulus = 70000 MPa - -[Thermal] -SpecificHeat = 897.0 J/kg/K -ThermalConductivity = 237.0 W/m/K -ThermalExpansionCoefficient = 23.1 µm/m/K - -[Electromagnetic] -ElectricalConductivity = 370370.4 S/m -RelativePermeability = 1.0 diff --git a/src/Mod/Material/StandardMaterial/CalculiX-Steel.FCMat b/src/Mod/Material/StandardMaterial/CalculiX-Steel.FCMat deleted file mode 100644 index 94dc3563b3..0000000000 --- a/src/Mod/Material/StandardMaterial/CalculiX-Steel.FCMat +++ /dev/null @@ -1,20 +0,0 @@ -; CalculiX-Steel -; (c) 2013 Juergen Riegel (CC-BY 3.0) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = CalculiX-Steel -Description = Standard steel material for CalculiX sample calculations -Father = Metal - -[Mechanical] -Density = 7900 kg/m^3 -PoissonRatio = 0.3 -YoungsModulus = 210000 MPa - -[Thermal] -SpecificHeat = 590 J/kg/K -ThermalConductivity = 43 W/m/K -ThermalExpansionCoefficient = 0.000012 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Concrete-EN-C35_45.FCMat b/src/Mod/Material/StandardMaterial/Concrete-EN-C35_45.FCMat deleted file mode 100644 index 8439381a72..0000000000 --- a/src/Mod/Material/StandardMaterial/Concrete-EN-C35_45.FCMat +++ /dev/null @@ -1,20 +0,0 @@ -; Concrete-EN-C35_45 -; (c) 2019 Bernd Hahnebach (CC-BY 3.0) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD 0.19.16886 (Git) - -[General] -Name = Concrete-EN-C35/45 -Description = Concrete matrix for reinforcement material examples, 0.6 x 0.75 x 35 MPa = 15.75 MPa (https://forum.freecad.org/viewtopic.php?f=18&t=33106&start=200#p311075) -Father = Aggregate - -[Mechanical] -AngleOfFriction = 30 deg -CompressiveStrength = 15.75 MPa -Density = 2500 kg/m^3 -PoissonRatio = 0.17 -YoungsModulus = 32000 MPa - -[Cost] -ProductURL = https://en.wikipedia.org/wiki/Concrete diff --git a/src/Mod/Material/StandardMaterial/Concrete-Generic.FCMat b/src/Mod/Material/StandardMaterial/Concrete-Generic.FCMat deleted file mode 100644 index af1911ac7b..0000000000 --- a/src/Mod/Material/StandardMaterial/Concrete-Generic.FCMat +++ /dev/null @@ -1,20 +0,0 @@ -; Concrete-Generic -; (c) 2013 Yorik van Havre (CC-BY 3.0) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = Concrete -Description = A standard C-25 construction concrete -Father = Aggregate -StandardCode = Masterformat 03 33 13 - -[Mechanical] -CompressiveStrength = 25 MPa -Density = 2400 kg/m^3 -PoissonRatio = 0.17 -YoungsModulus = 32000 MPa - -[Cost] -ProductURL = https://en.wikipedia.org/wiki/Concrete diff --git a/src/Mod/Material/StandardMaterial/Copper-Generic.FCMat b/src/Mod/Material/StandardMaterial/Copper-Generic.FCMat deleted file mode 100644 index 2c951f0838..0000000000 --- a/src/Mod/Material/StandardMaterial/Copper-Generic.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Copper Generic -; Uwe Stöhr -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD 0.21.30044 (Git) - -[General] -Name = Copper Generic -Father = Metal -KindOfMaterial = Copper - -[Mechanical] -Density = 8960 kg/m^3 -PoissonRatio = 0.343 -ShearModulus = 46.0 GPa -UltimateTensileStrength = 210 MPa -YieldStrength = 33.3 MPa -YoungsModulus = 119 GPa - -[Thermal] -SpecificHeat = 385.0 J/kg/K -ThermalConductivity = 398.0 W/m/K -ThermalExpansionCoefficient = 16.5 µm/m/K - -[Electromagnetic] -ElectricalConductivity = 59.59 MS/m -RelativePermeability = 0.999994 diff --git a/src/Mod/Material/StandardMaterial/Glass-E-GlassFibre.FCMat b/src/Mod/Material/StandardMaterial/Glass-E-GlassFibre.FCMat deleted file mode 100644 index 7f1ef6ac10..0000000000 --- a/src/Mod/Material/StandardMaterial/Glass-E-GlassFibre.FCMat +++ /dev/null @@ -1,18 +0,0 @@ -; Glass-E-GlassFibre -; (c) 2015 DaviKaur (CC-BY 3.0) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = Glass-E -Description = Glass Fibre -Father = Glass - -[Mechanical] -CompressiveStrength = 1080 MPa -Density = 2580 kg/m^3 -UltimateTensileStrength = 3445 MPa - -[Cost] -ProductURL = https://en.wikipedia.org/wiki/Glass_fiber diff --git a/src/Mod/Material/StandardMaterial/Glass-Generic.FCMat b/src/Mod/Material/StandardMaterial/Glass-Generic.FCMat deleted file mode 100644 index e339c6a00f..0000000000 --- a/src/Mod/Material/StandardMaterial/Glass-Generic.FCMat +++ /dev/null @@ -1,23 +0,0 @@ -; Glass-Generic -; (c) 2015 Przemo Firszt (CC-BY 3.0) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = Glass -Description = Generic soda-lime glass -DescriptionDE = Normalglas -DescriptionPL = Szkło sodowe -Father = Glass - -[Mechanical] -Density = 2520 kg/m^3 -PoissonRatio = 0.22 -YoungsModulus = 72000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000009 m/m/K - -[Cost] -ProductURL = https://en.wikipedia.org/wiki/Soda-lime_glass diff --git a/src/Mod/Material/StandardMaterial/Glass-S2-GlassFibre.FCMat b/src/Mod/Material/StandardMaterial/Glass-S2-GlassFibre.FCMat deleted file mode 100644 index 61e77d119e..0000000000 --- a/src/Mod/Material/StandardMaterial/Glass-S2-GlassFibre.FCMat +++ /dev/null @@ -1,18 +0,0 @@ -; Glass-S2-GlassFibre -; (c) 2015 DaviKaur (CC-BY 3.0) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = Glass-S2 -Description = Glass Fibre -Father = Glass - -[Mechanical] -CompressiveStrength = 1600 MPa -Density = 2460 kg/m^3 -UltimateTensileStrength = 4890 MPa - -[Cost] -ProductURL = https://en.wikipedia.org/wiki/Glass_fiber diff --git a/src/Mod/Material/StandardMaterial/Graphite.FCMat b/src/Mod/Material/StandardMaterial/Graphite.FCMat deleted file mode 100644 index f9b5a70a4c..0000000000 --- a/src/Mod/Material/StandardMaterial/Graphite.FCMat +++ /dev/null @@ -1,33 +0,0 @@ -; Graphite -; Uwe Stöhr, LGPL -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD 0.20.24516 (Git) - -[General] -Name = Graphite -Description = Typical material properties for pure graphite -Father = Carbon -KindOfMaterial = Solid -ReferenceSource = Properties and characteristics of graphite -SourceURL = https://www.entegris.com/content/dam/web/resources/manuals-and-guides/manual-properties-and-characteristics-of-graphite-109441.pdf - -[Mechanical] -CompressiveStrength = 120.000 MPa -Density = 1750.000 kg/m^3 -PoissonRatio = 0.20 -UltimateTensileStrength = 34 MPa -YoungsModulus = 11.7 MPa - -[Thermal] -SpecificHeat = 0.72 kJ/kg/K -ThermalConductivity = 96.000 W/m/K -ThermalExpansionCoefficient = 8e-6 1/K - -[Electromagnetic] -RelativePermittivity = 0.7 -ElectricalConductivity = 2e4 S/m -RelativePermeability = 1.0 - -[UserDefined] -MolarMass = 12 diff --git a/src/Mod/Material/StandardMaterial/Invar-Generic.FCMat b/src/Mod/Material/StandardMaterial/Invar-Generic.FCMat deleted file mode 100644 index acae1212f5..0000000000 --- a/src/Mod/Material/StandardMaterial/Invar-Generic.FCMat +++ /dev/null @@ -1,25 +0,0 @@ -; Invar Generic -; Uwe Stöhr -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD 0.21.30044 (Git) - -[General] -Name = Invar Generic -Father = Metal -KindOfMaterial = Nickel Iron Alloy - -[Mechanical] -Density = 8150 kg/m^3 -PoissonRatio = 0.29 -ShearModulus = 56.0 GPa -UltimateTensileStrength = 600 MPa -YoungsModulus = 140.0 GPa - -[Thermal] -SpecificHeat = 515.0 J/kg/K -ThermalConductivity = 13.5 W/m/K -ThermalExpansionCoefficient = 1.25 µm/m/K - -[Electromagnetic] -ElectricalConductivity = 1250000 S/m diff --git a/src/Mod/Material/StandardMaterial/Iron-Generic.FCMat b/src/Mod/Material/StandardMaterial/Iron-Generic.FCMat deleted file mode 100644 index dcfe1bb767..0000000000 --- a/src/Mod/Material/StandardMaterial/Iron-Generic.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Iron Generic -; Uwe Stöhr -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material - -[General] -Name = Iron Generic -Father = Metal -KindOfMaterial = Iron - -[Mechanical] -Density = 7874 kg/m^3 -PoissonRatio = 0.29 -ShearModulus = 82.0 GPa -UltimateTensileStrength = 497 MPa -YieldStrength = 428 MPa -YoungsModulus = 211 GPa - -[Thermal] -SpecificHeat = 460.5 J/kg/K -ThermalConductivity = 80.4 W/m/K -ThermalExpansionCoefficient = 11.8 µm/m/K - -[Electromagnetic] -ElectricalConductivity = 10.3 MS/m -RelativePermeability = 5000.0 diff --git a/src/Mod/Material/StandardMaterial/None.FCMat b/src/Mod/Material/StandardMaterial/None.FCMat deleted file mode 100644 index ddc08894ed..0000000000 --- a/src/Mod/Material/StandardMaterial/None.FCMat +++ /dev/null @@ -1,16 +0,0 @@ -; None -; (c) 2015 Przemo Firszt (CC-BY 3.0) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = None -Description = This is a not defined material -Father = None - -[Mechanical] -Density = 0 kg/m^3 -PoissonRatio = 0 -UltimateTensileStrength = 0 MPa -YoungsModulus = 0 MPa diff --git a/src/Mod/Material/StandardMaterial/PA6-Generic.FCMat b/src/Mod/Material/StandardMaterial/PA6-Generic.FCMat deleted file mode 100644 index 9db6124158..0000000000 --- a/src/Mod/Material/StandardMaterial/PA6-Generic.FCMat +++ /dev/null @@ -1,25 +0,0 @@ -; PA6-Generic -; (c) 2019 Uwe Stöhr (CC-BY 3.0) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = Polyamide 6 -SourceURL = http://www.matweb.com/search/datasheet.aspx?MatGUID=8d78f3cfcb6f49d595896ce6ce6a2ef1 - -[Mechanical] -CompressiveStrength = 67.6 MPa -Density = 1150 kg/m^3 -PoissonRatio = 0.39 -UltimateTensileStrength = 75.5 MPa -YieldStrength = 70.5 MPa -YoungsModulus = 2930 MPa - -[Thermal] -SpecificHeat = 1670 J/kg/K -ThermalConductivity = 0.262 W/m/K -ThermalExpansionCoefficient = 0.000082 m/m/K - -[Cost] -ProductURL = https://en.wikipedia.org/wiki/Nylon_6 diff --git a/src/Mod/Material/StandardMaterial/PET-Generic.FCMat b/src/Mod/Material/StandardMaterial/PET-Generic.FCMat deleted file mode 100644 index aea97917aa..0000000000 --- a/src/Mod/Material/StandardMaterial/PET-Generic.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; PET-Generic -; (c) 2019 Uwe Stöhr (CC-BY 3.0) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = PET -SourceURL = http://www.matweb.com/search/DataSheet.aspx?MatGUID=a696bdcdff6f41dd98f8eec3599eaa20 - -[Mechanical] -CompressiveStrength = 38.0 MPa -Density = 1380 kg/m^3 -PoissonRatio = 0.36 -ShearModulus = 0.0385 GPa -UltimateTensileStrength = 38.8 MPa -YieldStrength = 62.8 MPa -YoungsModulus = 3150 MPa - -[Thermal] -SpecificHeat = 1140 J/kg/K -ThermalConductivity = 0.181 W/m/K -ThermalExpansionCoefficient = 0.000072 m/m/K - -[Cost] -ProductURL = https://en.wikipedia.org/wiki/Polyethylene_terephthalate diff --git a/src/Mod/Material/StandardMaterial/PLA-Generic.FCMat b/src/Mod/Material/StandardMaterial/PLA-Generic.FCMat deleted file mode 100644 index 64f24a638f..0000000000 --- a/src/Mod/Material/StandardMaterial/PLA-Generic.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; PLA-Generic -; (c) 2019 Uwe Stöhr (CC-BY 3.0) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = PLA -Description = Polylactic acid or polylactide (PLA, Poly) is a biodegradable thermoplastic aliphatic polyester derived from renewable resources, such as corn starch, tapioca roots, chips, starch or sugarcane. -Father = Thermoplast -SourceURL = https://www.sd3d.com/wp-content/uploads/2017/06/MaterialTDS-PLA_01.pdf - -[Mechanical] -Density = 1240 kg/m^3 -PoissonRatio = 0.36 -UltimateTensileStrength = 26.4 MPa -YieldStrength = 35.9 MPa -YoungsModulus = 3640 MPa - -[Thermal] -SpecificHeat = 1800 J/kg/K -ThermalConductivity = 0.130 W/m/K -ThermalExpansionCoefficient = 0.000041 m/m/K - -[Cost] -ProductURL = https://en.wikipedia.org/wiki/Polylactic_acid diff --git a/src/Mod/Material/StandardMaterial/PP-Generic.FCMat b/src/Mod/Material/StandardMaterial/PP-Generic.FCMat deleted file mode 100644 index 172162b0b5..0000000000 --- a/src/Mod/Material/StandardMaterial/PP-Generic.FCMat +++ /dev/null @@ -1,25 +0,0 @@ -; PP-Generic -; (c) 2019 Uwe Stöhr (CC-BY 3.0) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = Polypropylene -SourceURL = http://www.matweb.com/search/DataSheet.aspx?MatGUID=a882a1c603374e278d062f106dfda95b - -[Mechanical] -CompressiveStrength = 10 MPa -Density = 916 kg/m^3 -PoissonRatio = 0.44 -UltimateTensileStrength = 79.7 MPa -YieldStrength = 32.8 MPa -YoungsModulus = 1470 MPa - -[Thermal] -SpecificHeat = 1920 J/kg/K -ThermalConductivity = 0.249 W/m/K -ThermalExpansionCoefficient = 0.000123 m/m/K - -[Cost] -ProductURL = https://en.wikipedia.org/wiki/Polypropylene diff --git a/src/Mod/Material/StandardMaterial/PTFE-Generic.FCMat b/src/Mod/Material/StandardMaterial/PTFE-Generic.FCMat deleted file mode 100644 index 06362ff068..0000000000 --- a/src/Mod/Material/StandardMaterial/PTFE-Generic.FCMat +++ /dev/null @@ -1,25 +0,0 @@ -; PTFE-Generic -; (c) 2019 Uwe Stöhr (CC-BY 3.0) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = PTFE -SourceURL = http://www.matweb.com/search/datasheet.aspx?MatGUID=4d14eac958e5401a8fd152e1261b6843 - -[Mechanical] -CompressiveStrength = 10.2 MPa -Density = 2070 kg/m^3 -PoissonRatio = 0.46 -UltimateTensileStrength = 34.6 MPa -YieldStrength = 20.5 MPa -YoungsModulus = 564 MPa - -[Thermal] -SpecificHeat = 1010 J/kg/K -ThermalConductivity = 0.263 W/m/K -ThermalExpansionCoefficient = 0.000108 m/m/K - -[Cost] -ProductURL = https://en.wikipedia.org/wiki/Polytetrafluoroethylene diff --git a/src/Mod/Material/StandardMaterial/PVC-Generic.FCMat b/src/Mod/Material/StandardMaterial/PVC-Generic.FCMat deleted file mode 100644 index c3f4455e5b..0000000000 --- a/src/Mod/Material/StandardMaterial/PVC-Generic.FCMat +++ /dev/null @@ -1,23 +0,0 @@ -; PVC-Generic -; (c) 2019 Uwe Stöhr (CC-BY 3.0) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = PVC -SourceURL = http://www.matweb.com/search/DataSheet.aspx?MatGUID=1f650966ec834bb8833dd4c6e3116079 - -[Mechanical] -Density = 1380 kg/m^3 -PoissonRatio = 0.38 -UltimateTensileStrength = 50 MPa -YoungsModulus = 2800 MPa - -[Thermal] -SpecificHeat = 1000 J/kg/K -ThermalConductivity = 0.150 W/m/K -ThermalExpansionCoefficient = 0.000075 m/m/K - -[Cost] -ProductURL = https://en.wikipedia.org/wiki/Polyvinyl_chloride diff --git a/src/Mod/Material/StandardMaterial/Readme.txt b/src/Mod/Material/StandardMaterial/Readme.txt deleted file mode 100644 index 2c42c08e75..0000000000 --- a/src/Mod/Material/StandardMaterial/Readme.txt +++ /dev/null @@ -1,23 +0,0 @@ -This is the FreeCAD standard material library. It's intended to gather -the most common Material definitions. -How to do a description is explained here: -https://www.freecad.org/wiki/Material - -To make the material description useful for a lot of applications only -files with the (CC BY 3.0) license will be accepted into the FreeCAD -source distribution. For more detail about the license, see here: -http://creativecommons.org/ - -Please help! -Enlargen the base of Materials for FreeCAD will greatly benefit the -usability of FreeCAD. So please help us to add new Materials, review -existing ones or add additional values. A good source for material -definitions are textbooks or the www.matweb.com database. - -2013 Juergen Riegel - -Edit: -This is work in progress. Please verify the material properties before -use. - -Please use the provided TEMPLATE.FCMat file to create new materials. diff --git a/src/Mod/Material/StandardMaterial/Reinforcement-FIB-B500.FCMat b/src/Mod/Material/StandardMaterial/Reinforcement-FIB-B500.FCMat deleted file mode 100644 index 2958fea2cc..0000000000 --- a/src/Mod/Material/StandardMaterial/Reinforcement-FIB-B500.FCMat +++ /dev/null @@ -1,15 +0,0 @@ -; Reinforcement-FIB-B500 -; (c) 2019 Bernd Hahnebach (CC-BY 3.0) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD 0.19.16886 (Git) - -[General] -Name = Reinforcement-Harry -Description = Reinforcement inside concrete for reinforcement material examples, from fib examples, 0.84 x 0.75 x 500 MPa = 315 MPa (https://forum.freecad.org/viewtopic.php?f=18&t=33106&start=200#p311705) - -[Mechanical] -Density = 7850 kg/m^3 -PoissonRatio = 0.3 -YieldStrength = 315 MPa -YoungsModulus = 210000 MPa diff --git a/src/Mod/Material/StandardMaterial/Steel-15CrNi6.FCMat b/src/Mod/Material/StandardMaterial/Steel-15CrNi6.FCMat deleted file mode 100644 index 07e962b3b6..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-15CrNi6.FCMat +++ /dev/null @@ -1,28 +0,0 @@ -; Steel-15CrNi6 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = 15CrNi6 -Description = High-strength carbon steel -DescriptionDE = höchste Beanspruchung, Achsen, Wellen, Ritzel, Nocken, Kegelräder -DescriptionPL = Wysokowytrzymała stal węglowa -Father = Metal -KindOfMaterial = Case-hardened steel -KindOfMaterialDE = Einsatzstahl -MaterialNumber = 1.5919 -Norm = EN 10084 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 9 -UltimateTensileStrength = 1000 MPa -YieldStrength = 680 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-17CrNiMo6.FCMat b/src/Mod/Material/StandardMaterial/Steel-17CrNiMo6.FCMat deleted file mode 100644 index ba354bec6a..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-17CrNiMo6.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-17CrNiMo6 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = 17CrNiMo6 -NameDE = 17CrNiMo6 -DescriptionDE = höchste Beanspruchung, Wellen, Zahnräder -Father = Metal -KindOfMaterial = Case-hardened steel -KindOfMaterialDE = Einsatzstahl -MaterialNumber = 1.6587 -Norm = EN 10084 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 8 -UltimateTensileStrength = 1150 MPa -YieldStrength = 830 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-1C22.FCMat b/src/Mod/Material/StandardMaterial/Steel-1C22.FCMat deleted file mode 100644 index de988855c5..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-1C22.FCMat +++ /dev/null @@ -1,29 +0,0 @@ -; Steel-1C22 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = 1C22 -NameDE = C22 -Description = Case hardened alloy steel -DescriptionDE = kleiner Vergütungsdurchmesser, gut schweißbar -DescriptionPL = Stal stopowa do nawęglania -Father = Metal -KindOfMaterial = Heat-treatable steel -KindOfMaterialDE = Vergütungsstahl -MaterialNumber = 1.0402 -Norm = EN 10083-1 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 27 -UltimateTensileStrength = 400 MPa -YieldStrength = 230 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-1C35.FCMat b/src/Mod/Material/StandardMaterial/Steel-1C35.FCMat deleted file mode 100644 index 65358d6f79..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-1C35.FCMat +++ /dev/null @@ -1,28 +0,0 @@ -; Steel-1C35 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = 1C35 -NameDE = C35 -Description = Non-alloy quality steel -DescriptionPL = Wysokogatunkowa stal niestopowa -Father = Metal -KindOfMaterial = Heat-treatable steel -KindOfMaterialDE = Vergütungsstahl -MaterialNumber = 1.0501 -Norm = EN 10083-1 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 21 -UltimateTensileStrength = 480 MPa -YieldStrength = 300 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-1C45.FCMat b/src/Mod/Material/StandardMaterial/Steel-1C45.FCMat deleted file mode 100644 index f335f2c871..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-1C45.FCMat +++ /dev/null @@ -1,28 +0,0 @@ -; Steel-1C45 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = 1C45 -NameDE = C45 -Description = Non-alloy quality steel -DescriptionPL = Wysokogatunkowa stal niestopowa -Father = Metal -KindOfMaterial = Heat-treatable steel -KindOfMaterialDE = Vergütungsstahl -MaterialNumber = 1.0503 -Norm = EN 10083-1 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 14 -UltimateTensileStrength = 580 MPa -YieldStrength = 340 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-1C60.FCMat b/src/Mod/Material/StandardMaterial/Steel-1C60.FCMat deleted file mode 100644 index 7c52f99de0..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-1C60.FCMat +++ /dev/null @@ -1,28 +0,0 @@ -; Steel-1C60 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = 1C60 -NameDE = C60 -Description = Non-alloy quality steel -DescriptionPL = Wysokogatunkowa stal niestopowa -Father = Metal -KindOfMaterial = Heat-treatable steel -KindOfMaterialDE = Vergütungsstahl -MaterialNumber = 1.0601 -Norm = EN 10083-1 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 11 -UltimateTensileStrength = 650 MPa -YieldStrength = 380 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-20NiCrMo2.FCMat b/src/Mod/Material/StandardMaterial/Steel-20NiCrMo2.FCMat deleted file mode 100644 index 55cf66bb63..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-20NiCrMo2.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-20NiCrMo2 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = 20NiCrMo2 -NameDE = 21NiCrMo2 -DescriptionDE = höchste Beanspruchung, Wellen, Zahnräder -Father = Metal -KindOfMaterial = Case-hardened steel -KindOfMaterialDE = Einsatzstahl -MaterialNumber = 1.6523 -Norm = EN 10084 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 10 -UltimateTensileStrength = 900 MPa -YieldStrength = 630 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-28Mn6.FCMat b/src/Mod/Material/StandardMaterial/Steel-28Mn6.FCMat deleted file mode 100644 index abfd94961d..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-28Mn6.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-28Mn6 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = 28Mn6 -NameDE = 28Mn6 -Father = Metal -KindOfMaterial = Heat-treatable steel -KindOfMaterialDE = Vergütungsstahl -MaterialNumber = 1.117 -Norm = EN 10083-1 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 13 -UltimateTensileStrength = 800 MPa -YieldStrength = 590 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-2C10.FCMat b/src/Mod/Material/StandardMaterial/Steel-2C10.FCMat deleted file mode 100644 index c2925a46fa..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-2C10.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-2C10 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = 2C10 -NameDE = Ck10 -Father = Metal -KindOfMaterial = Case-hardened steel -KindOfMaterialDE = Einsatzstahl -MaterialNumber = 1.1121 -Norm = EN 10084 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 0 -UltimateTensileStrength = 640 MPa -YieldStrength = 390 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-30CrNiMo8.FCMat b/src/Mod/Material/StandardMaterial/Steel-30CrNiMo8.FCMat deleted file mode 100644 index 2049d6fa33..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-30CrNiMo8.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-30CrNiMo8 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = 30CrNiMo8 -NameDE = 30CrNiMo8 -DescriptionDE = höchste Beanspruchung, Wellen, Zahnräder -Father = Metal -KindOfMaterial = Heat-treatable steel -KindOfMaterialDE = Vergütungsstahl -MaterialNumber = 1.658 -Norm = EN 10083-1 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 9 -UltimateTensileStrength = 1250 MPa -YieldStrength = 1050 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-34CrNiMo6.FCMat b/src/Mod/Material/StandardMaterial/Steel-34CrNiMo6.FCMat deleted file mode 100644 index f022606163..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-34CrNiMo6.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-34CrNiMo6 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = 34CrNiMo6 -NameDE = 34CrNiMo6 -DescriptionDE = höchste Beanspruchung, Wellen, Zahnräder -Father = Metal -KindOfMaterial = Heat-treatable steel -KindOfMaterialDE = Vergütungsstahl -MaterialNumber = 1.6582 -Norm = EN 10083-1 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 9 -UltimateTensileStrength = 1200 MPa -YieldStrength = 1000 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-36CrNiMo4.FCMat b/src/Mod/Material/StandardMaterial/Steel-36CrNiMo4.FCMat deleted file mode 100644 index 2c2d22037a..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-36CrNiMo4.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-36CrNiMo4 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = 36CrNiMo4 -NameDE = 36CrNiMo4 -DescriptionDE = höchste Beanspruchung, Wellen, Zahnräder -Father = Metal -KindOfMaterial = Heat-treatable steel -KindOfMaterialDE = Vergütungsstahl -MaterialNumber = 1.6511 -Norm = EN 10083-1 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 10 -UltimateTensileStrength = 1100 MPa -YieldStrength = 900 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-36NiCrMo16.FCMat b/src/Mod/Material/StandardMaterial/Steel-36NiCrMo16.FCMat deleted file mode 100644 index 3c67ef0d84..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-36NiCrMo16.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-36NiCrMo16 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = 36NiCrMo16 -NameDE = 36NiCrMo16 -DescriptionDE = höchste Beanspruchung, Wellen, Zahnräder -Father = Metal -KindOfMaterial = Heat-treatable steel -KindOfMaterialDE = Vergütungsstahl -MaterialNumber = 1.6773 -Norm = EN 10083-1 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 9 -UltimateTensileStrength = 1250 MPa -YieldStrength = 1050 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-3C15.FCMat b/src/Mod/Material/StandardMaterial/Steel-3C15.FCMat deleted file mode 100644 index c1ec6e82f3..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-3C15.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-3C15 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = 3C15 -NameDE = Cm15 -Father = Metal -KindOfMaterial = Case-hardened steel -KindOfMaterialDE = Einsatzstahl -MaterialNumber = 1.114 -Norm = EN 10084 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 0 -UltimateTensileStrength = 740 MPa -YieldStrength = 440 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-3C22.FCMat b/src/Mod/Material/StandardMaterial/Steel-3C22.FCMat deleted file mode 100644 index 86bf566666..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-3C22.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-3C22 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = 3C22 -NameDE = Cm22 -Father = Metal -KindOfMaterial = Heat-treatable steel -KindOfMaterialDE = Vergütungsstahl -MaterialNumber = 1.1149 -Norm = EN 10083-1 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 24 -UltimateTensileStrength = 550 MPa -YieldStrength = 350 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-3C35.FCMat b/src/Mod/Material/StandardMaterial/Steel-3C35.FCMat deleted file mode 100644 index 82794a57d6..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-3C35.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-3C35 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = 3C35 -NameDE = Cm35 -Father = Metal -KindOfMaterial = Heat-treatable steel -KindOfMaterialDE = Vergütungsstahl -MaterialNumber = 1.118 -Norm = EN 10083-1 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 17 -UltimateTensileStrength = 630 MPa -YieldStrength = 430 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-3V45.FCMat b/src/Mod/Material/StandardMaterial/Steel-3V45.FCMat deleted file mode 100644 index 753b6820ed..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-3V45.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-3V45 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = 3V45 -NameDE = Cm45 -Father = Metal -KindOfMaterial = Heat-treatable steel -KindOfMaterialDE = Vergütungsstahl -MaterialNumber = 1.1201 -Norm = EN 10083-1 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 14 -UltimateTensileStrength = 700 MPa -YieldStrength = 500 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-C10.FCMat b/src/Mod/Material/StandardMaterial/Steel-C10.FCMat deleted file mode 100644 index ba357cd59f..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-C10.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-C10 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = C10 -NameDE = C10 -Father = Metal -KindOfMaterial = Case-hardened steel -KindOfMaterialDE = Einsatzstahl -MaterialNumber = 1.0301 -Norm = DIN 17210 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 16 -UltimateTensileStrength = 650 MPa -YieldStrength = 380 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-C15.FCMat b/src/Mod/Material/StandardMaterial/Steel-C15.FCMat deleted file mode 100644 index 8e848bf886..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-C15.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-C15 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = C15 -NameDE = C15 -Father = Metal -KindOfMaterial = Case-hardened steel -KindOfMaterialDE = Einsatzstahl -MaterialNumber = 1.0401 -Norm = DIN 17210 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 14 -UltimateTensileStrength = 750 MPa -YieldStrength = 430 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-C22E.FCMat b/src/Mod/Material/StandardMaterial/Steel-C22E.FCMat deleted file mode 100644 index 2ab93f02df..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-C22E.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-C22E -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = C22E -NameDE = Ck22 -Father = Metal -KindOfMaterial = Heat-treatable steel -KindOfMaterialDE = Vergütungsstahl -MaterialNumber = 1.1151 -Norm = EN 10083-1 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 20 -UltimateTensileStrength = 500 MPa -YieldStrength = 340 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-C25E.FCMat b/src/Mod/Material/StandardMaterial/Steel-C25E.FCMat deleted file mode 100644 index fcf39af240..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-C25E.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-C25E -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = C25E -NameDE = Ck25 -Father = Metal -KindOfMaterial = Heat-treatable steel -KindOfMaterialDE = Vergütungsstahl -MaterialNumber = 1.1158 -Norm = EN 10083-1 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 19 -UltimateTensileStrength = 550 MPa -YieldStrength = 370 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-C30E.FCMat b/src/Mod/Material/StandardMaterial/Steel-C30E.FCMat deleted file mode 100644 index 7ad49ed63b..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-C30E.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-C30E -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = C30E -NameDE = Ck30 -Father = Metal -KindOfMaterial = Heat-treatable steel -KindOfMaterialDE = Vergütungsstahl -MaterialNumber = 1.1178 -Norm = EN 10083-1 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 18 -UltimateTensileStrength = 600 MPa -YieldStrength = 400 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-C40E.FCMat b/src/Mod/Material/StandardMaterial/Steel-C40E.FCMat deleted file mode 100644 index 09cbb1eec9..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-C40E.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-C40E -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = C40E -NameDE = Ck40 -Father = Metal -KindOfMaterial = Heat-treatable steel -KindOfMaterialDE = Vergütungsstahl -MaterialNumber = 1.1186 -Norm = EN 10083-1 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 16 -UltimateTensileStrength = 650 MPa -YieldStrength = 460 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-C50E.FCMat b/src/Mod/Material/StandardMaterial/Steel-C50E.FCMat deleted file mode 100644 index afa4887fa8..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-C50E.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-C50E -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = C50E -NameDE = Ck50 -Father = Metal -KindOfMaterial = Heat-treatable steel -KindOfMaterialDE = Vergütungsstahl -MaterialNumber = 1.1206 -Norm = EN 10083-1 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 13 -UltimateTensileStrength = 750 MPa -YieldStrength = 520 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-C55E.FCMat b/src/Mod/Material/StandardMaterial/Steel-C55E.FCMat deleted file mode 100644 index 76922f2f77..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-C55E.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-C55E -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = C55E -NameDE = Ck55 -Father = Metal -KindOfMaterial = Heat-treatable steel -KindOfMaterialDE = Vergütungsstahl -MaterialNumber = 1.1203 -Norm = EN 10083-1 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 13 -UltimateTensileStrength = 800 MPa -YieldStrength = 550 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-C60E.FCMat b/src/Mod/Material/StandardMaterial/Steel-C60E.FCMat deleted file mode 100644 index 91e890de86..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-C60E.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-C60E -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = C60E -NameDE = Ck60 -Father = Metal -KindOfMaterial = Heat-treatable steel -KindOfMaterialDE = Vergütungsstahl -MaterialNumber = 1.1221 -Norm = EN 10083-1 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 13 -UltimateTensileStrength = 850 MPa -YieldStrength = 580 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-E295-GC.FCMat b/src/Mod/Material/StandardMaterial/Steel-E295-GC.FCMat deleted file mode 100644 index f644665742..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-E295-GC.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-E295-GC -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = E295 GC -NameDE = St50-2K -Father = Metal -KindOfMaterial = Mild steel -KindOfMaterialDE = Baustahl -MaterialNumber = 1.0533 -Norm = EN 10025 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 0 -UltimateTensileStrength = 590 MPa -YieldStrength = 420 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-E295.FCMat b/src/Mod/Material/StandardMaterial/Steel-E295.FCMat deleted file mode 100644 index 60ad178cbf..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-E295.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-E295 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = E295 -NameDE = St50-2 -Father = Metal -KindOfMaterial = Mild steel -KindOfMaterialDE = Baustahl -MaterialNumber = 1.005 -Norm = EN 10025 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 20 -UltimateTensileStrength = 490 MPa -YieldStrength = 295 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-E335-GC.FCMat b/src/Mod/Material/StandardMaterial/Steel-E335-GC.FCMat deleted file mode 100644 index 6ac331ec72..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-E335-GC.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-E335-GC -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = E335 GC -NameDE = St60-2K -Father = Metal -KindOfMaterial = Mild steel -KindOfMaterialDE = Baustahl -MaterialNumber = 1.0543 -Norm = EN 10025 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 0 -UltimateTensileStrength = 690 MPa -YieldStrength = 490 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-E335.FCMat b/src/Mod/Material/StandardMaterial/Steel-E335.FCMat deleted file mode 100644 index 50178c855d..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-E335.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-E335 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = E335 -NameDE = St60-2 -Father = Metal -KindOfMaterial = Mild steel -KindOfMaterialDE = Baustahl -MaterialNumber = 1.006 -Norm = EN 10025 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 16 -UltimateTensileStrength = 590 MPa -YieldStrength = 335 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-E360-GC.FCMat b/src/Mod/Material/StandardMaterial/Steel-E360-GC.FCMat deleted file mode 100644 index ca79ddef0e..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-E360-GC.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-E360-GC -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = E360 GC -NameDE = St70-2K -Father = Metal -KindOfMaterial = Mild steel -KindOfMaterialDE = Baustahl -MaterialNumber = 1.0633 -Norm = EN 10025 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 0 -UltimateTensileStrength = 780 MPa -YieldStrength = 560 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-E360.FCMat b/src/Mod/Material/StandardMaterial/Steel-E360.FCMat deleted file mode 100644 index 24730eb4a3..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-E360.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-E360 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = E360 -NameDE = St70-2 -Father = Metal -KindOfMaterial = Mild steel -KindOfMaterialDE = Baustahl -MaterialNumber = 1.007 -Norm = EN 10025 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 11 -UltimateTensileStrength = 690 MPa -YieldStrength = 360 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-EN-GJL-100.FCMat b/src/Mod/Material/StandardMaterial/Steel-EN-GJL-100.FCMat deleted file mode 100644 index 129d1e82b3..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-EN-GJL-100.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-EN-GJL-100 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = EN-GJL-100 -NameDE = GG-10 -DescriptionDE = für gering beanspruchte Teile -Father = Metal -KindOfMaterial = Cast iron -KindOfMaterialDE = Guss -MaterialNumber = 0.601 -Norm = EN 1561 - -[Mechanical] -Density = 7200 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 34000 MPa -UltimateStrain = 0 -UltimateTensileStrength = 100 MPa -YoungsModulus = 88000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.00001 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-EN-GJL-150.FCMat b/src/Mod/Material/StandardMaterial/Steel-EN-GJL-150.FCMat deleted file mode 100644 index 99139e2a7c..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-EN-GJL-150.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-EN-GJL-150 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = EN-GJL-150 -NameDE = GG-15 -DescriptionDE = für dünnwandige Teile wie Gehäuse, Ständer -Father = Metal -KindOfMaterial = Cast iron -KindOfMaterialDE = Guss -MaterialNumber = 0.6015 -Norm = EN 1561 - -[Mechanical] -Density = 7200 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 37000 MPa -UltimateStrain = 0 -UltimateTensileStrength = 150 MPa -YieldStrength = 98 MPa -YoungsModulus = 95000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.00001 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-EN-GJL-200.FCMat b/src/Mod/Material/StandardMaterial/Steel-EN-GJL-200.FCMat deleted file mode 100644 index 53180c3e24..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-EN-GJL-200.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-EN-GJL-200 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = EN-GJL-200 -NameDE = GG-20 -DescriptionDE = Hebel, Lager , Lagerböcke -Father = Metal -KindOfMaterial = Cast iron -KindOfMaterialDE = Guss -MaterialNumber = 0.602 -Norm = EN 1561 - -[Mechanical] -Density = 7200 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 40000 MPa -UltimateStrain = 0 -UltimateTensileStrength = 200 MPa -YieldStrength = 130 MPa -YoungsModulus = 105000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.00001 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-EN-GJL-250.FCMat b/src/Mod/Material/StandardMaterial/Steel-EN-GJL-250.FCMat deleted file mode 100644 index 368068a83b..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-EN-GJL-250.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-EN-GJL-250 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = EN-GJL-250 -NameDE = GG-25 -Father = Metal -KindOfMaterial = Cast iron -KindOfMaterialDE = Guss -MaterialNumber = 0.6025 -Norm = EN 1561 - -[Mechanical] -Density = 7200 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 44000 MPa -UltimateStrain = 0 -UltimateTensileStrength = 250 MPa -YieldStrength = 165 MPa -YoungsModulus = 115000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.00001 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-EN-GJL-300.FCMat b/src/Mod/Material/StandardMaterial/Steel-EN-GJL-300.FCMat deleted file mode 100644 index f9fa8f060f..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-EN-GJL-300.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-EN-GJL-300 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = EN-GJL-300 -NameDE = GG-30 -DescriptionDE = hochbeanspruchbar, für Motorständer, Lagerschalen -Father = Metal -KindOfMaterial = Cast iron -KindOfMaterialDE = Guss -MaterialNumber = 0.603 -Norm = EN 1561 - -[Mechanical] -Density = 7200 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 48000 MPa -UltimateStrain = 0 -UltimateTensileStrength = 300 MPa -YieldStrength = 195 MPa -YoungsModulus = 125000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.00001 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-EN-GJL-350.FCMat b/src/Mod/Material/StandardMaterial/Steel-EN-GJL-350.FCMat deleted file mode 100644 index cdc01bd40c..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-EN-GJL-350.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-EN-GJL-350 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = EN-GJL-350 -NameDE = GG-35 -DescriptionDE = höchstbeanspruchbar, für Teile mit konstanter Wanddicke, Pressenständer, Turbinengehäuse -Father = Metal -KindOfMaterial = Cast iron -KindOfMaterialDE = Guss -MaterialNumber = 0.6035 -Norm = EN 1561 - -[Mechanical] -Density = 7200 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 52000 MPa -UltimateStrain = 15 -UltimateTensileStrength = 350 MPa -YieldStrength = 228 MPa -YoungsModulus = 135000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.00001 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-EN-GJMB-350-10.FCMat b/src/Mod/Material/StandardMaterial/Steel-EN-GJMB-350-10.FCMat deleted file mode 100644 index e724dc67b5..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-EN-GJMB-350-10.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-EN-GJMB-350-10 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = EN-GJMB-350-10 -NameDE = GTS 35-10 -DescriptionDE = gut spanbar, Schaltgabeln, Getriebe-, Achsgehäuse -Father = Metal -KindOfMaterial = Cast iron -KindOfMaterialDE = Guss -MaterialNumber = 0.8135 -Norm = EN 1562 - -[Mechanical] -Density = 7200 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 67000 MPa -UltimateStrain = 10 -UltimateTensileStrength = 350 MPa -YieldStrength = 200 MPa -YoungsModulus = 175000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.00001 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-EN-GJMB-550-4.FCMat b/src/Mod/Material/StandardMaterial/Steel-EN-GJMB-550-4.FCMat deleted file mode 100644 index 807a1c9109..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-EN-GJMB-550-4.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-EN-GJMB-550-4 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = EN-GJMB-550-4 -NameDE = GTS 55-04 -DescriptionDE = Randschichthärtung, Kurbelwellen, Bremsträger, Federböcke, Kipphebel -Father = Metal -KindOfMaterial = Cast iron -KindOfMaterialDE = Guss -MaterialNumber = 0.8155 -Norm = EN 1562 - -[Mechanical] -Density = 7200 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 67000 MPa -UltimateStrain = 2 -UltimateTensileStrength = 550 MPa -YieldStrength = 340 MPa -YoungsModulus = 175000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.00001 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-EN-GJMB-650-2.FCMat b/src/Mod/Material/StandardMaterial/Steel-EN-GJMB-650-2.FCMat deleted file mode 100644 index bddb453a4a..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-EN-GJMB-650-2.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-EN-GJMB-650-2 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = EN-GJMB-650-2 -NameDE = GTS 65-02 -DescriptionDE = Gabelköpfe -Father = Metal -KindOfMaterial = Cast iron -KindOfMaterialDE = Guss -MaterialNumber = 0.8165 -Norm = EN 1562 - -[Mechanical] -Density = 7200 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 67000 MPa -UltimateStrain = 2 -UltimateTensileStrength = 650 MPa -YieldStrength = 430 MPa -YoungsModulus = 175000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.00001 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-EN-GJMW-350-4.FCMat b/src/Mod/Material/StandardMaterial/Steel-EN-GJMW-350-4.FCMat deleted file mode 100644 index 65033067a6..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-EN-GJMW-350-4.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-EN-GJMW-350-4 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = EN-GJMW-350-4 -NameDE = GTW 35-04 -DescriptionDE = dünnwandige Teile, Fittings, Beschläge, Förderketten -Father = Metal -KindOfMaterial = Cast iron -KindOfMaterialDE = Guss -MaterialNumber = 0.8035 -Norm = EN 1562 - -[Mechanical] -Density = 7200 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 67000 MPa -UltimateStrain = 4 -UltimateTensileStrength = 350 MPa -YoungsModulus = 175000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.00001 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-EN-GJMW-360-12.FCMat b/src/Mod/Material/StandardMaterial/Steel-EN-GJMW-360-12.FCMat deleted file mode 100644 index 1f2884e0f2..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-EN-GJMW-360-12.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-EN-GJMW-360-12 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = EN-GJMW-360-12 -NameDE = GTW S38-12 -DescriptionDE = für Verbundschweißteile -Father = Metal -KindOfMaterial = Cast iron -KindOfMaterialDE = Guss -MaterialNumber = 0.8038 -Norm = EN 1562 - -[Mechanical] -Density = 7200 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 67000 MPa -UltimateStrain = 5 -UltimateTensileStrength = 380 MPa -YieldStrength = 200 MPa -YoungsModulus = 175000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.00001 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-EN-GJMW-400-5.FCMat b/src/Mod/Material/StandardMaterial/Steel-EN-GJMW-400-5.FCMat deleted file mode 100644 index 6bbf2ba5fe..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-EN-GJMW-400-5.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-EN-GJMW-400-5 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = EN-GJMW-400-5 -NameDE = GTW 40-05 -DescriptionDE = gut schweißbar, Auspuffkrümmer, Schraubzwingen -Father = Metal -KindOfMaterial = Cast iron -KindOfMaterialDE = Guss -MaterialNumber = 0.804 -Norm = EN 1562 - -[Mechanical] -Density = 7200 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 67000 MPa -UltimateStrain = 7 -UltimateTensileStrength = 400 MPa -YieldStrength = 220 MPa -YoungsModulus = 175000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.00001 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-EN-GJMW-450-7.FCMat b/src/Mod/Material/StandardMaterial/Steel-EN-GJMW-450-7.FCMat deleted file mode 100644 index 8728324608..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-EN-GJMW-450-7.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-EN-GJMW-450-7 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = EN-GJMW-450-7 -NameDE = GTW 45-07 -DescriptionDE = schlagfest, Fahrwerksteile -Father = Metal -KindOfMaterial = Cast iron -KindOfMaterialDE = Guss -MaterialNumber = 0.8045 -Norm = EN 1562 - -[Mechanical] -Density = 7200 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 67000 MPa -UltimateStrain = 10 -UltimateTensileStrength = 450 MPa -YieldStrength = 260 MPa -YoungsModulus = 175000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.00001 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-EN-GJS-400-15.FCMat b/src/Mod/Material/StandardMaterial/Steel-EN-GJS-400-15.FCMat deleted file mode 100644 index ed57c3608d..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-EN-GJS-400-15.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-EN-GJS-400-15 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = EN-GJS-400-15 -NameDE = GGG-40 -DescriptionDE = Pumpen-, Getriebegehäuse -Father = Metal -KindOfMaterial = Cast iron -KindOfMaterialDE = Guss -MaterialNumber = 0.704 -Norm = EN 1563 - -[Mechanical] -Density = 7200 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 65000 MPa -UltimateStrain = 15 -UltimateTensileStrength = 400 MPa -YieldStrength = 250 MPa -YoungsModulus = 167000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-EN-GJS-500-7.FCMat b/src/Mod/Material/StandardMaterial/Steel-EN-GJS-500-7.FCMat deleted file mode 100644 index 83e9e19d8d..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-EN-GJS-500-7.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-EN-GJS-500-7 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = EN-GJS-500-7 -NameDE = GGG-50 -DescriptionDE = Seiltrommeln, Bremsteile, Zylinderköpfe -Father = Metal -KindOfMaterial = Cast iron -KindOfMaterialDE = Guss -MaterialNumber = 0.705 -Norm = EN 1563 - -[Mechanical] -Density = 7200 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 66000 MPa -UltimateStrain = 2 -UltimateTensileStrength = 500 MPa -YieldStrength = 320 MPa -YoungsModulus = 170000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-EN-GJS-600-3.FCMat b/src/Mod/Material/StandardMaterial/Steel-EN-GJS-600-3.FCMat deleted file mode 100644 index 4ba156b22f..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-EN-GJS-600-3.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-EN-GJS-600-3 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = EN-GJS-600-3 -NameDE = GGG-60 -DescriptionDE = Kurbelwellen, Stangen -Father = Metal -KindOfMaterial = Cast iron -KindOfMaterialDE = Guss -MaterialNumber = 0.706 -Norm = EN 1563 - -[Mechanical] -Density = 7200 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 67000 MPa -UltimateStrain = 2 -UltimateTensileStrength = 600 MPa -YieldStrength = 370 MPa -YoungsModulus = 177000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-EN-GJS-700-2.FCMat b/src/Mod/Material/StandardMaterial/Steel-EN-GJS-700-2.FCMat deleted file mode 100644 index 4b930f03f2..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-EN-GJS-700-2.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-EN-GJS-700-2 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = EN-GJS-700-2 -NameDE = GGG-70 -DescriptionDE = Kurbelwellen, Zahnräder, Turbinenschaufeln -Father = Metal -KindOfMaterial = Cast iron -KindOfMaterialDE = Guss -MaterialNumber = 0.707 -Norm = EN 1563 - -[Mechanical] -Density = 7200 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 67000 MPa -UltimateStrain = 2 -UltimateTensileStrength = 700 MPa -YieldStrength = 420 MPa -YoungsModulus = 180000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-EN-GJS-800-1.FCMat b/src/Mod/Material/StandardMaterial/Steel-EN-GJS-800-1.FCMat deleted file mode 100644 index 648630505e..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-EN-GJS-800-1.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-EN-GJS-800-1 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = EN-GJS-800-1 -NameDE = GGG-80 -DescriptionDE = Zahnräder -Father = Metal -KindOfMaterial = Cast iron -KindOfMaterialDE = Guss -MaterialNumber = 0.708 -Norm = EN 1563 - -[Mechanical] -Density = 7200 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 67000 MPa -UltimateStrain = 2 -UltimateTensileStrength = 800 MPa -YieldStrength = 480 MPa -YoungsModulus = 180000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-G16Mn5.FCMat b/src/Mod/Material/StandardMaterial/Steel-G16Mn5.FCMat deleted file mode 100644 index 06e7d7a8fb..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-G16Mn5.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-G16Mn5 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = G16Mn5 -NameDE = GS-16Mn5N -DescriptionDE = Gehäuse, Zahnräder, Bremsscheiben -Father = Metal -KindOfMaterial = Cast steel -KindOfMaterialDE = Stahlguss -MaterialNumber = 1.1131 -Norm = DIN 1681 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 0 -UltimateTensileStrength = 430 MPa -YieldStrength = 260 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-G200.FCMat b/src/Mod/Material/StandardMaterial/Steel-G200.FCMat deleted file mode 100644 index 8309360f62..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-G200.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-G200 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = G200 -NameDE = GS 38 -DescriptionDE = mittlere dynamische und stoßartige Belastung, gut schweißbar -Father = Metal -KindOfMaterial = Cast steel -KindOfMaterialDE = Stahlguss -MaterialNumber = 1.042 -Norm = DIN 1681 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 25 -UltimateTensileStrength = 380 MPa -YieldStrength = 200 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-G20Mn5.FCMat b/src/Mod/Material/StandardMaterial/Steel-G20Mn5.FCMat deleted file mode 100644 index bfa1121fb8..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-G20Mn5.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-G20Mn5 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = G20Mn5 -NameDE = GS-20Mn5v -DescriptionDE = Gehäuse, Zahnräder, Bremsscheiben -Father = Metal -KindOfMaterial = Cast steel -KindOfMaterialDE = Stahlguss -MaterialNumber = 1.112 -Norm = DIN 1681 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 0 -UltimateTensileStrength = 500 MPa -YieldStrength = 360 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-G230.FCMat b/src/Mod/Material/StandardMaterial/Steel-G230.FCMat deleted file mode 100644 index 9fc39761a9..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-G230.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-G230 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = G230 -NameDE = GS 45 -DescriptionDE = mittlere dynamische und stoßartige Belastung, gut schweißbar -Father = Metal -KindOfMaterial = Cast steel -KindOfMaterialDE = Stahlguss -MaterialNumber = 1.0446 -Norm = DIN 1681 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 22 -UltimateTensileStrength = 450 MPa -YieldStrength = 230 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-G260.FCMat b/src/Mod/Material/StandardMaterial/Steel-G260.FCMat deleted file mode 100644 index a83b482620..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-G260.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-G260 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = G260 -NameDE = GS 52 -Father = Metal -KindOfMaterial = Cast steel -KindOfMaterialDE = Stahlguss -MaterialNumber = 1.0552 -Norm = DIN 1681 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 18 -UltimateTensileStrength = 520 MPa -YieldStrength = 260 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-G300.FCMat b/src/Mod/Material/StandardMaterial/Steel-G300.FCMat deleted file mode 100644 index 79cdc3d95e..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-G300.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-G300 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = G300 -NameDE = GS 60 -Father = Metal -KindOfMaterial = Cast steel -KindOfMaterialDE = Stahlguss -MaterialNumber = 1.0558 -Norm = DIN 1681 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 15 -UltimateTensileStrength = 600 MPa -YieldStrength = 300 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-G30Mn5.FCMat b/src/Mod/Material/StandardMaterial/Steel-G30Mn5.FCMat deleted file mode 100644 index a2c6b41520..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-G30Mn5.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-G30Mn5 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = G30Mn5 -NameDE = GS-30Mn5 -Father = Metal -KindOfMaterial = Cast steel -KindOfMaterialDE = Stahlguss -MaterialNumber = 1.1165 -Norm = DIN 17205 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 14 -UltimateTensileStrength = 520 MPa -YieldStrength = 400 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-Generic.FCMat b/src/Mod/Material/StandardMaterial/Steel-Generic.FCMat deleted file mode 100644 index 0e3beb43bf..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-Generic.FCMat +++ /dev/null @@ -1,23 +0,0 @@ -; Steel-Generic -; (c) 2013 Juergen Riegel (CC-BY 3.0) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = Steel-Generic -Description = This is a blend Steel material card. The values are at the low end of the spectrum. If you need a more precise material definition use the more specialised steel cards. -Father = Metal - -[Mechanical] -Density = 7900 kg/m^3 -PoissonRatio = 0.3 -YoungsModulus = 200000 MPa - -[Thermal] -SpecificHeat = 500 J/kg/K -ThermalConductivity = 50 W/m/K -ThermalExpansionCoefficient = 0.000012 m/m/K - -[Cost] -ProductURL = https://en.wikipedia.org/wiki/Steel diff --git a/src/Mod/Material/StandardMaterial/Steel-S185.FCMat b/src/Mod/Material/StandardMaterial/Steel-S185.FCMat deleted file mode 100644 index 8f4f0597ae..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-S185.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-S185 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = S185 -NameDE = St33 -DescriptionDE = für geringe Beanspruchung -Father = Metal -KindOfMaterial = Mild steel -KindOfMaterialDE = Baustahl -MaterialNumber = 1.0035 -Norm = EN 10025 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 18 -UltimateTensileStrength = 310 MPa -YieldStrength = 190 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-S235JO.FCMat b/src/Mod/Material/StandardMaterial/Steel-S235JO.FCMat deleted file mode 100644 index ac8b5b633f..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-S235JO.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-S235JO -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = S235JO -NameDE = St37-3U -Father = Metal -KindOfMaterial = Mild steel -KindOfMaterialDE = Baustahl -MaterialNumber = 1.0114 -Norm = EN 10025 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 26 -UltimateTensileStrength = 360 MPa -YieldStrength = 235 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-S235JR.FCMat b/src/Mod/Material/StandardMaterial/Steel-S235JR.FCMat deleted file mode 100644 index fbdea0ea77..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-S235JR.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-S235JR -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = S235JR -NameDE = St37-2 -DescriptionDE = üblich für mäßige Beanspruchung, gut schweißbar, nicht für Hilfsrahmen -Father = Metal -KindOfMaterial = Mild steel -KindOfMaterialDE = Baustahl -MaterialNumber = 1.0037 -Norm = EN 10025 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 26 -UltimateTensileStrength = 360 MPa -YieldStrength = 235 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-S235JRG1.FCMat b/src/Mod/Material/StandardMaterial/Steel-S235JRG1.FCMat deleted file mode 100644 index 192330e502..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-S235JRG1.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-S235JRG1 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = S235JRG1 -NameDE = USt37-2 -DescriptionDE = üblich für mäßige Beanspruchung -Father = Metal -KindOfMaterial = Mild steel -KindOfMaterialDE = Baustahl -MaterialNumber = 1.0036 -Norm = EN 10025 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 26 -UltimateTensileStrength = 360 MPa -YieldStrength = 235 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-S260NC.FCMat b/src/Mod/Material/StandardMaterial/Steel-S260NC.FCMat deleted file mode 100644 index e3ea55b6b4..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-S260NC.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-S260NC -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = S260NC -NameDE = QStE260 N -DescriptionDE = gut biegbar, Fahrgestellrahmen, Hilfsrahmen, nicht für Punktlasten -Father = Metal -KindOfMaterial = Cold forming steel -KindOfMaterialDE = Kaltumformstahl -MaterialNumber = 1.0971 -Norm = SEW 092 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 30 -UltimateTensileStrength = 350 MPa -YieldStrength = 280 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-S275JO.FCMat b/src/Mod/Material/StandardMaterial/Steel-S275JO.FCMat deleted file mode 100644 index 6ceb99c79e..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-S275JO.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-S275JO -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = S275JO -NameDE = St44-3U -Father = Metal -KindOfMaterial = Mild steel -KindOfMaterialDE = Baustahl -MaterialNumber = 1.0143 -Norm = EN 10025 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 22 -UltimateTensileStrength = 430 MPa -YieldStrength = 275 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-S275JR.FCMat b/src/Mod/Material/StandardMaterial/Steel-S275JR.FCMat deleted file mode 100644 index 8735369352..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-S275JR.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-S275JR -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = S275JR -NameDE = St44-2 -DescriptionDE = Wellen, Achsen, gut bearbeitbar, gut schweißbar -Father = Metal -KindOfMaterial = Mild steel -KindOfMaterialDE = Baustahl -MaterialNumber = 1.0044 -Norm = EN 10025 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 22 -UltimateTensileStrength = 430 MPa -YieldStrength = 275 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-S275N.FCMat b/src/Mod/Material/StandardMaterial/Steel-S275N.FCMat deleted file mode 100644 index 4c27237bfc..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-S275N.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-S275N -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = S275N -NameDE = St E 275 -Father = Metal -KindOfMaterial = Fine grain steel -KindOfMaterialDE = Feinkornstahl -MaterialNumber = 1.049 -Norm = EN 10113-2 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 24 -UltimateTensileStrength = 370 MPa -YieldStrength = 275 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-S335JO.FCMat b/src/Mod/Material/StandardMaterial/Steel-S335JO.FCMat deleted file mode 100644 index f9cc991517..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-S335JO.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-S335JO -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = S335JO -NameDE = St60-2U -Father = Metal -KindOfMaterial = Mild steel -KindOfMaterialDE = Baustahl -MaterialNumber = 1.0553 -Norm = EN 10025 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 22 -UltimateTensileStrength = 510 MPa -YieldStrength = 355 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-S335JR.FCMat b/src/Mod/Material/StandardMaterial/Steel-S335JR.FCMat deleted file mode 100644 index 380010c7b0..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-S335JR.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-S335JR -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = S335JR -NameDE = St53-3 -Father = Metal -KindOfMaterial = Mild steel -KindOfMaterialDE = Baustahl -MaterialNumber = 1.0045 -Norm = EN 10025 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 22 -UltimateTensileStrength = 510 MPa -YieldStrength = 355 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-S335N.FCMat b/src/Mod/Material/StandardMaterial/Steel-S335N.FCMat deleted file mode 100644 index 3ca21aa36b..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-S335N.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-S335N -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = S335N -NameDE = St E 355 -Father = Metal -KindOfMaterial = Fine grain steel -KindOfMaterialDE = Feinkornstahl -MaterialNumber = 1.0545 -Norm = EN 10113-2 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 22 -UltimateTensileStrength = 470 MPa -YieldStrength = 355 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-S340MC.FCMat b/src/Mod/Material/StandardMaterial/Steel-S340MC.FCMat deleted file mode 100644 index 95ea56bcda..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-S340MC.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-S340MC -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = S340MC -NameDE = QStE340 TM -DescriptionDE = gut biegbar, Fahrgestellrahmen, Hilfsrahmen, nicht für Punktlasten -Father = Metal -KindOfMaterial = Cold forming steel -KindOfMaterialDE = Kaltumformstahl -MaterialNumber = 1.0974 -Norm = SEW 092 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 25 -UltimateTensileStrength = 480 MPa -YieldStrength = 340 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-S355J2G3.FCMat b/src/Mod/Material/StandardMaterial/Steel-S355J2G3.FCMat deleted file mode 100644 index 5069b05a2b..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-S355J2G3.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-S355J2G3 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = S355J2G3 -NameDE = St52-3 -Father = Metal -KindOfMaterial = Mild steel -KindOfMaterialDE = Baustahl -MaterialNumber = 1.057 -Norm = EN 10025 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 22 -UltimateTensileStrength = 510 MPa -YieldStrength = 355 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-S380MC.FCMat b/src/Mod/Material/StandardMaterial/Steel-S380MC.FCMat deleted file mode 100644 index f1245d1446..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-S380MC.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-S380MC -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = S380MC -NameDE = QStE380 TM -DescriptionDE = gut biegbar, Fahrgestellrahmen, Hilfsrahmen -Father = Metal -KindOfMaterial = Cold forming steel -KindOfMaterialDE = Kaltumformstahl -MaterialNumber = 1.0978 -Norm = SEW 092 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 23 -UltimateTensileStrength = 520 MPa -YieldStrength = 380 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-S420MC.FCMat b/src/Mod/Material/StandardMaterial/Steel-S420MC.FCMat deleted file mode 100644 index b98ca99115..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-S420MC.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-S420MC -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = S420MC -NameDE = QStE420 TM -DescriptionDE = gut biegbar, Fahrgestellrahmen, Hilfsrahmen -Father = Metal -KindOfMaterial = Cold forming steel -KindOfMaterialDE = Kaltumformstahl -MaterialNumber = 1.098 -Norm = EN 10149 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 21 -UltimateTensileStrength = 550 MPa -YieldStrength = 420 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-S420N.FCMat b/src/Mod/Material/StandardMaterial/Steel-S420N.FCMat deleted file mode 100644 index dd892e860e..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-S420N.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-S420N -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = S420N -NameDE = St E 420 -Father = Metal -KindOfMaterial = Fine grain steel -KindOfMaterialDE = Feinkornstahl -MaterialNumber = 1.8902 -Norm = EN 10113-2 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 19 -UltimateTensileStrength = 520 MPa -YieldStrength = 420 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-S460MC.FCMat b/src/Mod/Material/StandardMaterial/Steel-S460MC.FCMat deleted file mode 100644 index 5b6f56ba11..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-S460MC.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-S460MC -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = S460MC -NameDE = QStE460 TM -DescriptionDE = gut biegbar, Fahrgestellrahmen, Hilfsrahmen -Father = Metal -KindOfMaterial = Cold forming steel -KindOfMaterialDE = Kaltumformstahl -MaterialNumber = 1.0982 -Norm = SEW 092 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 19 -UltimateTensileStrength = 590 MPa -YieldStrength = 460 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-S460N.FCMat b/src/Mod/Material/StandardMaterial/Steel-S460N.FCMat deleted file mode 100644 index 173d3cd869..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-S460N.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-S460N -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = S460N -NameDE = St E 460 -Father = Metal -KindOfMaterial = Fine grain steel -KindOfMaterialDE = Feinkornstahl -MaterialNumber = 1.8901 -Norm = EN 10113-2 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 17 -UltimateTensileStrength = 550 MPa -YieldStrength = 460 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-S500MC.FCMat b/src/Mod/Material/StandardMaterial/Steel-S500MC.FCMat deleted file mode 100644 index bc53b34ca9..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-S500MC.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-S500MC -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = S500MC -NameDE = QStE500 TM -DescriptionDE = gut biegbar, Fahrgestellrahmen, Hilfsrahmen -Father = Metal -KindOfMaterial = Cold forming steel -KindOfMaterialDE = Kaltumformstahl -MaterialNumber = 1.0984 -Norm = EN 10149 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 17 -UltimateTensileStrength = 620 MPa -YieldStrength = 500 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-S550MC.FCMat b/src/Mod/Material/StandardMaterial/Steel-S550MC.FCMat deleted file mode 100644 index 67922de9f7..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-S550MC.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-S550MC -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = S550MC -NameDE = QStE550 TM -DescriptionDE = gut biegbar, Fahrgestellrahmen, Hilfsrahmen -Father = Metal -KindOfMaterial = Cold forming steel -KindOfMaterialDE = Kaltumformstahl -MaterialNumber = 1.0986 -Norm = SEW 092 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 15 -UltimateTensileStrength = 680 MPa -YieldStrength = 550 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-S690MC.FCMat b/src/Mod/Material/StandardMaterial/Steel-S690MC.FCMat deleted file mode 100644 index 30c3a4e5c2..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-S690MC.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-S690MC -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = S690MC -NameDE = QStE690 TM -DescriptionDE = gut biegbar, Fahrgestellrahmen, Hilfsrahmen -Father = Metal -KindOfMaterial = Cold forming steel -KindOfMaterialDE = Kaltumformstahl -MaterialNumber = 1.0966 -Norm = SEW 092 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 15 -UltimateTensileStrength = 790 MPa -YieldStrength = 690 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-St-37-2K.FCMat b/src/Mod/Material/StandardMaterial/Steel-St-37-2K.FCMat deleted file mode 100644 index 67bfedfdc8..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-St-37-2K.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-St-37-2K -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = St 37-2K -NameDE = St 37-2K -DescriptionDE = mäßige Beanspruchung -Father = Metal -KindOfMaterial = Mild steel -KindOfMaterialDE = Baustahl -MaterialNumber = 1.0161 -Norm = EN 10025 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 0 -UltimateTensileStrength = 460 MPa -YieldStrength = 320 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-St-E-255.FCMat b/src/Mod/Material/StandardMaterial/Steel-St-E-255.FCMat deleted file mode 100644 index f3af3d1f50..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-St-E-255.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-St-E-255 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = St E 255 -NameDE = St E 255 -Father = Metal -KindOfMaterial = Fine grain steel -KindOfMaterialDE = Feinkornstahl -MaterialNumber = 1.0461 -Norm = DIN 17102 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 0 -UltimateTensileStrength = 360 MPa -YieldStrength = 260 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-St-E-315.FCMat b/src/Mod/Material/StandardMaterial/Steel-St-E-315.FCMat deleted file mode 100644 index 8f5c0a07a0..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-St-E-315.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-St-E-315 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = St E 315 -NameDE = St E 315 -Father = Metal -KindOfMaterial = Fine grain steel -KindOfMaterialDE = Feinkornstahl -MaterialNumber = 1.0505 -Norm = DIN 17102 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 0 -UltimateTensileStrength = 440 MPa -YieldStrength = 320 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-St-E-380.FCMat b/src/Mod/Material/StandardMaterial/Steel-St-E-380.FCMat deleted file mode 100644 index 0374c695d5..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-St-E-380.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-St-E-380 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = St E 380 -NameDE = St E 380 -Father = Metal -KindOfMaterial = Fine grain steel -KindOfMaterialDE = Feinkornstahl -MaterialNumber = 1.89 -Norm = DIN 17102 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 0 -UltimateTensileStrength = 500 MPa -YieldStrength = 380 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-St-E-460.FCMat b/src/Mod/Material/StandardMaterial/Steel-St-E-460.FCMat deleted file mode 100644 index 4f889cde02..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-St-E-460.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-St-E-460 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = St E 460 -NameDE = St E 460 -Father = Metal -KindOfMaterial = Fine grain steel -KindOfMaterialDE = Feinkornstahl -MaterialNumber = 1.8905 -Norm = DIN 17102 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 0 -UltimateTensileStrength = 560 MPa -YieldStrength = 460 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-St-E-500.FCMat b/src/Mod/Material/StandardMaterial/Steel-St-E-500.FCMat deleted file mode 100644 index d5e985ca63..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-St-E-500.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-St-E-500 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = St E 500 -NameDE = St E 500 -Father = Metal -KindOfMaterial = Fine grain steel -KindOfMaterialDE = Feinkornstahl -MaterialNumber = 1.8907 -Norm = DIN 17102 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 0 -UltimateTensileStrength = 610 MPa -YieldStrength = 500 MPa -YoungsModulus = 210000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-X2CrNiMoN17-13-3.FCMat b/src/Mod/Material/StandardMaterial/Steel-X2CrNiMoN17-13-3.FCMat deleted file mode 100644 index 9971948a7a..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-X2CrNiMoN17-13-3.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-X2CrNiMoN17-13-3 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = X2CrNiMoN17-13-3 -NameDE = X2CrNiMoN 17 13 3 -DescriptionDE = schlecht spanbar, gut schweißbar, gut kaltumformbar, Achsen, Wellen, Wärmetauscher -Father = Metal -KindOfMaterial = Stainless steel -KindOfMaterialDE = Niro -MaterialNumber = 1.4429 -Norm = EN 10088 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 35 -UltimateTensileStrength = 580 MPa -YieldStrength = 295 MPa -YoungsModulus = 200000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-X2CrNiN24-4.FCMat b/src/Mod/Material/StandardMaterial/Steel-X2CrNiN24-4.FCMat deleted file mode 100644 index f113efb323..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-X2CrNiN24-4.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-X2CrNiN24-4 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = X2CrNiN24-4 -NameDE = - -Father = Metal -KindOfMaterial = Stainless steel -KindOfMaterialDE = Niro -MaterialNumber = 1.4362 -Norm = EN 10088 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 25 -UltimateTensileStrength = 600 MPa -YieldStrength = 400 MPa -YoungsModulus = 200000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-X39CrMo17-1.FCMat b/src/Mod/Material/StandardMaterial/Steel-X39CrMo17-1.FCMat deleted file mode 100644 index 3fd1d083c8..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-X39CrMo17-1.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-X39CrMo17-1 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = X39CrMo17-1 -NameDE = - -Father = Metal -KindOfMaterial = Stainless steel -KindOfMaterialDE = Niro -MaterialNumber = 1.4122 -Norm = EN 10088 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 12 -UltimateTensileStrength = 750 MPa -YieldStrength = 500 MPa -YoungsModulus = 213000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-X3CrNiMo13-14.FCMat b/src/Mod/Material/StandardMaterial/Steel-X3CrNiMo13-14.FCMat deleted file mode 100644 index 83d3323e8c..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-X3CrNiMo13-14.FCMat +++ /dev/null @@ -1,26 +0,0 @@ -; Steel-X3CrNiMo13-14 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = X3CrNiMo13-14 -NameDE = - -Father = Metal -KindOfMaterial = Stainless steel -KindOfMaterialDE = Niro -MaterialNumber = 1.4313 -Norm = EN 10088 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 11 -UltimateTensileStrength = 900 MPa -YieldStrength = 800 MPa -YoungsModulus = 216000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-X5CrNi18-10.FCMat b/src/Mod/Material/StandardMaterial/Steel-X5CrNi18-10.FCMat deleted file mode 100644 index a2c889e1dc..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-X5CrNi18-10.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-X5CrNi18-10 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = X5CrNi18-10 -NameDE = X5CrNi 18 9 -DescriptionDE = schlecht spanbar, gut schweißbar, gut kaltumformbar, Fahrzeugbau, Lebensmitteltechnik -Father = Metal -KindOfMaterial = Stainless steel -KindOfMaterialDE = Niro -MaterialNumber = 1.4301 -Norm = EN 10088 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 40 -UltimateTensileStrength = 520 MPa -YieldStrength = 210 MPa -YoungsModulus = 200000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-X5CrNiMo17-12-2.FCMat b/src/Mod/Material/StandardMaterial/Steel-X5CrNiMo17-12-2.FCMat deleted file mode 100644 index ff49842650..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-X5CrNiMo17-12-2.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-X5CrNiMo17-12-2 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = X5CrNiMo17-12-2 -NameDE = X5CrNiMo 17 12 2 -DescriptionDE = schlecht spanbar, gut schweißbar, gut kaltumformbar, Lebensmitteltechnik -Father = Metal -KindOfMaterial = Stainless steel -KindOfMaterialDE = Niro -MaterialNumber = 1.4401 -Norm = EN 10088 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 68000 MPa -UltimateStrain = 40 -UltimateTensileStrength = 520 MPa -YieldStrength = 220 MPa -YoungsModulus = 180000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/Steel-X6CrNiTi18-10.FCMat b/src/Mod/Material/StandardMaterial/Steel-X6CrNiTi18-10.FCMat deleted file mode 100644 index 9a45bf33de..0000000000 --- a/src/Mod/Material/StandardMaterial/Steel-X6CrNiTi18-10.FCMat +++ /dev/null @@ -1,27 +0,0 @@ -; Steel-X6CrNiTi18-10 -; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = X6CrNiTi18-10 -NameDE = X10CrNiTi 18 9 -DescriptionDE = schlecht spanbar, gut schweißbar, gut kaltumformbar, Schienenfahrzeugbau -Father = Metal -KindOfMaterial = Stainless steel -KindOfMaterialDE = Niro -MaterialNumber = 1.4541 -Norm = EN 10088 - -[Mechanical] -Density = 7800 kg/m^3 -PoissonRatio = 0.3 -ShearModulus = 81000 MPa -UltimateStrain = 40 -UltimateTensileStrength = 500 MPa -YieldStrength = 200 MPa -YoungsModulus = 200000 MPa - -[Thermal] -ThermalExpansionCoefficient = 0.000011 m/m/K diff --git a/src/Mod/Material/StandardMaterial/TEMPLATE.FCMat b/src/Mod/Material/StandardMaterial/TEMPLATE.FCMat deleted file mode 100644 index 815fa8030e..0000000000 --- a/src/Mod/Material/StandardMaterial/TEMPLATE.FCMat +++ /dev/null @@ -1,210 +0,0 @@ -; TEMPLATE -; (c) 2013-2015 Juergen Riegel (CC-BY 3.0) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material - -; localized Name, Description and KindOfMaterial uses 2 letter codes -; defined in ISO-639-1, see https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes -; find unit information in src/App/FreeCADInit.py - -[General] -; General name -Name = - -; German localized name -NameDE = - -; Polish localized name -NamePL = - -; A more elaborate description of the material -Description = - -; German localized description -DescriptionDE = - -; Polish localized description -DescriptionPL = - -; Father of the material, i.e. for PLA is Thermoplast, for Steel is Metal -Father = - -; Description to be updated -KindOfMaterial = - -; Germand localized kind of material -KindOfMaterialDE = - -; Description to be updated -MaterialNumber = - -; Description to be updated -Norm = - -; Description to be updated -ReferenceSource = - -; Description to be updated -SourceURL = - -; Description to be updated -StandardCode = - - -[Mechanical] -; Further information can be found at https://en.wikipedia.org/wiki/Mohr%E2%80%93Coulomb_theory -; https://en.wikipedia.org/wiki/Friction#Angle_of_friction -AngleOfFriction = - -; Compressive strength in [FreeCAD Pressure unit] -; https://en.wikipedia.org/wiki/Compressive_strength -CompressiveStrength = - -; Density in [FreeCAD Density unit] -; https://en.wikipedia.org/wiki/Density -Density = - -; Description to be updated -; https://en.wikipedia.org/wiki/Fracture_toughness -FractureToughness = - -; Poisson's ratio [unitless] -; https://en.wikipedia.org/wiki/Poisson%27s_ratio -PoissonRatio = - -; Shear modulus in [FreeCAD Pressure unit] -; https://en.wikipedia.org/wiki/Shear_modulus -ShearModulus = - -; Description to be updated -; https://en.wikipedia.org/wiki/Deformation_(mechanics) -UltimateStrain = - -; Ultimate tensile strength in [FreeCAD Pressure unit] -; https://en.wikipedia.org/wiki/Ultimate_tensile_strength -UltimateTensileStrength = - -; Yield strength in [FreeCAD Pressure unit] -; https://en.wikipedia.org/wiki/Yield_Strength -YieldStrength = - -; Young's modulus (or E-Module) in [FreeCAD Pressure unit] -; https://en.wikipedia.org/wiki/Young%27s_modulus -YoungsModulus = - -; Stiffness (or Spring Stiffness) in [FreeCAD Stiffness unit] -; https://en.wikipedia.org/wiki/Stiffness -Stiffness = - - -[Thermal] -; Specific capacity in [FreeCAD SpecificHeat unit] -; https://en.wikipedia.org/wiki/Heat_capacity -SpecificHeat = - -; Thermal conductivity in [FreCAD ThermalConductivity unit] -; https://en.wikipedia.org/wiki/Thermal_conductivity -ThermalConductivity = - -; Thermal expansion coefficient (linear) in [FreeCAD ThermalExpansionCoefficient unit] -; https://en.wikipedia.org/wiki/Volumetric_thermal_expansion_coefficient -ThermalExpansionCoefficient = - -[Electromagnetic] -; The ratio to the permittivity of the vacuum -; https://en.wikipedia.org/wiki/Relative_permittivity -RelativePermittivity = - -; The electrical conductivity in [FreeCAD ElectricalConductivity unit] -; https://en.wikipedia.org/wiki/Electrical_resistivity_and_conductivity -ElectricalConductivity = - -; The ratio to the permeability of the vacuum -; https://en.wikipedia.org/wiki/Permeability_(electromagnetism) -RelativePermeability = - -[Architectural] -; Description to be updated -Color = - -; Description to be updated -EnvironmentalEfficiencyClass = - -; Description to be updated -ExecutionInstructions = - -; Description to be updated -Finish = - -; Description to be updated -FireResistanceClass = - -; Description to be updated -Model = - -; Description to be updated -SoundTransmissionClass = - -; Description to be updated -UnitsPerQuantity = - - -[Rendering] -; Description to be updated -AmbientColor = - -; Description to be updated -DiffuseColor = - -; Description to be updated -EmissiveColor = - -; Description to be updated -FragmentShader = - -; Description to be updated -Shininess = - -; Description to be updated -SpecularColor = - -; Description to be updated -TexturePath = - -; Description to be updated -TextureScaling = - -; Description to be updated -Transparency = - -; Description to be updated -VertexShader = - - -[Vector rendering] -; Description to be updated -SectionFillPattern = - -; Description to be updated -SectionLinewidth = - -; Description to be updated -ViewColor = - -; Description to be updated -ViewFillPattern = - -; Description to be updated -ViewLinewidth = - - -[Cost] -; Product URL, recommended are wikipedia links -; https://de.wikipedia.org/wiki/Hyperlink -ProductURL = - -; Specific price in currency / mass. A currency is not supported by FreeCAD unit system. Will be empty in all FreeCAD cards. Means the user needs to put in himself. -SpecificPrice = - -; Vendor of the material -Vendor = diff --git a/src/Mod/Material/StandardMaterial/Ti-6Al-4V.FCMat b/src/Mod/Material/StandardMaterial/Ti-6Al-4V.FCMat deleted file mode 100755 index 3f387087de..0000000000 --- a/src/Mod/Material/StandardMaterial/Ti-6Al-4V.FCMat +++ /dev/null @@ -1,29 +0,0 @@ -; Ti-6Al-4V -; vlk -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD 0.20.29603 (Git) - -[General] -Name = Ti-6Al-4V (Grade 5) -Father = Metal -KindOfMaterial = Titanium -MaterialNumber = 3.7165 - -[Mechanical] -Density = 4430 kg/m^3 -PoissonRatio = 0.330 -ShearModulus = 44 GPa -UltimateTensileStrength = 975.5 MPa -YieldStrength = 910 MPa -YoungsModulus = 114 GPa -Hardness = 35 HRC - -[Thermal] -SpecificHeat = 553.0 J/kg/K -ThermalConductivity = 6.7 W/m/K -ThermalExpansionCoefficient = 8.6 µm/m/K - -[Electromagnetic] -ElectricalConductivity = 580012.8 S/m -RelativePermeability = 1.00005 diff --git a/src/Mod/Material/StandardMaterial/Tools/FCMat2csv.sh b/src/Mod/Material/StandardMaterial/Tools/FCMat2csv.sh deleted file mode 100755 index 246d21ac3c..0000000000 --- a/src/Mod/Material/StandardMaterial/Tools/FCMat2csv.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# Helper script that converts FCMat file into csv file - -FILE=$1 -FILE_BASENAME=$(basename $FILE) - -if [ "$FILE_BASENAME" = "TEMPLATE.FCMat" ] -then - echo "Skipping TEMPLATE.FCMat"; - exit 0 -fi - -if [ -f "$1.temp" ] -then - rm $1.temp -fi - -if [ -f "$1.csv" ] -then - rm $1.csv -fi - -echo "Processing "${FILE_BASENAME%%.FCMat} -echo "FileName = "${FILE_BASENAME%%.FCMat} > $FILE_BASENAME.temp - -while read -r PROPERTY || [[ -n "$PROPERTY" ]]; do - VALUE=$(cat $FILE | awk '{if ($1!="") print $0; else "X" }' | grep -w $PROPERTY | cut -f3- -d " ") - echo $PROPERTY' = '$VALUE >> $FILE_BASENAME.temp -done < headers - -echo "FileName" | tr '\n' "|" > $FILE_BASENAME.csv -cat headers | tr '\n' "|" | sed 's/|$/\n/' >> $FILE_BASENAME.csv -cat $FILE_BASENAME.temp | sed 's/^[\[,;].*//' | sed '/^$/d' | cut -d"=" -f2- | cut -d " " -f2- | sed 's/^/\"/' | sed 's/$/\"/' | tr '\n' "|" | sed 's/|$/\n/' >> $FILE_BASENAME.csv - -rm $FILE_BASENAME.temp diff --git a/src/Mod/Material/StandardMaterial/Tools/Materials.csv b/src/Mod/Material/StandardMaterial/Tools/Materials.csv deleted file mode 100644 index f0cdfaeba4..0000000000 --- a/src/Mod/Material/StandardMaterial/Tools/Materials.csv +++ /dev/null @@ -1,114 +0,0 @@ -FileName|Name|NameDE|NamePL|Description|DescriptionDE|DescriptionPL|Father|KindOfMaterial|KindOfMaterialDE|MaterialNumber|Norm|ReferenceSource|SourceURL|StandardCode|AngleOfFriction|CompressiveStrength|Density|FractureToughness|PoissonRatio|ShearModulus|UltimateStrain|UltimateTensileStrength|YieldStrength|YoungsModulus|SpecificHeat|ThermalConductivity|ThermalExpansionCoefficient|Color|EnvironmentalEfficiencyClass|ExecutionInstructions|Finish|FireResistanceClass|Model|SoundTransmissionClass|UnitsPerQuantity|AmbientColor|DiffuseColor|EmissiveColor|FragmentShader|Shininess|SpecularColor|TexturePath|TextureScaling|Transparency|VertexShader|SectionFillPattern|SectionLinewidth|ViewColor|ViewFillPattern|ViewLinewidth|ProductURL|SpecificPrice|Vendor -ABS-Generic|ABS|||This is a blend AcrylnitrilButadienStyrol (ABS) material card. The values are at the low end of the spectrum. If you need a more precise material definition use the more specialised ABS-blend cards.|||Thermoplast||||||http://www.matweb.com/search/DataSheet.aspx?MatGUID=eb7a78f5948d481c9493a67f0d089646||||1060 kg/m^3||0.37|||38.8 MPa|44.1 MPa|2300 MPa|2050 J/kg/K|0.158 W/m/K|0.000093 m/m/K||||||||||||||||||||||||https://en.wikipedia.org/wiki/Acrylonitrile_butadiene_styrene|| -Acrylic-Glass-Generic|Acrylic Glass|||Poly(methyl methacrylate) (PMMA, acrylic, acrylic glass, trade names Plexiglas, Acrylite, Lucite, Perspex) a transparent thermoplastic often used in sheet form as a lightweight or shatter-resistant alternative to glass.||Szkło akrylowe (szkło organiczne; inaczej pleksi, pleksiglas, metapleks) – przezroczyste tworzywo sztuczne, którego głównym składnikiem jest polimer – poli(metakrylan metylu) (PMMA).|of the material, i.e. for PLA is Thermoplast, for Steel is Metal Thermoplast||||||http://www.matweb.com/search/DataSheet.aspx?MatGUID=632572aeef2a4224b5ac8fbd4f1b6f77|||103 MPa|1160 kg/m^3||0.38|1.08 GPa||57.7 MPa|73.7 MPa|2550 MPa|1480 J/kg/K|0.193 W/m/K|0.000075 m/m/K||||||||||||||||||||||||https://en.wikipedia.org/wiki/Poly(methyl_methacrylate)|| -AlMg3F24|AlMg3F24|AlMg3F24|||||Metal|Aluminium|Aluminium|3.3535.26|DIN 1725||||||2700 kg/m^3||0.3|27000 MPa|5|250 MPa|180 MPa|70000 MPa|||0.000023 m/m/K|||||||||||||||||||||||||| -AlMgSi1F31|AlMgSi1F31|AlMgSi1F31|||||Metal|Aluminium|Aluminium|3.2315.72|DIN 1725||||||2700 kg/m^3||0.3|27000 MPa|10|310 MPa|260 MPa|70000 MPa|||0.000023 m/m/K|||||||||||||||||||||||||| -Aluminum-6061-T6|Aluminum 6061-T6|||Precipitation-hardened, Nonferrous Aluminum alloy|||Metal|Aluminium|Aluminium||||||||2700 kg/m^3||0.33|||310 MPa||69000 MPa||167 W/m/K|||||||||||||||||||||||||https://en.wikipedia.org/wiki/6061_aluminium_alloy|| -AlZn4-5Mg1F35|AlZn4,5Mg1F35|AlZn4,5Mg1F35|||||Metal|Aluminium|Aluminium|3.4335.71|DIN 1725||||||2700 kg/m^3||0.3|27000 MPa|10|350 MPa|290 MPa|70000 MPa|||0.000023 m/m/K|||||||||||||||||||||||||| -CalculiX-Steel|CalculiX-Steel|||Standard steel material for CalculiX sample calculations|||Metal||||||||||7900 kg/m^3||0.3|||||210000 MPa|590 J/kg/K|43 W/m/K|0.000012 m/m/K|||||||||||||||||||||||||| -Concrete-EN-C35_45|Concrete-EN-C35/45|||Concrete matrix for reinforcement material examples, 0.6 x 0.75 x 35 MPa = 15.75 MPa (https://forum.freecad.org/viewtopic.php?f=18&t=33106&start=200#p311075)|||Aggregate||||||||30 deg|15.75 MPa|2500 kg/m^3||0.17|||||32000 MPa|||||||||||||||||||||||||||https://en.wikipedia.org/wiki/Concrete|| -Concrete-Generic|Concrete|||A standard C-25 construction concrete|||Aggregate|||||||Masterformat 03 33 13||25 MPa|2400 kg/m^3||0.17|||||32000 MPa|||||||||||||||||||||||||||https://en.wikipedia.org/wiki/Concrete|| -Glass-E-GlassFibre|Glass-E|||Glass Fibre|||Glass|||||||||1080 MPa|2580 kg/m^3|||||3445 MPa|||||||||||||||||||||||||||||https://en.wikipedia.org/wiki/Glass_fiber|| -Glass-Generic|Glass|||Generic soda-lime glass|Normalglas|Szkło sodowe|Glass||||||||||2520 kg/m^3||0.22|||||72000 MPa|||0.000009 m/m/K||||||||||||||||||||||||https://en.wikipedia.org/wiki/Soda-lime_glass|| -Glass-S2-GlassFibre|Glass-S2|||Glass Fibre|||Glass|||||||||1600 MPa|2460 kg/m^3|||||4890 MPa|||||||||||||||||||||||||||||https://en.wikipedia.org/wiki/Glass_fiber|| -None|None|||This is a not defined material|||None||||||||||0 kg/m^3||0|||0 MPa||0 MPa||||||||||||||||||||||||||||| -PA6-Generic|Polyamide 6||||||||||||http://www.matweb.com/search/datasheet.aspx?MatGUID=8d78f3cfcb6f49d595896ce6ce6a2ef1|||67.6 MPa|1150 kg/m^3||0.39|||75.5 MPa|70.5 MPa|2930 MPa|1670 J/kg/K|0.262 W/m/K|0.000082 m/m/K||||||||||||||||||||||||https://en.wikipedia.org/wiki/Nylon_6|| -PET-Generic|PET||||||||||||http://www.matweb.com/search/DataSheet.aspx?MatGUID=a696bdcdff6f41dd98f8eec3599eaa20|||38.0 MPa|1380 kg/m^3||0.36|0.0385 GPa||38.8 MPa|62.8 MPa|3150 MPa|1140 J/kg/K|0.181 W/m/K|0.000072 m/m/K||||||||||||||||||||||||https://en.wikipedia.org/wiki/Polyethylene_terephthalate|| -PLA-Generic|PLA|||Polylactic acid or polylactide (PLA, Poly) is a biodegradable thermoplastic aliphatic polyester derived from renewable resources, such as corn starch, tapioca roots, chips, starch or sugarcane.|||Thermoplast||||||https://www.sd3d.com/wp-content/uploads/2017/06/MaterialTDS-PLA_01.pdf||||1240 kg/m^3||0.36|||26.4 MPa|35.9 MPa|3640 MPa|1800 J/kg/K|0.130 W/m/K|0.000041 m/m/K||||||||||||||||||||||||https://en.wikipedia.org/wiki/Polylactic_acid|| -PP-Generic|Polypropylene||||||||||||http://www.matweb.com/search/DataSheet.aspx?MatGUID=a882a1c603374e278d062f106dfda95b|||10 MPa|916 kg/m^3||0.44|||79.7 MPa|32.8 MPa|1470 MPa|1920 J/kg/K|0.249 W/m/K|0.000123 m/m/K||||||||||||||||||||||||https://en.wikipedia.org/wiki/Polypropylene|| -PTFE-Generic|PTFE||||||||||||http://www.matweb.com/search/datasheet.aspx?MatGUID=4d14eac958e5401a8fd152e1261b6843|||10.2 MPa|2070 kg/m^3||0.46|||34.6 MPa|20.5 MPa|564 MPa|1010 J/kg/K|0.263 W/m/K|0.000108 m/m/K||||||||||||||||||||||||https://en.wikipedia.org/wiki/Polytetrafluoroethylene|| -PVC-Generic|PVC||||||||||||http://www.matweb.com/search/DataSheet.aspx?MatGUID=1f650966ec834bb8833dd4c6e3116079||||1380 kg/m^3||0.38|||50 MPa||2800 MPa|1000 J/kg/K|0.150 W/m/K|0.000075 m/m/K||||||||||||||||||||||||https://en.wikipedia.org/wiki/Polyvinyl_chloride|| -Reinforcement-FIB-B500|Reinforcement-Harry|||Reinforcement inside concrete for reinforcement material examples, from fib examples, 0.84 x 0.75 x 500 MPa = 315 MPa (https://forum.freecad.org/viewtopic.php?f=18&t=33106&start=200#p311705)|||||||||||||7850 kg/m^3||0.3||||315 MPa|210000 MPa||||||||||||||||||||||||||||| -Steel-15CrNi6|15CrNi6|||High-strength carbon steel|höchste Beanspruchung, Achsen, Wellen, Ritzel, Nocken, Kegelräder|Wysokowytrzymała stal węglowa|Metal|Case-hardened steel|Einsatzstahl|1.5919|EN 10084||||||7800 kg/m^3||0.3|81000 MPa|9|1000 MPa|680 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-17CrNiMo6|17CrNiMo6|17CrNiMo6|||höchste Beanspruchung, Wellen, Zahnräder||Metal|Case-hardened steel|Einsatzstahl|1.6587|EN 10084||||||7800 kg/m^3||0.3|81000 MPa|8|1150 MPa|830 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-1C22|1C22|C22||Case hardened alloy steel|kleiner Vergütungsdurchmesser, gut schweißbar|Stal stopowa do nawęglania|Metal|Heat-treatable steel|Vergütungsstahl|1.0402|EN 10083-1||||||7800 kg/m^3||0.3|81000 MPa|27|400 MPa|230 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-1C35|1C35|C35||Non-alloy quality steel||Wysokogatunkowa stal niestopowa|Metal|Heat-treatable steel|Vergütungsstahl|1.0501|EN 10083-1||||||7800 kg/m^3||0.3|81000 MPa|21|480 MPa|300 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-1C45|1C45|C45||Non-alloy quality steel||Wysokogatunkowa stal niestopowa|Metal|Heat-treatable steel|Vergütungsstahl|1.0503|EN 10083-1||||||7800 kg/m^3||0.3|81000 MPa|14|580 MPa|340 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-1C60|1C60|C60||Non-alloy quality steel||Wysokogatunkowa stal niestopowa|Metal|Heat-treatable steel|Vergütungsstahl|1.0601|EN 10083-1||||||7800 kg/m^3||0.3|81000 MPa|11|650 MPa|380 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-20NiCrMo2|20NiCrMo2|21NiCrMo2|||höchste Beanspruchung, Wellen, Zahnräder||Metal|Case-hardened steel|Einsatzstahl|1.6523|EN 10084||||||7800 kg/m^3||0.3|81000 MPa|10|900 MPa|630 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-28Mn6|28Mn6|28Mn6|||||Metal|Heat-treatable steel|Vergütungsstahl|1.117|EN 10083-1||||||7800 kg/m^3||0.3|81000 MPa|13|800 MPa|590 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-2C10|2C10|Ck10|||||Metal|Case-hardened steel|Einsatzstahl|1.1121|EN 10084||||||7800 kg/m^3||0.3|81000 MPa|0|640 MPa|390 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-30CrNiMo8|30CrNiMo8|30CrNiMo8|||höchste Beanspruchung, Wellen, Zahnräder||Metal|Heat-treatable steel|Vergütungsstahl|1.658|EN 10083-1||||||7800 kg/m^3||0.3|81000 MPa|9|1250 MPa|1050 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-34CrNiMo6|34CrNiMo6|34CrNiMo6|||höchste Beanspruchung, Wellen, Zahnräder||Metal|Heat-treatable steel|Vergütungsstahl|1.6582|EN 10083-1||||||7800 kg/m^3||0.3|81000 MPa|9|1200 MPa|1000 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-36CrNiMo4|36CrNiMo4|36CrNiMo4|||höchste Beanspruchung, Wellen, Zahnräder||Metal|Heat-treatable steel|Vergütungsstahl|1.6511|EN 10083-1||||||7800 kg/m^3||0.3|81000 MPa|10|1100 MPa|900 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-36NiCrMo16|36NiCrMo16|36NiCrMo16|||höchste Beanspruchung, Wellen, Zahnräder||Metal|Heat-treatable steel|Vergütungsstahl|1.6773|EN 10083-1||||||7800 kg/m^3||0.3|81000 MPa|9|1250 MPa|1050 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-3C15|3C15|Cm15|||||Metal|Case-hardened steel|Einsatzstahl|1.114|EN 10084||||||7800 kg/m^3||0.3|81000 MPa|0|740 MPa|440 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-3C22|3C22|Cm22|||||Metal|Heat-treatable steel|Vergütungsstahl|1.1149|EN 10083-1||||||7800 kg/m^3||0.3|81000 MPa|24|550 MPa|350 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-3C35|3C35|Cm35|||||Metal|Heat-treatable steel|Vergütungsstahl|1.118|EN 10083-1||||||7800 kg/m^3||0.3|81000 MPa|17|630 MPa|430 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-3V45|3V45|Cm45|||||Metal|Heat-treatable steel|Vergütungsstahl|1.1201|EN 10083-1||||||7800 kg/m^3||0.3|81000 MPa|14|700 MPa|500 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-C10|C10|C10|||||Metal|Case-hardened steel|Einsatzstahl|1.0301|DIN 17210||||||7800 kg/m^3||0.3|81000 MPa|16|650 MPa|380 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-C15|C15|C15|||||Metal|Case-hardened steel|Einsatzstahl|1.0401|DIN 17210||||||7800 kg/m^3||0.3|81000 MPa|14|750 MPa|430 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-C22E|C22E|Ck22|||||Metal|Heat-treatable steel|Vergütungsstahl|1.1151|EN 10083-1||||||7800 kg/m^3||0.3|81000 MPa|20|500 MPa|340 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-C25E|C25E|Ck25|||||Metal|Heat-treatable steel|Vergütungsstahl|1.1158|EN 10083-1||||||7800 kg/m^3||0.3|81000 MPa|19|550 MPa|370 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-C30E|C30E|Ck30|||||Metal|Heat-treatable steel|Vergütungsstahl|1.1178|EN 10083-1||||||7800 kg/m^3||0.3|81000 MPa|18|600 MPa|400 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-C40E|C40E|Ck40|||||Metal|Heat-treatable steel|Vergütungsstahl|1.1186|EN 10083-1||||||7800 kg/m^3||0.3|81000 MPa|16|650 MPa|460 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-C50E|C50E|Ck50|||||Metal|Heat-treatable steel|Vergütungsstahl|1.1206|EN 10083-1||||||7800 kg/m^3||0.3|81000 MPa|13|750 MPa|520 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-C55E|C55E|Ck55|||||Metal|Heat-treatable steel|Vergütungsstahl|1.1203|EN 10083-1||||||7800 kg/m^3||0.3|81000 MPa|13|800 MPa|550 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-C60E|C60E|Ck60|||||Metal|Heat-treatable steel|Vergütungsstahl|1.1221|EN 10083-1||||||7800 kg/m^3||0.3|81000 MPa|13|850 MPa|580 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-E295|E295|St50-2|||||Metal|Mild steel|Baustahl|1.005|EN 10025||||||7800 kg/m^3||0.3|81000 MPa|20|490 MPa|295 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-E295-GC|E295 GC|St50-2K|||||Metal|Mild steel|Baustahl|1.0533|EN 10025||||||7800 kg/m^3||0.3|81000 MPa|0|590 MPa|420 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-E335|E335|St60-2|||||Metal|Mild steel|Baustahl|1.006|EN 10025||||||7800 kg/m^3||0.3|81000 MPa|16|590 MPa|335 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-E335-GC|E335 GC|St60-2K|||||Metal|Mild steel|Baustahl|1.0543|EN 10025||||||7800 kg/m^3||0.3|81000 MPa|0|690 MPa|490 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-E360|E360|St70-2|||||Metal|Mild steel|Baustahl|1.007|EN 10025||||||7800 kg/m^3||0.3|81000 MPa|11|690 MPa|360 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-E360-GC|E360 GC|St70-2K|||||Metal|Mild steel|Baustahl|1.0633|EN 10025||||||7800 kg/m^3||0.3|81000 MPa|0|780 MPa|560 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-EN-GJL-100|EN-GJL-100|GG-10|||für gering beanspruchte Teile||Metal|Cast iron|Guss|0.601|EN 1561||||||7200 kg/m^3||0.3|34000 MPa|0|100 MPa||88000 MPa|||0.00001 m/m/K|||||||||||||||||||||||||| -Steel-EN-GJL-150|EN-GJL-150|GG-15|||für dünnwandige Teile wie Gehäuse, Ständer||Metal|Cast iron|Guss|0.6015|EN 1561||||||7200 kg/m^3||0.3|37000 MPa|0|150 MPa|98 MPa|95000 MPa|||0.00001 m/m/K|||||||||||||||||||||||||| -Steel-EN-GJL-200|EN-GJL-200|GG-20|||Hebel, Lager , Lagerböcke||Metal|Cast iron|Guss|0.602|EN 1561||||||7200 kg/m^3||0.3|40000 MPa|0|200 MPa|130 MPa|105000 MPa|||0.00001 m/m/K|||||||||||||||||||||||||| -Steel-EN-GJL-250|EN-GJL-250|GG-25|||||Metal|Cast iron|Guss|0.6025|EN 1561||||||7200 kg/m^3||0.3|44000 MPa|0|250 MPa|165 MPa|115000 MPa|||0.00001 m/m/K|||||||||||||||||||||||||| -Steel-EN-GJL-300|EN-GJL-300|GG-30|||hochbeanspruchbar, für Motorständer, Lagerschalen||Metal|Cast iron|Guss|0.603|EN 1561||||||7200 kg/m^3||0.3|48000 MPa|0|300 MPa|195 MPa|125000 MPa|||0.00001 m/m/K|||||||||||||||||||||||||| -Steel-EN-GJL-350|EN-GJL-350|GG-35|||höchstbeanspruchbar, für Teile mit konstanter Wanddicke, Pressenständer, Turbinengehäuse||Metal|Cast iron|Guss|0.6035|EN 1561||||||7200 kg/m^3||0.3|52000 MPa|15|350 MPa|228 MPa|135000 MPa|||0.00001 m/m/K|||||||||||||||||||||||||| -Steel-EN-GJMB-350-10|EN-GJMB-350-10|GTS 35-10|||gut spanbar, Schaltgabeln, Getriebe-, Achsgehäuse||Metal|Cast iron|Guss|0.8135|EN 1562||||||7200 kg/m^3||0.3|67000 MPa|10|350 MPa|200 MPa|175000 MPa|||0.00001 m/m/K|||||||||||||||||||||||||| -Steel-EN-GJMB-550-4|EN-GJMB-550-4|GTS 55-04|||Randschichthärtung, Kurbelwellen, Bremsträger, Federböcke, Kipphebel||Metal|Cast iron|Guss|0.8155|EN 1562||||||7200 kg/m^3||0.3|67000 MPa|2|550 MPa|340 MPa|175000 MPa|||0.00001 m/m/K|||||||||||||||||||||||||| -Steel-EN-GJMB-650-2|EN-GJMB-650-2|GTS 65-02|||Gabelköpfe||Metal|Cast iron|Guss|0.8165|EN 1562||||||7200 kg/m^3||0.3|67000 MPa|2|650 MPa|430 MPa|175000 MPa|||0.00001 m/m/K|||||||||||||||||||||||||| -Steel-EN-GJMW-350-4|EN-GJMW-350-4|GTW 35-04|||dünnwandige Teile, Fittings, Beschläge, Förderketten||Metal|Cast iron|Guss|0.8035|EN 1562||||||7200 kg/m^3||0.3|67000 MPa|4|350 MPa||175000 MPa|||0.00001 m/m/K|||||||||||||||||||||||||| -Steel-EN-GJMW-360-12|EN-GJMW-360-12|GTW S38-12|||für Verbundschweißteile||Metal|Cast iron|Guss|0.8038|EN 1562||||||7200 kg/m^3||0.3|67000 MPa|5|380 MPa|200 MPa|175000 MPa|||0.00001 m/m/K|||||||||||||||||||||||||| -Steel-EN-GJMW-400-5|EN-GJMW-400-5|GTW 40-05|||gut schweißbar, Auspuffkrümmer, Schraubzwingen||Metal|Cast iron|Guss|0.804|EN 1562||||||7200 kg/m^3||0.3|67000 MPa|7|400 MPa|220 MPa|175000 MPa|||0.00001 m/m/K|||||||||||||||||||||||||| -Steel-EN-GJMW-450-7|EN-GJMW-450-7|GTW 45-07|||schlagfest, Fahrwerksteile||Metal|Cast iron|Guss|0.8045|EN 1562||||||7200 kg/m^3||0.3|67000 MPa|10|450 MPa|260 MPa|175000 MPa|||0.00001 m/m/K|||||||||||||||||||||||||| -Steel-EN-GJS-400-15|EN-GJS-400-15|GGG-40|||Pumpen-, Getriebegehäuse||Metal|Cast iron|Guss|0.704|EN 1563||||||7200 kg/m^3||0.3|65000 MPa|15|400 MPa|250 MPa|167000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-EN-GJS-500-7|EN-GJS-500-7|GGG-50|||Seiltrommeln, Bremsteile, Zylinderköpfe||Metal|Cast iron|Guss|0.705|EN 1563||||||7200 kg/m^3||0.3|66000 MPa|2|500 MPa|320 MPa|170000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-EN-GJS-600-3|EN-GJS-600-3|GGG-60|||Kurbelwellen, Stangen||Metal|Cast iron|Guss|0.706|EN 1563||||||7200 kg/m^3||0.3|67000 MPa|2|600 MPa|370 MPa|177000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-EN-GJS-700-2|EN-GJS-700-2|GGG-70|||Kurbelwellen, Zahnräder, Turbinenschaufeln||Metal|Cast iron|Guss|0.707|EN 1563||||||7200 kg/m^3||0.3|67000 MPa|2|700 MPa|420 MPa|180000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-EN-GJS-800-1|EN-GJS-800-1|GGG-80|||Zahnräder||Metal|Cast iron|Guss|0.708|EN 1563||||||7200 kg/m^3||0.3|67000 MPa|2|800 MPa|480 MPa|180000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-G16Mn5|G16Mn5|GS-16Mn5N|||Gehäuse, Zahnräder, Bremsscheiben||Metal|Cast steel|Stahlguss|1.1131|DIN 1681||||||7800 kg/m^3||0.3|81000 MPa|0|430 MPa|260 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-G200|G200|GS 38|||mittlere dynamische und stoßartige Belastung, gut schweißbar||Metal|Cast steel|Stahlguss|1.042|DIN 1681||||||7800 kg/m^3||0.3|81000 MPa|25|380 MPa|200 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-G20Mn5|G20Mn5|GS-20Mn5v|||Gehäuse, Zahnräder, Bremsscheiben||Metal|Cast steel|Stahlguss|1.112|DIN 1681||||||7800 kg/m^3||0.3|81000 MPa|0|500 MPa|360 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-G230|G230|GS 45|||mittlere dynamische und stoßartige Belastung, gut schweißbar||Metal|Cast steel|Stahlguss|1.0446|DIN 1681||||||7800 kg/m^3||0.3|81000 MPa|22|450 MPa|230 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-G260|G260|GS 52|||||Metal|Cast steel|Stahlguss|1.0552|DIN 1681||||||7800 kg/m^3||0.3|81000 MPa|18|520 MPa|260 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-G300|G300|GS 60|||||Metal|Cast steel|Stahlguss|1.0558|DIN 1681||||||7800 kg/m^3||0.3|81000 MPa|15|600 MPa|300 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-G30Mn5|G30Mn5|GS-30Mn5|||||Metal|Cast steel|Stahlguss|1.1165|DIN 17205||||||7800 kg/m^3||0.3|81000 MPa|14|520 MPa|400 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-Generic|Steel-Generic|||This is a blend Steel material card. The values are at the low end of the spectrum. If you need a more precise material definition use the more specialised steel cards.|||Metal||||||||||7900 kg/m^3||0.3|||||200000 MPa|500 J/kg/K|50 W/m/K|0.000012 m/m/K||||||||||||||||||||||||https://en.wikipedia.org/wiki/Steel|| -Steel-S185|S185|St33|||für geringe Beanspruchung||Metal|Mild steel|Baustahl|1.0035|EN 10025||||||7800 kg/m^3||0.3|81000 MPa|18|310 MPa|190 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-S235JO|S235JO|St37-3U|||||Metal|Mild steel|Baustahl|1.0114|EN 10025||||||7800 kg/m^3||0.3|81000 MPa|26|360 MPa|235 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-S235JR|S235JR|St37-2|||üblich für mäßige Beanspruchung, gut schweißbar, nicht für Hilfsrahmen||Metal|Mild steel|Baustahl|1.0037|EN 10025||||||7800 kg/m^3||0.3|81000 MPa|26|360 MPa|235 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-S235JRG1|S235JRG1|USt37-2|||üblich für mäßige Beanspruchung||Metal|Mild steel|Baustahl|1.0036|EN 10025||||||7800 kg/m^3||0.3|81000 MPa|26|360 MPa|235 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-S260NC|S260NC|QStE260 N|||gut biegbar, Fahrgestellrahmen, Hilfsrahmen, nicht für Punktlasten||Metal|Cold forming steel|Kaltumformstahl|1.0971|SEW 092||||||7800 kg/m^3||0.3|81000 MPa|30|350 MPa|280 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-S275JO|S275JO|St44-3U|||||Metal|Mild steel|Baustahl|1.0143|EN 10025||||||7800 kg/m^3||0.3|81000 MPa|22|430 MPa|275 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-S275JR|S275JR|St44-2|||Wellen, Achsen, gut bearbeitbar, gut schweißbar||Metal|Mild steel|Baustahl|1.0044|EN 10025||||||7800 kg/m^3||0.3|81000 MPa|22|430 MPa|275 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-S275N|S275N|St E 275|||||Metal|Fine grain steel|Feinkornstahl|1.049|EN 10113-2||||||7800 kg/m^3||0.3|81000 MPa|24|370 MPa|275 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-S335JO|S335JO|St60-2U|||||Metal|Mild steel|Baustahl|1.0553|EN 10025||||||7800 kg/m^3||0.3|81000 MPa|22|510 MPa|355 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-S335JR|S335JR|St53-3|||||Metal|Mild steel|Baustahl|1.0045|EN 10025||||||7800 kg/m^3||0.3|81000 MPa|22|510 MPa|355 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-S335N|S335N|St E 355|||||Metal|Fine grain steel|Feinkornstahl|1.0545|EN 10113-2||||||7800 kg/m^3||0.3|81000 MPa|22|470 MPa|355 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-S340MC|S340MC|QStE340 TM|||gut biegbar, Fahrgestellrahmen, Hilfsrahmen, nicht für Punktlasten||Metal|Cold forming steel|Kaltumformstahl|1.0974|SEW 092||||||7800 kg/m^3||0.3|81000 MPa|25|480 MPa|340 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-S355J2G3|S355J2G3|St52-3|||||Metal|Mild steel|Baustahl|1.057|EN 10025||||||7800 kg/m^3||0.3|81000 MPa|22|510 MPa|355 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-S380MC|S380MC|QStE380 TM|||gut biegbar, Fahrgestellrahmen, Hilfsrahmen||Metal|Cold forming steel|Kaltumformstahl|1.0978|SEW 092||||||7800 kg/m^3||0.3|81000 MPa|23|520 MPa|380 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-S420MC|S420MC|QStE420 TM|||gut biegbar, Fahrgestellrahmen, Hilfsrahmen||Metal|Cold forming steel|Kaltumformstahl|1.098|EN 10149||||||7800 kg/m^3||0.3|81000 MPa|21|550 MPa|420 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-S420N|S420N|St E 420|||||Metal|Fine grain steel|Feinkornstahl|1.8902|EN 10113-2||||||7800 kg/m^3||0.3|81000 MPa|19|520 MPa|420 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-S460MC|S460MC|QStE460 TM|||gut biegbar, Fahrgestellrahmen, Hilfsrahmen||Metal|Cold forming steel|Kaltumformstahl|1.0982|SEW 092||||||7800 kg/m^3||0.3|81000 MPa|19|590 MPa|460 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-S460N|S460N|St E 460|||||Metal|Fine grain steel|Feinkornstahl|1.8901|EN 10113-2||||||7800 kg/m^3||0.3|81000 MPa|17|550 MPa|460 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-S500MC|S500MC|QStE500 TM|||gut biegbar, Fahrgestellrahmen, Hilfsrahmen||Metal|Cold forming steel|Kaltumformstahl|1.0984|EN 10149||||||7800 kg/m^3||0.3|81000 MPa|17|620 MPa|500 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-S550MC|S550MC|QStE550 TM|||gut biegbar, Fahrgestellrahmen, Hilfsrahmen||Metal|Cold forming steel|Kaltumformstahl|1.0986|SEW 092||||||7800 kg/m^3||0.3|81000 MPa|15|680 MPa|550 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-S690MC|S690MC|QStE690 TM|||gut biegbar, Fahrgestellrahmen, Hilfsrahmen||Metal|Cold forming steel|Kaltumformstahl|1.0966|SEW 092||||||7800 kg/m^3||0.3|81000 MPa|15|790 MPa|690 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-St-37-2K|St 37-2K|St 37-2K|||mäßige Beanspruchung||Metal|Mild steel|Baustahl|1.0161|EN 10025||||||7800 kg/m^3||0.3|81000 MPa|0|460 MPa|320 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-St-E-255|St E 255|St E 255|||||Metal|Fine grain steel|Feinkornstahl|1.0461|DIN 17102||||||7800 kg/m^3||0.3|81000 MPa|0|360 MPa|260 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-St-E-315|St E 315|St E 315|||||Metal|Fine grain steel|Feinkornstahl|1.0505|DIN 17102||||||7800 kg/m^3||0.3|81000 MPa|0|440 MPa|320 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-St-E-380|St E 380|St E 380|||||Metal|Fine grain steel|Feinkornstahl|1.89|DIN 17102||||||7800 kg/m^3||0.3|81000 MPa|0|500 MPa|380 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-St-E-460|St E 460|St E 460|||||Metal|Fine grain steel|Feinkornstahl|1.8905|DIN 17102||||||7800 kg/m^3||0.3|81000 MPa|0|560 MPa|460 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-St-E-500|St E 500|St E 500|||||Metal|Fine grain steel|Feinkornstahl|1.8907|DIN 17102||||||7800 kg/m^3||0.3|81000 MPa|0|610 MPa|500 MPa|210000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-X2CrNiMoN17-13-3|X2CrNiMoN17-13-3|X2CrNiMoN 17 13 3|||schlecht spanbar, gut schweißbar, gut kaltumformbar, Achsen, Wellen, Wärmetauscher||Metal|Stainless steel|Niro|1.4429|EN 10088||||||7800 kg/m^3||0.3|81000 MPa|35|580 MPa|295 MPa|200000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-X2CrNiN24-4|X2CrNiN24-4|-|||||Metal|Stainless steel|Niro|1.4362|EN 10088||||||7800 kg/m^3||0.3|81000 MPa|25|600 MPa|400 MPa|200000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-X39CrMo17-1|X39CrMo17-1|-|||||Metal|Stainless steel|Niro|1.4122|EN 10088||||||7800 kg/m^3||0.3|81000 MPa|12|750 MPa|500 MPa|213000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-X3CrNiMo13-14|X3CrNiMo13-14|-|||||Metal|Stainless steel|Niro|1.4313|EN 10088||||||7800 kg/m^3||0.3|81000 MPa|11|900 MPa|800 MPa|216000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-X5CrNi18-10|X5CrNi18-10|X5CrNi 18 9|||schlecht spanbar, gut schweißbar, gut kaltumformbar, Fahrzeugbau, Lebensmitteltechnik||Metal|Stainless steel|Niro|1.4301|EN 10088||||||7800 kg/m^3||0.3|81000 MPa|40|520 MPa|210 MPa|200000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-X5CrNiMo17-12-2|X5CrNiMo17-12-2|X5CrNiMo 17 12 2|||schlecht spanbar, gut schweißbar, gut kaltumformbar, Lebensmitteltechnik||Metal|Stainless steel|Niro|1.4401|EN 10088||||||7800 kg/m^3||0.3|68000 MPa|40|520 MPa|220 MPa|180000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Steel-X6CrNiTi18-10|X6CrNiTi18-10|X10CrNiTi 18 9|||schlecht spanbar, gut schweißbar, gut kaltumformbar, Schienenfahrzeugbau||Metal|Stainless steel|Niro|1.4541|EN 10088||||||7800 kg/m^3||0.3|81000 MPa|40|500 MPa|200 MPa|200000 MPa|||0.000011 m/m/K|||||||||||||||||||||||||| -Wood-Generic|Wood|||A standard construction wood|||Aggregate||||||||||700 kg/m^3||0.05|||||12000 MPa|||||||||||||||||||||||||||https://en.wikipedia.org/wiki/Wood|| diff --git a/src/Mod/Material/StandardMaterial/Tools/Materials.ods b/src/Mod/Material/StandardMaterial/Tools/Materials.ods deleted file mode 100644 index 3972e8edd10cb4684791d3fbc2c7a264b6401351..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24814 zcmb4q1#BJ7vZn2rnVDl|W@g4?W@d<)nVB84kMWq1^R8as(f`fy@!^2}?Vd3H7ef|2Cfq{XYot>YbUtC;VUS1vm0O;xInVFf{+1a_e zy88P1hK7d5#>S?mrsm}26c-m)RaG@LHFb1!^!N9VkB`sK&#$kq@9piKo}S*`-hO<1 z{G;^qGiXTj3JmP4x~zmKz-#T?KiZUld)ndRlQScN;OFJ|YtI1`O}XqmU&FqaEPYEW zmJQ@2o=Z?@_)htKfw$jUj~&t{6i8o=le#!?;xpaiqz=vRhW^=zY@}dmH_-n$NiCrX z;Gz$Qm6({%STTrdia(v+q$Z;xN#}Ws2S1yd*?TC4+JSgHykF-cUZE!&s(&J+378n4_x z(kWKsKK;VuU%)SDX^vDBJME&>v{LDO+`ilIzZwt2#^fKoo)+;0q9 zWrNqQK7}7he5Hls&F#LY(u>PBkoqJQcv4au^9<5oCbO>97{7@m z>lcqs55J+RpoO6bXlX(vkfyv-xR~m2n2nh(VNK(3bV6$(O^U#SAAk-7yqJccU{zo$ zi>RKQg)uybgsMYoT-Z=kVtgzEz&?Wxf1$?-}nat`5 zBdbhw9ldmjlHcw^FZhYJZsZkOZS)bHZOnBmq{7)2)IAX(Pf{uA|xN~^* zO+(se^vHBlQwPc&siHbf#o{2anac~yKo1T}x2p3;tfhRB#Hw*vRH5qcwg(TD@)2x* zb?fptrBh?33I%W~m-}SpeO%6v+G<|FqIK3E`^Ily!ugFT5L6_?dk9jYz5KN`PF<-w zCW`l7S!Px3)yZ;tuT!r7Y#~=#{o#0S4XXqV8i)yq>vF;5QpFwta4I4)E$MhP!(9cM z=WJMk%>gNfL6A$BLMHM!4X`HxL~!uA7(7W_a^Iz1euR#_%tRw;9aK_7?xa|wm1j%R z`6*0Er zD;3WkURQZ~^rMWE=bfAnCXgg6 z=7;a3&Tx2R63&Y*v0y}rJ09z?eNpR?Udba1mwMNfImGMr*$I8}4a)Ay=i`c+AJK7- zf<18$q%F?~`J3wUQz)cng5^$9WzfEB-(=?y>8vS{WXAN}^i*l9!YCDGcVC@MWc;+l zG2K;!@I!g?{=KLy3FI_A(Xt5E$o-0W{n_kKp|LY-NLh^{Q3-eNQzSYd5KXWHs@m26 z!i*(!%>&yU4Y@YR7QIjs!?eY9hEzON6n#IJ`hjsRAOqFS#w&s&tL6 zvC4yfVJCJ-6^fN|Oz$upaoo9dD5gEz3ktyXJfP~Xqc@##J7WF~pdm3gj};D9MR1x>4G%>Fdf9$%CZVfR#Ew|`?3c@brK~6aF((WXCv{#_Z z?&Toer_pBxd8O`xnDES!vVBXnsX#Ic?^8&d=JsU;XIRxcu%YkxvH=^!>K{|JyZ(3h zQo}h$`;{85zLfofJ2%YXa#O5)>0XK1-dO`4Wvya5&_NrS-E&A6(tQ;}G~w6Zhh)|g z)Uf%akeiQ(lwM*E1+Es{O3j!X)=k`qgZH(-{JvanITpZZj3(G#^wr%B!!A*Cs*f-N zefa-;7t%81)JI8&VCwu#&g5r2^uuWSsoO=9Hk#E6m6v}gD|xpyyE4K_BF5Tq#pM>e z8HII@yBKdKRHbWtXpg7{YyMS^idQ+Dp!307GHmTtJ8O7x2OA1KNsJT$Qy}|;h1c+X z2d5NK_tKgP!GDmQ*c6^Tq7vp{HLXupxc%3yA7cO=3Pqi&ZR!w&2 zV4peA6;*aKL7^NIim5yuuM!zTyDDUnG$@iQK(WMkI%JJ_K^zE{k&M}VZ4y60t`bDU zR=j>g9G};ay4YTuXmWyHvNRCZa3xwi)&0>*P z9xC~%17(Y0Ru`|#u|VE65Z(0U(>1up{@r?#Kwaj{IbcppU>Xe(PnmshxQQLDP9>`i zZ;ytxIi;o_*R`fW)DzNBbQ0yG%9KfJ^cupaIz($Tcx+|~M_N>`D}JX(q7B*#x_v5h2^h%$;6lhh-SJVV? zdxr!VE^CD!R6~Lz;JShnB`^OTm_T>=k&doe0L_+gao#voCLq|jePW4X*kPHe7d^(^ zI}wq=8eBl?S&Gn3DSk=<$v~(35wcfYGq^6yr1vdIK4FdWEkROJ1xwQMieBV|G$;&D zPBYt^o68gA2~rmIFQqtS#?T8;oT5tE%8_e~^;8+jW-lGWd!Fo1xC5rwSh;P)@7}9S zyTPi=Gi{{_7@7K^;SCO;B*NU4k+lA~hRMbcAJT|+0Z}VX@VL88)}&<~klk+3I2E%U zXfsur;madTPgBtr6?P7&t3bW{27L6waCc7ULH)*3BwBk^PtVrk;7-OwgecLAmeM9f6?iV*WWP#XdHl|gpuFi?cIaX zKdL5TLT3vI7vYbjz6z{fIg_}FC$`8=SE`7MsUgUs86A`)3tMZJm`!IZ@LToIcB8Y( zU|XoNMq9yFGT*D-sda6!EiPNefT`(K=Ej>Guv-rw-^{=&gA-b9RUD5oxGYacblb@8BnvtX;xy{T2tK7!?Z)1j z#6X1t?Z^(lP)43roKEjpL%148_p39cGJ%J_zyxW=@A9-~1vB{o#Mf=FG%#?ty)~Ij z2VJX`=lt6jlizkUvN8kh4MYNug@q*w%mljmmR+?(-)TMO)>__s-swDE`VPPEon}rJ zAmAH8@}|^70Uww3zrSuU4-5JS2)9%ftoPS7;{MUA(KS@5yQ^u;2u`m$JIP~wUoZS4 zPwwu&b$ofBzCr@3pkpBl)C-(7@Fg}3^|``H{=){O>0m@HQNYQ(vs zvmWCD$zcJZY*B9*CoIM3ExG;+YgF+d`x@$Z(R6J0j&|~Nm}W+`a-S0{DU}9@O7C7z zbn~PSDav}es@N7M8X6>Y=Ecn(ej+nN`@_Te(+`AWv`)@drmkR)hPRdzKu)!sozpTbOqrGb)OpZImi_JmjS6wcsgg(}x?Dc>)QKAyV}yk~4vNl1 z5xbIMM}$#vf?7NxUSJJhFOCt8#2p|30C(eOkc9D13-Ccc}a%bb=#Kii(-2I^eVw=MbF?b~BA~-P zUTbjT5I7nbH5@v=?^=84#5P0^}C)j2D*$8M)%CD3lOe(ak%RmLv8pC6_Mxn6B)!$H+ z@oc7U=o}(CJ1yDn0-4gyp=g!f=QH1 zpRfy`(0XG%^b2GM!dRSsvIbh$KU$@x*}R+c|6D?Q4m^g%@JL@BksvUZYchdAeNV2g z{P6zyRhg9lE-5Mjdl^dXx6aP{qmf4j&}a*;+#o~OY~kt*H}mE*Cpb>TKoBF|{n!>| zf+iro38xm5BZ8{%*s2mS;9)EuNB*Ha^~scH(B--l3_{Ju0A;$FeuCt_tFVYzlHUkZ z4c2MtiuEMoPvfm-EWHdF{$44kbtp*k|txQ|-2NA!J7l;p}=q`%&`H?-DLzpqz!pUM!O1f^sP8#uY>Ek>Bx1i;|-Y zHT&h$>n6w5nd__d-S!zj!JMa0nGrhOoz+avldw>rz}aDNGh;?V!7X`)Kx=^ayQ9{n zN+9h531`dOt8W^k-;&t`3Y5Dp)cGsam!OY{jRr{2@j4Y2h9FUahv_plP5fNHUna@` z%Bg2q zN7&T@yi}*0AR!e(o!`74MW=jk)8kq0m5pRFVPd}3B=D+?cC01gyY*~9(b|%^B-;pr zckyHNRkRBo!>PNumzuB+Rt?7ijheV9c$RU#`q(WIr*opkz0mFmXX~QJX9;G10_%>i z>s_*x<7-!|%L|L&F8j^$1bHA|q4L%43*MIjSe9hjT&a3i)lzI_^fW z7)1+uQbx?01m1QR8EjRp1{Qxa!@%dXB-8P}9R%V0TlUA&9|kQ@8e=dW?Hcy_xL+Ws zgT(r(&vuwxK^Na=bgH^g(ArrJDjoSNJ<7DxFXv?A#_Pr_5MS)e7ZC#k;yx=CFt*vb zeY)8toW5`f;J7J@2xaxc{eH~xxNHcms%xFacd_)x$e1f^F$;FF(nVJOAHB|8>>66Y z`#G5QLs-rVcf~`j6yuwQxH|biA0C1;0XwVKw603vA&?GbTUpu2YKuV9*H$-8+oOZ_ zt}@_?3Jn<`mOB_+MD^kwxOIL)baIK}{zd`0@?nW}>IW@oO+vrJCK7Yw-%Cknkqo8M z>`84@_&#`^F?M)kCcc`UcK#X^D^1XK#}8#71iWptjOwNlV4pcH3ZCUmOx5(Qb|N%17ZU3aHCfv_#Iz$uuOHyJh;acxv9c5J8HFkHdcWuAc|@2 z$NzzF5jYtdo$fd1sAHG$3Y+tYsuzN65AB){z#b1oOGWFW9G_kF|2}r);Rg#s2=QS^ zao=b&GQS-_Cnk!^B*l!|>GF_k z(T*Q@E#7)a_C$8E_-TBK-_l8E9K@w9k=}G_>b6FS+BC0Lb=I66nU+Se#PIy@qI(XH zT=e(h%D1skw5fn-aj|&cGtI|G#)368ZOYN-8(pYtF(<6e3=)u8_EJ4Qzyg2vkAUcI z%jpDs1`jA-JGLM-=s3TSXP4t)rCVasmOwbNmD+&~6NGfP>+dm?+N97(xXn~SOKMW< z9Wxp(i|;AKT$#rvYK6#=dPQ}z+WzF{rPM2|mNT$lQCb#B(Ygc|jdhC9=5p!$4ofR6 zrs1_p!?^4bC)-I2$ZjSYRdCm-Y$(pA^DHf@OG{BRU|gSEyqDrf+!Il50qBc*lV#d* z;;te3>hGpVt#aq})_s89%pkkB!EB#N$G=_JANvYjT?SQFIAf{cU=2cP3`x=UEQ@kC zyQ<5rQO+h|jZ*p{f~?ov+E=(cUaMr*V#uw#(p2Z|4EnO9I-2yY?Eh?4}`OG@NTB(hh& z3fNBZwBk@Z4m(k66aop@ZgKrJ%h48|gv(_O^lhhD(@Je|w`D22H{y6BP(3)%f)}G9T(v}9# zOa*!nVLG?*#aY^KVum1$3c&-|$~v3Fa&vb{))q#(91{NClMMaB!Cb0k>|MP|Sfitq zdl?RDx6*3Pc(7ZMAY13raw~pFk3eajo&;%Kj&`{x|Hx=nb-Xtd=~`dpU)aV!Ick3B z5@zza-1gl$mP!vnXI9RSs%-ZR8f!7h`^^lw`cn$WzwYrevlSdb<2Rr3*)(gnh(KoGi~oc$q850^V%7 z1C|S^vH+iFVbL;J$0~L3BZMx!#MF{=hLS}6nAbIp}13BL`zG`bhe+@BPbe(IMEfP9>0-5G;xurz^?$*zC zx$pS4S9CZv<+C17cE7e{(!I(fc6^5u_XK^7{KD}u%9pOHuF_5%1=;wF1TA2*j#-{n zt9kiqjJk?Q4`hy42!46VMDt~@pnxr^Gn<8Fdn2Z|&jO+rGQz%*(D)50k&!2Y1*S*y zc%UGKRGQ)rNB-1ePKW2H^!Y)vMc}K47k|Sy_sc6{8o{Wtk)}4g*G}BMIqf;uH2V_y z9{v8TIVB=ZId1)g)3!q&BRv(%7S7;Gr{|A7v+4C-SK!x&i|p;cMsf?0(>l)@I4MJK z=+R31=kaf)L z80v>V>wU!cck482uZe%mJ~adr7WMA0dDOaMNNdKUxNeSI++n`_HoZb&59ZzBBw1i{ z*Mgw$A6}sD=dd0#4{EiKB(FvK3D%ehPlfXEt?*)2&HAS00^mVpUL~F3dRVR?vKE%l zdHScF<`{}}nCzh2?vt$0P{H?WI3_ctwco`` zD3*pc{qJ3nhV6Q{K5U`QBr<~SEM{mI*XFj^sOTLyVN1zqujJ(4>pksOiR2Q#9gnW^ z

raJ&HGf;va6zIJGqLiAWU0J!ih3P2cpEM$|CaKuXq4@?z zu{u*JaG2xQFF?=BV#Oy#tb)WZs0xoj`fR-Bou~(e)+ZwA!SQbltBv348gAi8G?Z)y zuVFP>1|5pxKce(W0j?FvrO4;@c^?Hmadb5aV+F{wo_%ioSqHsLIo%1i^&OgF4{{P9 zYrSx5juQ$6WRi|GD3;jPuIHZ5bGT~zMSI$kO508d0IycF(rA&Xevx+PX{WL}-LiA* zsxD(UoyLL#jcr24qX)-nQio)6ik!k%w6GAU?PeTwjJjZG-mn_^Fdho+&Gs}_`Sb^-DeD;b$}Hp3){WD zhsWrs_5O=STn5CwiZC#68QONxPN{{^pH-KM?tv~x-GEFBpntjAn)|4+CQc(~u~ut| z<9nk6WQ0HTEfxr+G@BvQFQ$jL#opqYjuPboR5OXOb$5MTkcur$+R*XM&1>#V4<4$O z9S3b$94|Ca&G}yJX;7wH7lfNdNTIEkiG*U8XoPoB1H!~x@LIH%UUmleoKa&l*JDoR z?)HEAt{!TrlILO{t;th(aTeMbq8Evn{@QME;Jq>2l7N+iVM$r?P`oWf;5KzuDYToX z|73n5uRX49-@sFWz6=Twp#beAlEN%s<>PxHx=?$lu51NFp!2-X37W)7PnXRXRQ+6I zI`G|qKisW4i+3LKwcYXkCv1B}{t2nqt>dAvx_hkEv^3S7LqAu$-DV!+dZA6-eU;l8 zR)AsAjOM}ESy08bJHez%Rob=Yu#ve-?D4@3*Va-n6_ zhM5!*d^J1|)@Vfry9GV|u{%+7aq=D#T^keFyQuftq!r(+ zVG>N$))Sv*S0NtZ0O(8umj9q4s2ltiUV|?`;!*$$APkjElP5zVw{We16lo>o+ zeqvnJ@cl(X=6#4ca>!lUxhJldB_H9F<4$EXQ=u;hWcQiKy1ilp6&1}t@KRA0gEz!0 z9yY;M_S-ZczjanP7FQ|dprBB=B(1dzJ{e!jQS-&JMS9^a1W&P3Qh_DFOfq&zkQKe( z2&!+jQmD5K|BV2@+B%XX%GaUt#p+G(D}&&`p`_rlm9QES9Y_WZKEpH(hj$mQ_tJqYC9(^ZKqt_`*7K=>2+*xEGcWpK z#kR%UlOVWA?D@>b#yfke$M}A9g&^!uwaXXSQ<)UA;A+S^g?2+}6{;B$KC!;P7Uq-6 zKG?>*EVS! zMb7H}3KA=8H?bL;w7PMJ;GU*8g0X%FLuKa8LC}lg8|8A;rzu{GScB3?Rq$|a86JX> zjr?m{jUcgJO5kyHd`;P%Y*MGcEr4$kSlaf$os>`j2n~G$UA_@>i%hu6Oy~!8{vvRa$BqgYZt;iDV^zEGF+;ImGLfpxBgO$h6{E4e1V z0WVaEl9`A15Tw%CzNxA<497|@%Ip~UbXtT)$R{)SY4*cLKjMyz9Vljx<(kXtUzcHB zzCnT4N6U$GGx@iv+WA!llQ2Imm&V*qA8s=mb)H}@k6ZZBpA4#9{Nn)rx&W`Yz_)WR zY1;03)xSg=Fj+|@iCQt^kpIdV`sd5PAN;=saVJMh8!LC0e=(3;*_fT3oZX%O(vIAj z|7UV;PEPjDCXN>N|3U5_j?(|D?;lmBCNBR&seiQn&!sHwolM*;{*$i%4iQ&36E}C) z|E!JhznPh{i<6a$h3o$%2@4DRFD}@>@&70P7Z=RJ&4kIz!9G4k*eR3+b?`9&e%~_u zON!J01iAYWW`#Vxdn}YEydcOr9ay~mezDb&I{)61vIP~7rE5U}FSZNZ zZAYz~7az3M|$iu*5Nn=`G0779uEQON7fkRi7cur#%I7BEqs zwSRZS@sfG^5tnPv3DRHSDhe^5x1=3I0M9-6SEs1-B}Q_l4`m*gpkFzeCZXm*z0zT5 zoZ1nc(UEla3KYb41;4VXD82pU2dr)D2WmiNA?9GgHn{H+C5DQ?-f<;!Qn6 zrf&H*&g>eNeNTWas51MwgLdj}tD`S&Cq^V&mp5_)X2WVL&>G!^$JX2k&9u|Jb&47g zk_~pQ<+ZQqSdY*?{IJ{bbkQt3AEX<@6Lolp-*9Y#Zc#}I8&zqIfZ;CfTDSBRGGpP@ zNN~f-9=%h|Op7gXI)N3HTk!bNq(@;PyzGz`2$FmDG^;{(6Bhk%)5*|Tx66e=hveZE z@?b}siml|8nW0ICvMOl?qR?&f(S?-=?2N6})-3E1*Ixh`c2PheYlGUaO4}-f6F`3( zh840R>8MvbO9?@Gfd%_2R*W)9@`>w0CB&^IZ$iU&rE`rImk2`5Nz~T?xTxvIMQ_%< z#YxR?b#eM@m$V86Yu=~$)JY{Qj2biF8(&M`zbbh@+!EJXH`heihI^8y1TCuwtY%p1 zd`VV2?!Rm73pv>k=`ZWT3cFh|cSFK;E|5hR9txpnYV%lbe>-(LeVKcaDatjO9ak&p z#ch|;iG4BEZ^g+e9jgioX- zP|gdoM5nez_@hW&x9cShl$&fVk?Lz{~@Qs*OgtcW0alT zvFtWS4sTz2?5b-XOm7}eu?FF%LN-Z`4v7H8fS|Id`qnulzn-*tsU_Qo z+e2edS@DS^cTapqlW;2Srm#pzh64W`h%u+UE<+bL^__Sm1Nvk?#&y&e)nAH8?l&jl z$L*Om)(6aCpJ=;$6LQ73?PX4(GE9TV`_qKyyYHo5k}k9!v@UdNW6@5Cw71Wrvd>rr z0`izdU*WFbr!*eFhrPv0LimO`iH)VYoOzP{RWV8|+BfmNH1Z=6co&k6 zDemBOE}{X0A*PX=LmmxJiN-kiB|dH@tv5YeTykEYI{ekzxA)_rV~&fU#KFUM4Z^>L zNYr<_ZA`D_GPa?lTiqQXB{=}@!fv3%M%ic1&#cJZLT&?>&6WMv^k)J*(MC5MAv* zfAUDb##_j@OaC%l(Ll{X7@9+79mlT&U~=CdEr-dOrhATE?CRW)RY7yC>2d+u@vBkR zf^;PU;@1-oe3!v(%NcEB`9;acVkZJ<)+N8_3NnAB0@yHgH+rnm=5QNkOXzK;W5CA8 zwBFg4^-JoE6%l4ZydX{43UNclw0@=hdQuy>@P1#u82FFls(En*3x);*6QcZ2jtlXx<8m-@ zw6U~sbz^cdx13C!bo?7Hgk1`RTTHEpFhfDP(2TX&7W8sPXhSjIWTS6&C!}hsmQI;C`T!hew3K5q)-A{Md>u?}rR#iaE3Nb-*+kd2p``_M?VgTw zyha(}jNFL!(@jM*UfH(-%AMqWi#*?C5Qmx*VBv`4#cb~P{qT9GcHu0wRNYPsle`~E z1!Fh)DheCnO7!+h5a+bJ;GGPdfO$KMy~cra$p^>zX|z>_w)E ztzME2n{P-or0f2Huldn>4(hMp5B*DM|Nr~_f8cYqaC5V9wECClZ_!$JSz|%Dg!EFK&Rf_P^}{@Ni6xe^#P5H@Wdm~eIvdkcc|JDsWWeJSSnz7bI?&hOpr;~s3-xbqQNadzn77k+Pe z?gl)cIM7M>QI2u#n`)Y$Tiz~=Zp)f6x{POY9Xt805cX^vVC*M;EhC%iw5g6{w-Gd@ z-GmCgTjW%0zWfwaR$wjY7lFt#72`_v$y$-6;yC8+n9@t~1mEscSPp$l4dmB_QA^yT-m!-D2hxP%7T!6OhYmy`2|@G5wqCTUZQYvEEYd10xg|mhBOkF8Xe$K zT_L#*R6`p(!Q+=f@AdV{|kR)pii24*xULZYGgxt>4Q-So+t(-u+FUb)Y2niv~ zb}~mB*#yzon7bwUs9tDgfg-yY2hg_lM^)xPB*?L%v31*mg64Ir!^P6XW5QZ{_rO|F zpNN9dy7P=g8wfT8r{C_MNpr8p&F5jgdP71k7T!W1EMMKb918{Xf`ALPU#5~JcZuDJ zo}Vcn$T~%V@(n064zWo%;77Fgc1c1&x>o?MusK48|5*UeR)cu2wC$$oqOsBx3%JF& z+Y;Iv9bmh9?dALzPL4WWK#728D(xSRmenS#P1C^2%IV)Q%nIJ}XcFj9uX+KV|~#iJFo>rWOQOwL{*npQ+g$Rjbu|=e&dMGZNC9a&kFEO#D=UEV&ondVW+^0h~&m(o#Grsr!b|;&nw##jjKc3 zn}^4Vdd&|{3XfJ;u9HrQA*`!x+aayL!}qOvK%!GG_)P>&OCQoosPGYiM@3W8M4DX$ zs_0}wD#{br`v#f%E(YVC#Ogl~$Dg|pTFKa5?-$a3W#+xL_vY8qwlu7rOHx(!*^xg$ z8&okYS^rXz8B5j9BU5M9m46MI#Q2?A`{Uq91n_a!bVYD|IqVb&{;wkjFL(|6UsJ;X z`JYfn_=~!klcU=|zwi9T`aEybW&LMs;pHK%3a>_adzC`;P66ml=~6CtDvW|yy(FTfh(}BP73+^}?MvDA4&Yv6+xsDQA{9|&OxPtCvRRfvPS?PofiYMc z4A$6RTU-0-qK@PbtM_!1fLtndqV=?&gco{=Nt!}|z{|ni$Q8-^{p;t00biB`cpza} zpUYJ0FW9*fRN-hZzEKjbZ6WXGiIid5@#42{zy1gW>O&^ZLn$*A`1rBk@2P3t%Nphm zk0oYCI|&(Fp@g6Gvz-q$*;g~QDfrzUvzXB@Mq233g1AWvN-9wTN6gGpVl)ewwb3@| z1|xaort$@{u?Ba)_4Mf0_|SJ`TFwg*AxFO7tXDz6XdPpZGcc)#ixv#)!;ilT6^ubj$)ou^H2?L}*HqVrfx=s@Oj@!a4Wb%7zIccm++T1GCE*1ga@G3~i2C3f*DTOAF^#e#w@D8vP0j z)JE5>)m4p?G2U;_72*NDS#H_kzw=}zznyh|ml`1D+LHFWcOq~-&3x^zH==6iEeN;< zw|%h4t|Fr~e7xT;P^`O~r!b&0;Y0$&_X#t2VUN~n>kB=2eT~c!voZeJNw^ zVJ}(3j4@$6hGx=E?CvoSwPhN4)gn=V{ECZ#?fi9LG&k_mfOFW$U!k(cqOCx{2M;b> zm5Uj#K_ZTW70rk$Px|^fRr+%Z+vX!v@3<0$Bssp?!pCe3V;0r4eMCz&->F1fLXwnf z;gKPBY-{<`Wj29rN?5&&z{np6cIe%Ah(g;})hsi9lG0xgKvgV$6QP{RIxe&>SKupB z+Lk7_{<*<#7&w(7Nw=VhiEAOG#oY7eS?nk(R~J@usxk#9hA=$teRFg(nnQw*Fq`SE zDIq|edUwsUcQ%3RI$I+dp>}7HaJpYblZL<0;8Vs~ka^Ifn#-I%Ij6z3e$LzPW6{)- zK6%W0AM@vk4*%ZAaMIHCo-=3D^)!8Qe#vpF-fD?qLqzL$_3wJ=zfH?a&TcDBT|VIi zwx{1brt6;7Dk^H6n=cr|T5O>0RC<0lS3t);Y-GCa5*`9^6f2!~dEqC*8g8IF*Se?Q3zVltMj*3ZV4KplgryV1@R8d%Et?8s&)8VC$)3^D;Yo>zaEPHHx z?nh9)kKv|Jxw7!jmaKuLGSUH;_6zHl7FyW8KKGW)8f8%)!44{z^)-$#i+k(MjQKLM zFk7M}BGkVPoM$@jFkwOnsYbp~CZ|m-ZTGLa-B@8-+nCkL;xoiGZDG!LjARjAqKYeS z%{EcL3$2zMcpdOV*1CQdTK;ykh5dnTZ&|ReJ~p>l6B4cLm{Iv67r?VO>!t~Na@3~g z9?;e~o=b3C6!nLJ%TY+*T)x)uEM(K*Y#il~f!WKFVI_@V5o7u}jB#&QGtY6M+(iez z*blAg*4=xlO?EkkCJX95%UlGRP1F>mBcvG zgN4513O+A$$-ubUsML6+zien=Qa8Vg7H{B<^{-uh%v-)ix|seT3zLA&qQ$?9;xtSn zHkV~qB6(!z=DD$R$o-3xK>J0eCk5jV%H<(rWvs@AA4rUCqT+kQ}W*mQOe=~u z79Q56^DQ@Y>qnzX^x7*!u`U;z%1v(W(g|}rp7K9OE>AikVly{rrf|qD49!*9{3V!B z0yeJmMq~n-o<3+|p6Qc6J>TzPw(p%{tqp0SdJmbKWBuOMszwew`3lfW;nMUc z^e*-!jfc+&V?aQeS8;MLpql^w>EMzk8T^2E%aW(%D|-11LcR3Wo#2?xktN1D^s$;Fs;U=v>g-Gcs+{(i=e@BJbLKRlBP= zvt(7k`MkW5V2#^%%TjQS(h}0WB1PwYBh?(!g(`r@&Te{QQT$cw>Pw(zdq5AO1GReoY`z{-;z^C}vl?^C-m1M+?gCntAXi zU7q1Rm(PIKOJsT){Njchmx5l;lv*3&jH9e>U4WrgvgP<{9UJ6orti{_v`%}-`nC6q zy*Z&)a?)MOe3Po6_acnZ3UqfD&hm&D+gS8d0a~&ddP=#d2Qk9dMA6e~qcPC9NA+8N zDeJS;!l53U(Rx|5+vWvY12Uz>19@Z|hGvqOAA0N$dUkp0gMzlBa?@~*%VZMjeF1}% zuv-d+Du2kkacm@M2kC3Z^n8*YTY-6lA%X@` zE#i|ota}4?I@jNrWe(qSn;5>|7c_;$@7n|skK>Sh`2335GYatg2up;q z-%;KG?nNdjhXUD~v$(&12Ogsc4%;;^c@VUem06`U*#v$FpXr8cFpN0DdyKPw%$M7MmVx=ii# z>U!>?c)dMCb^B7(v-GZ)CAL416`Pex-KF7%&FF>O!1kx?t;*hY z#8g!?bq5gP8HuZ)DF`2DW+M;^Y^a3X|JnVFY)a*yH*~l?;myjQ82#2~ejVQFG|FA4 ztdviTs=0W0g2R@M#ZM|pm9Z+(J)YZ{@Ej=<5TNqS0C4r?#sx1;*yvV)bTQHiDhf+0 zBRFN7NmSB2TM6FKMO&sQEG-f&8j(Z(yTp(-ag=`gFu81Ybltc{fpzwnh(0RzxCSYG z(IdqETxHa~aZPv`k-xy}vatHEseNnxZ#RmD{-i^+@ErW&D!y7Hi5vc9~IFE~#<%xNTwAlOHA2ffzus}~y8wyicGpgaL( z@Did3_~gHH0o$`}+~`T5uw>)%8N>5B8#>A-l(ig)JXfoy~#HFfVjQ%bB|sOCS%Dz|*bj#Bmo zjOXfpJk9BWSd9#u7E4~cW(A_l0nk<)MZAice!)d+Fka^9WDJ~>EJdhtvrwQ3*Hu@) z1OtNk+7ef85~+5?(}W*vTqz{tm-}Q&W&RrN3KPGJTb}!7g{FbigwLK4F7W#|xOX}g zM!v-{8?{!t>9^daJKk{695QfBYm9S+?7gPC*Ur{Cir9+;X+?~+^S3`HfIv@uYe&fA zw63dN6PwS7i+J4oov4Fw;!-yot)oQoGnpsCmkq0G!E%{caiXHg9>yUJNo$6&u8>I2 z&`NFoESTO}U-WVm9>3Sw0qGl5*H`+ZrNtq#RBjlFKyEqahKrugabrOW=B~9`fs)mFyRncQ^lGXt1m3x(#w#2%&$G4YV0TgVe33Su^c8Q$OXqZPH(Y|5qdD9o5A4?eP#wgwR9?NKJzDNE7M3_ugwjx`Kcb zibyY^NH0>Pgx-7T3J6M3njlROBS;4+0v7be-|yb1_r81AdVBvfGwbZ{nKPNp%sFd+ zHXU}-;ma;F3-L$GHtQd@*Q8%qZ;78ygxPKT)ONoR&?|LH3KENTx6^2N(9A>h=C+1o zobRh-X^L!E1jN{$rA0KOyDWUru+Fq`d*~wO!zP*hFe;?&na@?gNoH0aZ)2Ou(JFD| zV}_Qe%e%X`a-XtDEX#D}O)M|nP+U~y5Nkrtk{3J2u=6uwohDZl2FC8}(R-07lZt=8 zA5`Tv>9zm)xEjZ*TjN1=cJqsqts0^36eez9^lA0^=3ds515?ka)KBb9jBI{C&QUmR zP4Km&1}p!wFO?t%f)s+xIcYKpx07$|r3(?n(KX1=<$b_&uNA!=Buzq3>^1VGqHU_4 z(9s{+gIq78@ij9p1V-e8sIN{$eFU;pb%s%P{a7aP)caw((@R9{PT>){A+rqNZYfx^ zK+4t!^U2l&umxtqf~Q>&-6cFY`b0d+U`s%^%_cj9^HAU@dRd&je^{CO4r8=Z2<{H+ z+@9CabkGczWkmay z`FmJOT|!3=Nw++ufti6}vONBV$64S$M*HP9ZOM&X+aHb|W^(ssg_Z3BT&9-cc_NnM zD1Oc6JR6`mI@lvXMosRdy{9O+D4&o<>vCM{txE~5%$-U#COohG3>)`EkUb=eZWfN4 zn1Okl>*HsS2VGaPu`*um*FP$~YUZ3i?$;QK-fRDA34}85B?o>n>3Yvyg({!dQeBvL zy$rN=aa4L}P;m{QzpDgxFCM(CSczKDJ>!PXEGObNa~$Mk0tt#2qE0dn;IG%7 zAN-W)I?ux+BJ*BB_b*Z%GEwn+W{r(Y9-m=kzA~4HC3J|z-ch3HP@-@P$h4!z~&3m$e zS>2}zrsu7FZyE_rosRECbjHkAtJimJ_BbkPXUHkP%7)3V4!1mvte(jos(`;%Om2UX)9Z@ds0Fvjznt z1K#GZZ(4Lp3N$6H-#Mud5#BtbOPl#|F84~@W|QT`X}iNp7!8%hSbZIwXyd9tq^8TD z+T?0;4EXWah3tH(68H6~s*=F%A8}~XH@8t)SUS6&uqR5Vn$itdgBG@QG~9bkZmW6J zJoAkVq;90K0#=>iG$u{E=Oj@{&lmw9nrFIGW!^h|#l@vQt@at8$qQ_J=H=!P9iV96 z_x&6tMfFq3>tEbc+Nw*`mDH6QL`twWMtADVVm~r=4iA9PQ=uZ$PK=T@Oa-5cmTcR4 zI}aDyA7~2_bU1_`LVN(i;_(6L9}~WfG;a zFODrIRHtk+={MmvLNsMp>`M<4I40|?#)GL}MHo2Z?6NuJ+uA2tETdFk3C$>~nrXla zCq;7}5J%6oFU`4D*7_iN_?SWPWC0&`pZA<%3xT(bX80TGx>4|LM!Kut$2sDQakA5M zij7sfV?38$cyR{QzS+@+KmH&_gk>QRoh_;AUi#o{W7iN?8sMIZA8-i5LeGWPd z8_qsTfcngq*|fp9)$oC&>FaK%QdZ9XVF zPxK2}j<+Q{xu%JpQe3+0fI>fji(Ccz+S(1!?-irYpw1vh`dJt>YyA&kElVv5 z%K6n0rV8y?EYlUZD}2ilsR!=;5uF22Oo{D$p{y&$eh+KH?+ACqWIj~CZkVPWXB>(5 zyYzGlORmvBw{%o&RoGrKzGf=KWR67Pk4#h2Rp#I4NrThD=oE|$#AIT5h~;T7oH`9) zbZ;2=hR34DET>KTs1v9YED4JHM$NB!Un@ zypWr#9u|b?_WK)S@x4Bm%-z){ziwFt2qKXWd+vV{7V`LX@6oN7t_R=L`XGeW@5W*s z8`m7)ReqYyaiL*#C+oZUC>gObjIoeXxa1g?8GoMxto8`Od3l-!gvMO@ zziPOx51?J(xHVB`4+&({m;{pYM^141Pp@; z^mLBt6snEa?Uu^%J$;-AZ8G!1>?qz0_n(00Ky&VX@1-KjyYMp9E8MGzlxu;4yNTXi ztkB<8eqKP;o5hzfE`o%%gjS?5$k2(ZKNQ&57@08Tq*}SH{{<;OiSRNe|Bs>rudS(o z(N94DlRoWv$EPnoO1-fUE*eqmdOnQ}CXCyN!b=m16zG20c z-;3}IlL?QI6n6_Jh6K8y%}N4NNiNtHv9 z&7?=1q+@^r2BC9|%5=(aD|rx@k6Rma(%d~;4P5jhT2Kt^6qXUcr>1wzO6OTb|K&Tj z@#S)n&Qf6=MbQK2MjDSCnT2Ax@LCDV&s&x240Uxn8}j>gvC@*|}q zSeMX}4+;|(Qnq+``YHRz%#bb(Aq|AoyG|S1_*aCsFH;$UK`OertsS}%Dfdw* ziE2nobnUXm4`#b>7xRi9xN`Ll8-6Iup>#m&e2vi=J4e}LFXtjcD;`giB)h@IeOdC5 zHTs={nqK{Uq$k9B)4P(sQpCU!R^Z5Y4+jeXie+n4Ze525sQH{=FuHMP1HuOwTn3Jg zAt;<@^W|=2vLySg?_9Y$g|ORCti385Ab3Nl9t0UOW^v**nb{$D^C42X)kE1=Zav+D zlb5M~m5@5{p{2U94Hqv%T9RjDY6Z6Uz!i0%CO8`3RakW>pQA=Bp_SH+)abi*n8{(! zK4|#knwI>|d7L)Jsq4KGSjD+>GeAo|euTcB8Q?6wi^ zaOsptJe0+{2*IAsbv)^JV)Bs{V+M_r^{9f1FlO@tL-P} zNb2g`9$gZ@AVn9s`ugZ|H|Tw9l(eZb)vZtKQ`{vE0`VDR|Ti34{SBAb?~SM%sQ)BDf`dV(8>%eAGrt z>5tF#(o6!QGF@~@{K0&JL#JcjcaG`HKk)nN|xmLS~&u; zY5K_e$Y^V(`R~5Im)%SVkjRWeMj?Gc<{f24UwQ9v4|AAzs4i76!a9rJgx+{XIv!8x zGvGWQ=i(w^S&jk~O`onXzll&nheuU-=0Cp!9eYn;jf-cP@lIgOP=)WFx+rMK%F03< zy57>;39N(j8D>)`1WWq%pwsg6WY+$@L#4Fc3S$07<)o<)lf7 zDtg$tg}y^~^r^!+YKa?A2IpHw(fo9sW+~pYpIXNBx1U7 z@39DOniZGc=2yOF4S3k3Ao^*~FB{gMF8h$Cczoi%8gVj`)My#fJMBzeVbC|h;%+uH zY{bb$HB358`kwAhoiLFE1$2n?rM?Xp*FiKCBdu^Db5&$c(&q~(mt%f#pUJOp$m%Tf z5-YpjE|Fek$4(|sN_jHgJ)Z;v@_nEP16fN<=a|vsyL#a(Jm=vYdY`R&jb@3W+FQWw zC5-FxCCb){c<(fEVgqIY6#1b1z6@E3m42zNsP`n)62h8A^__1ClV%^|av|kYq`dga zBIEwwzzu<*_?+;N)+~QY@ZOyYSndJ9U-g?Ftxe;(w!R?UmO_Lwr#;V~AAH70*oNW8; zS(73OYsj-31hi``0c}7HnB^{+Wp?61&J*oe{4GHYHqBfRx&UVPhFk8kS-Q2+6QG$d zmrk56?T5Ky7T6Op#u>#GA0GY~G8i(jvM&Tm6vdG6mQ?7(HTg1C+yyhIbi%-}Kvu>I z>Kb0cjAB%1y=I(ilq>NqjNx6(R2Lb5^ciX6d$iY#Q+pK?*-D>RsnrU){pB-f)WSvp zn(M*4*lph1g&n?KBsfx>#(VrXt2A)t9z!3octP}-2AV6^-(mZNZVEq0M#^WA{!_lv z26_9VC1@@*SFiunu=*P)EP0|2bg&A^cRj@t;4k$ajF!hKmnX_l&wD{2ZL2&zZ04iK zIGV>Qk;lDlQNPD*QQq7@o}WiS+l|=h@q#Qx7`dK5gm@{$ue_O?3m2lQoT#Bbf=la2 zeyDXYp~z(;e2a{l@HYBcq>T`#NQ6%2?)PJ{ z9%e#lQv)daT9i>mO6(Ifi~4!UQ)qwd570C z8@o_zVq!RO^$)Kd!@X`?=H7=YhRnl0D5fv4q#Gtaho{0dVSl(UO{w(JOp$Z)6#t=| z>L57abqLtAH5FCqJy2e%vxR=y#6wSX@p*>C)=HU&`%~vnf!TR68Q}HqNrbJ8O$+#F#)q!sqsX8 znA@tM@5FQ!rX#BtVZk4giGq(c2_?l%nYNtHvhDC1W+yfkw5!LdNB!Y5_>{s9&-iURhnGdc2$_2@{#-_6$P=Fi!MO&nvZ<;;$7~GBNj#{$dej*kwPbW;yR;X%KN! zOTc`Qu!OFJ&egK<6I%p`+QPrg{vGEGtA(+(SwNcR6_t20VKPf&+1eH`HOtU{f4FOL zA6VD{DN#3>tf;@zT`c8M7Gn7Xi1yw0QBzjTpE#V;o__ZbWx@w@2^g3C@t*pd+-vVfmiyq9 z%LWfz`ct|*?_@0~7S;J46ulw#lC|PxTjgJ^V|ugJDQEFKFh(k2qQBKk>Sh79*?Mhm zlt0>5RXr>^U6(P&>lzqVN|=n>7Nc~dw_uF<_UIaA(M4C62l8>JYMC077b1g*N6p+@ zvB#zht$;H!LPEHm$H$BtZtHyKa1J}t$|18Mv&BBME&tN2I^O-VPOi<1^(dzLX-uS5 zAbVsNz&nctP@>emC2s3>lJHu<;EMyevi-?P<-pSE;7Lr`!k$V7ZK&x4JyU>F^DExy zgefKgvVP{s{|;XI`~!3su5~9l=0joa^XeWUP$fK5J8seAXRif^Gt{B=&^l|C$6KOy zn^=%rmia=2bPH&=T1NfTlzuktuEG%CN;k&eTz+4JAo-kcm2NeI!q!`7_XK(lFO^YO zSGhNVeLu527co7)@)aOWKmuQU!=1*z#qe;Ai)$UKV9A|F9Xmr- zo2yf}E6cYiInuV?RzEdQAChF6F|BTS&8yVTG4C%zsj&{(>=vwvu4ld(dDk|%EIw-a zwH408LvqXio$Issbvd%f3=^F$-%|vV1w@XbDBhjmXX-=r1s|hqW}_=&1akNxhlALU zQ8%mJwzzM#hOpZ~?QVhW!~tfvi_U?cag>ig=E`I)(b|bvBUaBQtg$tkRD_G&N!E(Gr%|A_C zBwESCg7N#%hxpJ}1N|J%vBu*NP+}g`iJKg}ZN`>o^T_F{Tp;5MpM2)zHVo0)c>LSu zjzUbSf3k~*Yrf~vd#g+$F;}=>A!wZ36-b}`dX&Jrm z`d=@GUVR?czy_Pmmg4*rZpec-2Y&qQ*sIYGb5A6ferG$Ho^x zoda<$9#z%f4`vL>-;dbx)riQ@s?f{nk*!y<6&GIqq4qd0asDv0d-X>CD*jW(-x}SWx=};n z5dkG3bQn1e9WA-waKWJg`k^8~O)4kJt}oKNZ}%!u<08~__nJktZL=G_W7gwIh}(&v zPD};4!mTWY7X~09kOH~F&Njc8Z1_V~ZeX&;eWJ#_@P}MstF-;1#9Y}q85@s86CQ+H z3|z|BuA^{7Bc&pcb;SutI1iiw&alugiF+AYw~R)bJX$Vub7cl|JW>gJ{T)i|_k>HD zPBWJSHmXQd5_^WaOly#nJcCLPmV9|;e8IJ);;HE|G?LMnyp;Qr=t6jH`=UX0#^;%v z#Wl?s^VOuU_w$cUCoNi5><0qfM0ZD@eA(5eC>ZMylk0e4Jl0x-Pe2n^*l{RXKOFY; zxN`slA6;G_{1o$EMEc2hKJAFLJgz8iWkYnq+aLeQPR&S5F5l+{07f{7@G02@Kw7}R z*Fwi9Oa5kmR!0AO)ZeR}{|fn8zx>~7pZ{IuR}=v7llJ>%=qvx1PW+vQ{OcHg#r<8U z_aAhArz8Je=O-We%g+8m=NB#c|5f3~69s=~E`QOJ|6diye^B{FQ~tZkU$1b^KdAgp zSN^-sPrmY(P5pz;Uunz#D*Xxn{f-6xUSpNCo=fULb!eh z2>%}UJB;uXIrwGb_~QTnn}Ut!H~t>^dq($PBmD&aiZ1*;lJ2*xCv diff --git a/src/Mod/Material/StandardMaterial/Tools/README b/src/Mod/Material/StandardMaterial/Tools/README deleted file mode 100644 index 5edc5e25ba..0000000000 --- a/src/Mod/Material/StandardMaterial/Tools/README +++ /dev/null @@ -1,42 +0,0 @@ -WARNING: The scripts operate with limited checks and can be dangerous. - Commit your changes before using the scripts! - -That directory contains set of scripts for FCMat<->ods conversion. -The main purpose of conversion FCMat<->ods is to allow batch editing as -it's much easier to edit a column in spreadsheet than 25 separate FCMat files. -Also creating new materials similar to an existing material is just -a matter of copying a row, changing file names and relevant properties. - -Typical workflow: - -1. Run ./make_ods.sh to create Materials.ods -2. Edit Materials.ods -4. Run ./make_FCMats.sh to create directory with new FCMat files -5. Copy edited FCMat files to StandardMaterials directory - -Other scenarios: - -A. Removing a property - -1. Remove the property from headers file and from the TEMPLATE.FCMat file -2. Run ./make_ods.sh to create Materials.ods -3. Run ./make_FCMats.sh to create directory with new FCMat files -4. Copy FCMat files to StandardMaterials directory - -B. Adding a property - -1. Add the property to headers file and to the TEMPLATE.FCMat file with a description -2. Run ./make_ods.sh to create Materials.ods -3. Edit Materials.ods and fill the values of the new property (empty properties are not written to FCMat files) -3. Run ./make_FCMats.sh to create directory with new FCMat files -4. Copy FCMat files to StandardMaterials directory - -C. Sorting properties as per header file order - -2. Run ./make_ods.sh to create Materials.ods -3. Run ./make_FCMats.sh to create directory with new FCMat files -4. Copy FCMat files to StandardMaterials directory - -Important comments: -1. First 5 lines of a FCMat file are copied without modification to the new FCMat file -2. The scripts are to be used only on linux, in the source code directory. \ No newline at end of file diff --git a/src/Mod/Material/StandardMaterial/Tools/headers b/src/Mod/Material/StandardMaterial/Tools/headers deleted file mode 100644 index 2aa97773ef..0000000000 --- a/src/Mod/Material/StandardMaterial/Tools/headers +++ /dev/null @@ -1,53 +0,0 @@ -Name -NameDE -NamePL -Description -DescriptionDE -DescriptionPL -Father -KindOfMaterial -KindOfMaterialDE -MaterialNumber -Norm -ReferenceSource -SourceURL -StandardCode -AngleOfFriction -CompressiveStrength -Density -FractureToughness -PoissonRatio -ShearModulus -UltimateStrain -UltimateTensileStrength -YieldStrength -YoungsModulus -SpecificHeat -ThermalConductivity -ThermalExpansionCoefficient -Color -EnvironmentalEfficiencyClass -ExecutionInstructions -Finish -FireResistanceClass -Model -SoundTransmissionClass -UnitsPerQuantity -AmbientColor -DiffuseColor -EmissiveColor -FragmentShader -Shininess -SpecularColor -TexturePath -TextureScaling -Transparency -VertexShader -SectionFillPattern -SectionLinewidth -ViewColor -ViewFillPattern -ViewLinewidth -ProductURL -SpecificPrice -Vendor diff --git a/src/Mod/Material/StandardMaterial/Tools/make_FCMats.sh b/src/Mod/Material/StandardMaterial/Tools/make_FCMats.sh deleted file mode 100755 index 09f249a3f2..0000000000 --- a/src/Mod/Material/StandardMaterial/Tools/make_FCMats.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -# That script converts Materials.ods file into FCMat files. The result files are saved in FCMAT_OUTPUT_DIR - -FCMAT_OUTPUT_DIR=FCMats -MATERIALS_FILE=Materials - -# Check for unoconv -which unoconv 2>&1 > /dev/null || ( echo "unoconv not found. Please install it first!" && exit 1 ) - -# Convert Materials.ods to Materials.csv -if [ -f "$MATERIALS_FILE.ods" ] -then - echo "Creating "$MATERIALS_FILE.csv - # 124 is field delimiter | - # 34 is text delimiter " - # 76 is encoding UTF-8 - unoconv -e FilterOptions=124,34,76 -f csv $MATERIALS_FILE.ods -else - echo "Material.ods not found. Please run make_ods.sh first!" - exit 1 -fi - -# Helper function to retrieve string from X,Y position in csv file -function get_xy() { - VALUE_XY=$(cat $MATERIALS_FILE.csv | awk -v x=$X -v y=$Y -F\| 'NR==y {print $x}' | sed 's/\"//g') -} - -# Determine number of columns and rows in the Materials.csv file -NUMBER_OF_COLUMNS=$(awk -F "|" "NR==1 { print NF }" $MATERIALS_FILE.csv ) -NUMBER_OF_ROWS=$(cat $MATERIALS_FILE.csv | wc -l) - -echo "Setting output directory:" $FCMAT_OUTPUT_DIR -if [ -d "$FCMAT_OUTPUT_DIR" ] -then - rm "$FCMAT_OUTPUT_DIR"/* 2>&1 > /dev/null -else - mkdir $FCMAT_OUTPUT_DIR -fi - -for MAT_NO in $(seq 2 $NUMBER_OF_ROWS) -do - X=1 - Y=$MAT_NO - get_xy - FCMAT_FILE=$VALUE_XY - echo "Generating material file: " $FCMAT_OUTPUT_DIR/$FCMAT_FILE.FCMat - touch $FCMAT_OUTPUT_DIR/$FCMAT_FILE.FCMat - - if [ -f "../$FCMAT_FILE.FCMat" ] - then - head -n 5 ../$FCMAT_FILE.FCMat > $FCMAT_OUTPUT_DIR/$FCMAT_FILE.FCMat - else - cp new_material_header $FCMAT_OUTPUT_DIR/$FCMAT_FILE.FCMat - fi - - echo "[FCMat]" >> $FCMAT_OUTPUT_DIR/$FCMAT_FILE.FCMat - - for X in $(seq 2 $NUMBER_OF_COLUMNS) - do - Y=1 - get_xy - PROPERTY=$VALUE_XY - Y=$MAT_NO - get_xy - VALUE=$VALUE_XY - if [ -n "$VALUE_XY" ] - then - echo $PROPERTY = $VALUE >> $FCMAT_OUTPUT_DIR/$FCMAT_FILE.FCMat; - fi - done -done diff --git a/src/Mod/Material/StandardMaterial/Tools/make_ods.sh b/src/Mod/Material/StandardMaterial/Tools/make_ods.sh deleted file mode 100755 index f64e4a99cd..0000000000 --- a/src/Mod/Material/StandardMaterial/Tools/make_ods.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# That script creates Materials.ods file from all FCMat files in current directory - -FCMAT_DIR="../" -MATERIALS_FILE=Materials - -# Remove existing $MATERIALS_FILE.csv -if [ -f "$MATERIALS_FILE.csv" ] -then - rm $MATERIALS_FILE.csv -fi - -# Create new Materials.csv from all FCMat files -ls $FCMAT_DIR*.FCMat | xargs -I [] ./FCMat2csv.sh [] && ls *.csv | xargs -I [] cat [] | awk "NR==1; NR%2 == 0" > $MATERIALS_FILE.csv - -# Check for unoconv -which unoconv 2>&1 > /dev/null || ( echo "unoconv not found. Please install it first!" && exit 1 ) - -# Convert Materials.csv to Materials.ods -echo "Creating "$MATERIALS_FILE.ods -# 124 is field delimiter | -# 34 is text delimiter " -# 76 is encoding UTF-8 -unoconv -i FilterOptions=124,34,76 -f ods $MATERIALS_FILE.csv - -# Remove all temporary files -rm *.csv diff --git a/src/Mod/Material/StandardMaterial/Tools/new_material_header b/src/Mod/Material/StandardMaterial/Tools/new_material_header deleted file mode 100644 index d5c9d9f4d2..0000000000 --- a/src/Mod/Material/StandardMaterial/Tools/new_material_header +++ /dev/null @@ -1,5 +0,0 @@ -; card_file_name -; (c) 2015 Your Name (CC-BY 3.0) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material - diff --git a/src/Mod/Material/StandardMaterial/Wood-Generic.FCMat b/src/Mod/Material/StandardMaterial/Wood-Generic.FCMat deleted file mode 100644 index 45b294e268..0000000000 --- a/src/Mod/Material/StandardMaterial/Wood-Generic.FCMat +++ /dev/null @@ -1,18 +0,0 @@ -; Wood-Generic -; (c) 2015 Bernd Hahnebach (CC-BY 3.0) -; information about the content of such cards can be found on the wiki: -; https://www.freecad.org/wiki/Material -; file created by FreeCAD0.18.16022 (Git) - -[General] -Name = Wood -Description = A standard construction wood -Father = Aggregate - -[Mechanical] -Density = 700 kg/m^3 -PoissonRatio = 0.05 -YoungsModulus = 12000 MPa - -[Cost] -ProductURL = https://en.wikipedia.org/wiki/Wood diff --git a/src/Mod/Material/TestMaterialsApp.py b/src/Mod/Material/TestMaterialsApp.py new file mode 100644 index 0000000000..d2a1b618f6 --- /dev/null +++ b/src/Mod/Material/TestMaterialsApp.py @@ -0,0 +1,236 @@ +#************************************************************************** +# Copyright (c) 2023 David Carter * +# * +# This file is part of the FreeCAD CAx development system. * +# * +# This program is free software; you can redistribute it and/or modify * +# it under the terms of the GNU Lesser General Public License (LGPL) * +# as published by the Free Software Foundation; either version 2 of * +# the License, or (at your option) any later version. * +# for detail see the LICENCE text file. * +# * +# FreeCAD is distributed in the hope that it will be useful, * +# but WITHOUT ANY WARRANTY; without even the implied warranty of * +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# GNU Library General Public License for more details. * +# * +# You should have received a copy of the GNU Library General Public * +# License along with FreeCAD; if not, write to the Free Software * +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# USA * +#************************************************************************** + +# import FreeCAD +from os import walk +import unittest +import Material + +class MaterialTestCases(unittest.TestCase): + def setUp(self): + self.ModelManager = Material.ModelManager() + self.MaterialManager = Material.MaterialManager() + + def testModelManager(self): + self.assertIn("ModelLibraries", dir(self.ModelManager)) + self.assertIn("Models", dir(self.ModelManager)) + + def testMaterialManager(self): + self.assertIn("MaterialLibraries", dir(self.MaterialManager)) + self.assertIn("Materials", dir(self.MaterialManager)) + + def testModelLoad(self): + density = self.ModelManager.getModel("454661e5-265b-4320-8e6f-fcf6223ac3af") + self.assertIsNotNone(density) + self.assertEqual(density.Name, "Density") + self.assertEqual(density.UUID, "454661e5-265b-4320-8e6f-fcf6223ac3af") + self.assertIn("Density", density.Properties) + prop = density.Properties["Density"] + self.assertIn("Description", dir(prop)) + self.assertIn("Name", dir(prop)) + self.assertIn("Type", dir(prop)) + self.assertIn("URL", dir(prop)) + self.assertIn("Units", dir(prop)) + self.assertEqual(prop.Name, "Density") + + def testCalculiXSteel(self): + steel = self.MaterialManager.getMaterial("92589471-a6cb-4bbc-b748-d425a17dea7d") + self.assertIsNotNone(steel) + self.assertEqual(steel.Name, "CalculiX-Steel") + self.assertEqual(steel.UUID, "92589471-a6cb-4bbc-b748-d425a17dea7d") + + self.assertTrue(steel.hasPhysicalModel('454661e5-265b-4320-8e6f-fcf6223ac3af')) # Density + self.assertTrue(steel.hasPhysicalModel('f6f9e48c-b116-4e82-ad7f-3659a9219c50')) # IsotropicLinearElastic + self.assertTrue(steel.hasPhysicalModel('9959d007-a970-4ea7-bae4-3eb1b8b883c7')) # Thermal + self.assertFalse(steel.hasPhysicalModel('7b561d1d-fb9b-44f6-9da9-56a4f74d7536')) # Legacy linear elastic - Not in the model + self.assertTrue(steel.hasAppearanceModel('f006c7e4-35b7-43d5-bbf9-c5d572309e6e')) # BasicRendering - inherited from Steel.FCMat + + self.assertTrue(steel.isPhysicalModelComplete('454661e5-265b-4320-8e6f-fcf6223ac3af')) # Density + self.assertFalse(steel.isPhysicalModelComplete('f6f9e48c-b116-4e82-ad7f-3659a9219c50')) # IsotropicLinearElastic - incomplete + self.assertTrue(steel.isPhysicalModelComplete('9959d007-a970-4ea7-bae4-3eb1b8b883c7')) # Thermal + self.assertFalse(steel.isPhysicalModelComplete('7b561d1d-fb9b-44f6-9da9-56a4f74d7536')) # Legacy linear elastic - Not in the model + self.assertTrue(steel.isAppearanceModelComplete('f006c7e4-35b7-43d5-bbf9-c5d572309e6e')) # BasicRendering - inherited from Steel.FCMat + + self.assertTrue(steel.hasPhysicalProperty("Density")) + self.assertTrue(steel.hasPhysicalProperty("BulkModulus")) + self.assertTrue(steel.hasPhysicalProperty("PoissonRatio")) + self.assertTrue(steel.hasPhysicalProperty("YoungsModulus")) + self.assertTrue(steel.hasPhysicalProperty("ShearModulus")) + self.assertTrue(steel.hasPhysicalProperty("SpecificHeat")) + self.assertTrue(steel.hasPhysicalProperty("ThermalConductivity")) + self.assertTrue(steel.hasPhysicalProperty("ThermalExpansionCoefficient")) + self.assertTrue(steel.hasAppearanceProperty("AmbientColor")) + self.assertTrue(steel.hasAppearanceProperty("DiffuseColor")) + self.assertTrue(steel.hasAppearanceProperty("EmissiveColor")) + self.assertTrue(steel.hasAppearanceProperty("Shininess")) + self.assertTrue(steel.hasAppearanceProperty("SpecularColor")) + self.assertTrue(steel.hasAppearanceProperty("Transparency")) + + properties = steel.PhysicalProperties + self.assertIn("Density", properties) + self.assertNotIn("BulkModulus", properties) + self.assertIn("PoissonRatio", properties) + self.assertIn("YoungsModulus", properties) + self.assertNotIn("ShearModulus", properties) + self.assertIn("SpecificHeat", properties) + self.assertIn("ThermalConductivity", properties) + self.assertIn("ThermalExpansionCoefficient", properties) + self.assertNotIn("AmbientColor", properties) + self.assertNotIn("DiffuseColor", properties) + self.assertNotIn("EmissiveColor", properties) + self.assertNotIn("Shininess", properties) + self.assertNotIn("SpecularColor", properties) + self.assertNotIn("Transparency", properties) + + properties = steel.AppearanceProperties + self.assertNotIn("Density", properties) + self.assertNotIn("BulkModulus", properties) + self.assertNotIn("PoissonRatio", properties) + self.assertNotIn("YoungsModulus", properties) + self.assertNotIn("ShearModulus", properties) + self.assertNotIn("SpecificHeat", properties) + self.assertNotIn("ThermalConductivity", properties) + self.assertNotIn("ThermalExpansionCoefficient", properties) + self.assertIn("AmbientColor", properties) + self.assertIn("DiffuseColor", properties) + self.assertIn("EmissiveColor", properties) + self.assertIn("Shininess", properties) + self.assertIn("SpecularColor", properties) + self.assertIn("Transparency", properties) + + properties = steel.Properties + self.assertIn("Density", properties) + self.assertNotIn("BulkModulus", properties) + self.assertIn("PoissonRatio", properties) + self.assertIn("YoungsModulus", properties) + self.assertNotIn("ShearModulus", properties) + self.assertIn("SpecificHeat", properties) + self.assertIn("ThermalConductivity", properties) + self.assertIn("ThermalExpansionCoefficient", properties) + self.assertIn("AmbientColor", properties) + self.assertIn("DiffuseColor", properties) + self.assertIn("EmissiveColor", properties) + self.assertIn("Shininess", properties) + self.assertIn("SpecularColor", properties) + self.assertIn("Transparency", properties) + + print("Density " + properties["Density"]) + # print("BulkModulus " + properties["BulkModulus"]) + print("PoissonRatio " + properties["PoissonRatio"]) + print("YoungsModulus " + properties["YoungsModulus"]) + # print("ShearModulus " + properties["ShearModulus"]) + print("SpecificHeat " + properties["SpecificHeat"]) + print("ThermalConductivity " + properties["ThermalConductivity"]) + print("ThermalExpansionCoefficient " + properties["ThermalExpansionCoefficient"]) + print("AmbientColor " + properties["AmbientColor"]) + print("DiffuseColor " + properties["DiffuseColor"]) + print("EmissiveColor " + properties["EmissiveColor"]) + print("Shininess " + properties["Shininess"]) + print("SpecularColor " + properties["SpecularColor"]) + print("Transparency " + properties["Transparency"]) + + self.assertTrue(len(properties["Density"]) > 0) + # self.assertTrue(len(properties["BulkModulus"]) == 0) + self.assertTrue(len(properties["PoissonRatio"]) > 0) + self.assertTrue(len(properties["YoungsModulus"]) > 0) + # self.assertTrue(len(properties["ShearModulus"]) == 0) + self.assertTrue(len(properties["SpecificHeat"]) > 0) + self.assertTrue(len(properties["ThermalConductivity"]) > 0) + self.assertTrue(len(properties["ThermalExpansionCoefficient"]) > 0) + self.assertTrue(len(properties["AmbientColor"]) > 0) + self.assertTrue(len(properties["DiffuseColor"]) > 0) + self.assertTrue(len(properties["EmissiveColor"]) > 0) + self.assertTrue(len(properties["Shininess"]) > 0) + self.assertTrue(len(properties["SpecularColor"]) > 0) + self.assertTrue(len(properties["Transparency"]) > 0) + + self.assertEqual(properties["Density"], "7900.00 kg/m^3") + # self.assertEqual(properties["BulkModulus"], "") + self.assertEqual(properties["PoissonRatio"], "0.30000001192092896") + self.assertEqual(properties["YoungsModulus"], "210.00 GPa") + # self.assertEqual(properties["ShearModulus"], "") + self.assertEqual(properties["SpecificHeat"], "590.00 J/kg/K") + self.assertEqual(properties["ThermalConductivity"], "43.00 W/m/K") + self.assertEqual(properties["ThermalExpansionCoefficient"], "12.00 µm/m/K") + self.assertEqual(properties["AmbientColor"], "(0.0020, 0.0020, 0.0020, 1.0)") + self.assertEqual(properties["DiffuseColor"], "(0.0000, 0.0000, 0.0000, 1.0)") + self.assertEqual(properties["EmissiveColor"], "(0.0000, 0.0000, 0.0000, 1.0)") + self.assertEqual(properties["Shininess"], "0.05999999865889549") + self.assertEqual(properties["SpecularColor"], "(0.9800, 0.9800, 0.9800, 1.0)") + self.assertEqual(properties["Transparency"], "0") + + print("Density " + steel.getPhysicalValue("Density").UserString) + # print("BulkModulus " + properties["BulkModulus"]) + print("PoissonRatio %f" % steel.getPhysicalValue("PoissonRatio")) + print("YoungsModulus " + steel.getPhysicalValue("YoungsModulus").UserString) + # print("ShearModulus " + properties["ShearModulus"]) + print("SpecificHeat " + steel.getPhysicalValue("SpecificHeat").UserString) + print("ThermalConductivity " + steel.getPhysicalValue("ThermalConductivity").UserString) + print("ThermalExpansionCoefficient " + steel.getPhysicalValue("ThermalExpansionCoefficient").UserString) + print("AmbientColor " + steel.getAppearanceValue("AmbientColor")) + print("DiffuseColor " + steel.getAppearanceValue("DiffuseColor")) + print("EmissiveColor " + steel.getAppearanceValue("EmissiveColor")) + print("Shininess %f" % steel.getAppearanceValue("Shininess")) + print("SpecularColor " + steel.getAppearanceValue("SpecularColor")) + print("Transparency %f" % steel.getAppearanceValue("Transparency")) + + self.assertAlmostEqual(steel.getPhysicalValue("Density").Value, 7.9e-06) + self.assertAlmostEqual(steel.getPhysicalValue("PoissonRatio"), 0.3) + self.assertAlmostEqual(steel.getPhysicalValue("YoungsModulus").Value, 210000000.0) + self.assertAlmostEqual(steel.getPhysicalValue("SpecificHeat").Value, 590000000.0) + self.assertAlmostEqual(steel.getPhysicalValue("ThermalConductivity").Value, 43000.0) + self.assertAlmostEqual(steel.getPhysicalValue("ThermalExpansionCoefficient").Value, 1.2e-05) + self.assertEqual(steel.getAppearanceValue("AmbientColor"), "(0.0020, 0.0020, 0.0020, 1.0)") + self.assertEqual(steel.getAppearanceValue("DiffuseColor"), "(0.0000, 0.0000, 0.0000, 1.0)") + self.assertEqual(steel.getAppearanceValue("EmissiveColor"), "(0.0000, 0.0000, 0.0000, 1.0)") + self.assertAlmostEqual(steel.getAppearanceValue("Shininess"), 0.06) + self.assertEqual(steel.getAppearanceValue("SpecularColor"), "(0.9800, 0.9800, 0.9800, 1.0)") + self.assertAlmostEqual(steel.getAppearanceValue("Transparency"), 0.0) + + def testMaterialsWithModel(self): + materials = self.MaterialManager.materialsWithModel('f6f9e48c-b116-4e82-ad7f-3659a9219c50') # IsotropicLinearElastic + materialsComplete = self.MaterialManager.materialsWithModelComplete('f6f9e48c-b116-4e82-ad7f-3659a9219c50') # IsotropicLinearElastic + + self.assertTrue(len(materialsComplete) <= len(materials)) # Not all will be complete + + materialsLinearElastic = self.MaterialManager.materialsWithModel('7b561d1d-fb9b-44f6-9da9-56a4f74d7536') # LinearElastic + + # All LinearElastic models should be in IsotropicLinearElastic since it is inherited + self.assertTrue(len(materialsLinearElastic) <= len(materials)) + for mat in materialsLinearElastic: + self.assertIn(mat, materials) + + def testMaterialByPath(self): + steel = self.MaterialManager.getMaterialByPath('StandardMaterial/Metal/Steel/CalculiX-Steel.FCMat', 'System') + self.assertIsNotNone(steel) + self.assertEqual(steel.Name, "CalculiX-Steel") + self.assertEqual(steel.UUID, "92589471-a6cb-4bbc-b748-d425a17dea7d") + + steel2 = self.MaterialManager.getMaterialByPath('/StandardMaterial/Metal/Steel/CalculiX-Steel.FCMat', 'System') + self.assertIsNotNone(steel2) + self.assertEqual(steel2.Name, "CalculiX-Steel") + self.assertEqual(steel2.UUID, "92589471-a6cb-4bbc-b748-d425a17dea7d") + + steel3 = self.MaterialManager.getMaterialByPath('/System/StandardMaterial/Metal/Steel/CalculiX-Steel.FCMat', 'System') + self.assertIsNotNone(steel3) + self.assertEqual(steel3.Name, "CalculiX-Steel") + self.assertEqual(steel3.UUID, "92589471-a6cb-4bbc-b748-d425a17dea7d") diff --git a/src/Mod/Material/importFCMat.py b/src/Mod/Material/importFCMat.py index f53ce996ef..406455b632 100644 --- a/src/Mod/Material/importFCMat.py +++ b/src/Mod/Material/importFCMat.py @@ -30,6 +30,7 @@ import os import FreeCAD from materialtools.cardutils import get_material_template +import Material if FreeCAD.GuiUp: from PySide import QtGui @@ -97,6 +98,10 @@ def decode(name): # as we had and we might will have problems again and again # https://github.com/berndhahnebach/FreeCAD_bhb/commits/materialdev +def read(filename): + materialManager = Material.MaterialManager() + material = materialManager.getMaterialByPath(filename) + return material.Properties # Metainformation # first two lines HAVE, REALLY HAVE to be the same (no comment) in any card file !!!!! @@ -106,7 +111,7 @@ def decode(name): # Line3: information string # Line4: information link # Line5: FreeCAD version info or empty -def read(filename): +def read_old(filename): "reads a FCMat file and returns a dictionary from it" # the reader returns a dictionary in any case even if the file has problems @@ -181,6 +186,105 @@ def read(filename): d[k[0].strip()] = v return d +def read2(filename): + "reads a FCMat file and returns a dictionary from it" + + # the reader returns a dictionary in any case even if the file has problems + # an empty dict is returned in such case + + # print(filename) + card_name_file = os.path.splitext(os.path.basename(filename))[0] + f = pythonopen(filename, encoding="utf8") + try: + content = f.readlines() + # print(len(content)) + # print(type(content)) + # print(content) + except Exception: + # https://forum.freecad.org/viewtopic.php?f=18&t=56912#p489721 + # older FreeCAD do not write utf-8 for special character on windows + # I have seen "ISO-8859-15" or "windows-1252" + # explicit utf-8 writing, https://github.com/FreeCAD/FreeCAD/commit/9a564dd906f + FreeCAD.Console.PrintError("Error on card loading. File might not utf-8.") + error_message = "Error on loading. Material file '{}' might not utf-8.".format(filename) + FreeCAD.Console.PrintError("{}\n".format(error_message)) + if FreeCAD.GuiUp: + QtGui.QMessageBox.critical(None, "Error on card reading", error_message) + return {} + d = {} + d["Meta"] = {} + d["General"] = {} + d["Mechanical"] = {} + d["Fluidic"] = {} + d["Thermal"] = {} + d["Electromagnetic"] = {} + d["Architectural"] = {} + d["Rendering"] = {} + d["VectorRendering"] = {} + d["Cost"] = {} + d["UserDefined"] = {} + d["Meta"]["CardName"] = card_name_file # CardName is the MatCard file name + section = '' + for ln, line in enumerate(content): + # print(line) + # enumerate starts with 0 + + # line numbers are used for CardName and AuthorAndLicense + # the use of line number is not smart for a data model + # a wrong user edit could break the file + + # comment + if line.startswith('#'): + # a '#' is assumed to be a comment which is ignored + continue + # CardName + if line.startswith(';') and ln == 0: + # print("Line CardName: {}".format(line)) + v = line.split(";")[1].strip() # Line 1 + if hasattr(v, "decode"): + v = v.decode('utf-8') + card_name_content = v + if card_name_content != d["Meta"]["CardName"]: + FreeCAD.Console.PrintLog( + "File CardName ( {} ) is not content CardName ( {} )\n" + .format(card_name_file, card_name_content) + ) + + # AuthorAndLicense + elif line.startswith(';') and ln == 1: + # print("Line AuthorAndLicense: {}".format(line)) + v = line.split(";")[1].strip() # Line 2 + if hasattr(v, "decode"): + v = v.decode('utf-8') + d["General"]["AuthorAndLicense"] = v # Move the field to the general group + + # rest + else: + # ; is a Comment + # [ is a Section + if line[0] == '[': + # print("parse section '{0}'".format(line)) + line = line[1:] + # print("\tline '{0}'".format(line)) + k = line.split("]", 1) + if len(k) >= 2: + v = k[0].strip() + if hasattr(v, "decode"): + v = v.decode('utf-8') + section = v + # print("Section '{0}'".format(section)) + elif line[0] not in ";": + # split once on first occurrence + # a link could contain a '=' and thus would be split + k = line.split("=", 1) + if len(k) == 2: + v = k[1].strip() + if hasattr(v, "decode"): + v = v.decode('utf-8') + # print("key '{0}', value '{1}'".format(k[0].strip(), v)) + d[section][k[0].strip()] = v + return d + def write(filename, dictionary, write_group_section=True): "writes the given dictionary to the given file" diff --git a/src/Mod/Material/materialtools/MaterialModels.py b/src/Mod/Material/materialtools/MaterialModels.py new file mode 100644 index 0000000000..c7f5380826 --- /dev/null +++ b/src/Mod/Material/materialtools/MaterialModels.py @@ -0,0 +1,163 @@ +# *************************************************************************** +# * Copyright (c) 2023 David Carter * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Library General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + +__title__ = "material model utilities" +__author__ = "David Carter" +__url__ = "http://www.freecad.org" + +import os +import io +from pathlib import Path +import yaml + +import FreeCAD + + +unicode = str + +__models = {} +__modelsByPath = {} + +def _dereference(parent, child): + # Add the child parameters to the parent + parentModel = parent["model"] + parentBase = parent["base"] + childModel = child["model"] + childBase = child["base"] + for name, value in childModel[childBase].items(): + if name not in ["Name", "UUID", "URL", "Description", "DOI", "Inherits"] and \ + name not in parentModel[parentBase]: # Don't add if it's already there + parentModel[parentBase][name] = value + + print("dereferenced:") + print(parentModel) + +def _dereferenceInheritance(data): + if not data["dereferenced"]: + data["dereferenced"] = True # Prevent recursion loops + + model = data["model"] + base = data["base"] + if "Inherits" in model[base]: + print("Model '{0}' inherits from:".format(data["name"])) + for parent in model[base]["Inherits"]: + print("\t'{0}'".format(parent)) + print("\t\t'{0}'".format(parent.keys())) + print("\t\t'{0}'".format(parent["UUID"])) + + # This requires that all models have already been loaded undereferenced + child = __models[parent["UUID"]] + if child is not None: + _dereference(data, child) + +def _dereferenceAll(): + for data in __models.values(): + _dereferenceInheritance(data) + +def _scanFolder(folder): + print("Scanning folder '{0}'".format(folder.absolute())) + for child in folder.iterdir(): + if child.is_dir(): + _scanFolder(child) + else: + if child.suffix.lower() == ".yml": + data = getModelFromPath(child) + + if data is not None: + __models[data["uuid"]] = data + __modelsByPath[data["path"]] = data + # print(data["model"]) + else: + print("Extension '{0}'".format(child.suffix.lower())) + +def _scanModels(libraries): + __models = {} # Clear the current library + __modelsByPath = {} + print("_scanModels") + print(libraries) + for library in libraries: + _scanFolder(Path(library)) + + # Satisfy aany inheritances + _dereferenceAll() + +def getPreferredSaveDirectory(): + pass + +def getModelLibraries(): + + libraries = [] + + # TODO: Expand beyond the standard models as we do for material paths + path = Path(FreeCAD.getResourceDir()) / "Mod/Material/Resources/Models" + libraries.append(path) + + _scanModels(libraries) + + return libraries + +def getModel(uuid): + """ + Retrieve the specified model. + """ + if len(__models) < 1: + getModelLibraries() + + if uuid not in __models: + return None + return __models[uuid] + +def getModelFromPath(filePath): + """ + Retrieve the model at the specified path. + + This may not need public exposure? + """ + try: + path = Path(filePath) + stream = open(path.absolute(), "r") + model = yaml.safe_load(stream) + + base = "Model" + if "AppearanceModel" in model: + base = "AppearanceModel" + + uuid = model[base]["UUID"] + name = model[base]["Name"] + + data = {} + data["base"] = base + data["name"] = name + data["path"] = path.absolute() + data["uuid"] = uuid + data["model"] = model + data["dereferenced"] = False + return data + except Exception as ex: + print("Unable to load '{0}'".format(path.absolute())) + print(ex) + + return None + +def saveModel(model, path): + """ + Write the model to the specified path + """ \ No newline at end of file diff --git a/src/Mod/Material/materialtools/Tools/ConvertFCMat.py b/src/Mod/Material/materialtools/Tools/ConvertFCMat.py new file mode 100644 index 0000000000..26e85f46ba --- /dev/null +++ b/src/Mod/Material/materialtools/Tools/ConvertFCMat.py @@ -0,0 +1,292 @@ +# *************************************************************************** +# * Copyright (c) 2013 Juergen Riegel * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Library General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + + +__title__ = "FreeCAD material card importer" +__author__ = "Juergen Riegel" +__url__ = "https://www.freecad.org" + + +import os +import glob +import uuid +from pathlib import Path +import xml.etree.ElementTree as ET + +def decode(name): + "decodes encoded strings" + try: + decodedName = (name.decode("utf8")) + except UnicodeDecodeError: + try: + decodedName = (name.decode("latin1")) + except UnicodeDecodeError: + print("Error: Couldn't determine character encoding") + decodedName = name + return decodedName + +def read(filename): + "reads a FCMat file and returns a dictionary from it" + + # the reader returns a dictionary in any case even if the file has problems + # an empty dict is returned in such case + + card_name_file = os.path.splitext(os.path.basename(filename))[0] + f = open(filename, encoding="utf8") + try: + content = f.readlines() + except Exception: + # https://forum.freecad.org/viewtopic.php?f=18&t=56912#p489721 + # older FreeCAD do not write utf-8 for special character on windows + # I have seen "ISO-8859-15" or "windows-1252" + # explicit utf-8 writing, https://github.com/FreeCAD/FreeCAD/commit/9a564dd906f + print("Error on card loading. File might not utf-8.") + error_message = "Error on loading. Material file '{}' might not utf-8.".format(filename) + print("{}\n".format(error_message)) + return {} + d = {} + d["Meta"] = {} + d["General"] = {} + d["Mechanical"] = {} + d["Fluidic"] = {} + d["Thermal"] = {} + d["Electromagnetic"] = {} + d["Architectural"] = {} + d["Rendering"] = {} + d["VectorRendering"] = {} + d["Cost"] = {} + d["UserDefined"] = {} + d["Meta"]["CardName"] = card_name_file # CardName is the MatCard file name + section = '' + for ln, line in enumerate(content): + # line numbers are used for CardName and AuthorAndLicense + # the use of line number is not smart for a data model + # a wrong user edit could break the file + + # comment + if line.startswith('#'): + # a '#' is assumed to be a comment which is ignored + continue + # CardName + if line.startswith(';') and ln == 0: + pass + + # AuthorAndLicense + elif line.startswith(';') and ln == 1: + v = line.split(";")[1].strip() # Line 2 + if hasattr(v, "decode"): + v = v.decode('utf-8') + d["General"]["AuthorAndLicense"] = v # Move the field to the general group + + # rest + else: + # ; is a Comment + # [ is a Section + if line[0] == '[': + line = line[1:] + k = line.split("]", 1) + if len(k) >= 2: + v = k[0].strip() + if hasattr(v, "decode"): + v = v.decode('utf-8') + section = v + elif line[0] not in ";": + # split once on first occurrence + # a link could contain a '=' and thus would be split + k = line.split("=", 1) + if len(k) == 2: + v = k[1].strip() + if hasattr(v, "decode"): + v = v.decode('utf-8') + d[section][k[0].strip()] = v + return d + +def yamGeneral(card): + father = "" + materialStandard = "" + yamModels = "" + yam = "# File created by ConvertFCMat.py\n" + yam += "General:\n" + + # Add UUIDs + yam += ' UUID: "{0}"\n'.format(uuid.uuid4()) + for param in card: + if param in ["Name", "AuthorAndLicense", "Description", "ReferenceSource", "SourceURL"]: + yam += ' {0}: "{1}"\n'.format(param, card[param]) + elif param in ["Father"]: + father += ' {0}: "{1}"\n'.format(param, card[param]) + elif param in ["KindOfMaterial", "MaterialNumber", "Norm", "StandardCode"]: + if param == "Norm": # Handle the name change + materialStandard += ' {0}: "{1}"\n'.format("StandardCode", card[param]) + else: + materialStandard += ' {0}: "{1}"\n'.format(param, card[param]) + + if len(father) > 0: + yamModels += " {0}:\n".format('Father') + yamModels += " UUID: '{0}'\n".format('9cdda8b6-b606-4778-8f13-3934d8668e67') + yamModels += father + if len(materialStandard) > 0: + yamModels += " {0}:\n".format('MaterialStandard') + yamModels += " UUID: '{0}'\n".format('1e2c0088-904a-4537-925f-64064c07d700') + yamModels += materialStandard + + return yam, yamModels + +def yamSection(card, header, uuid): + if len(card) > 0: + yam = " {0}:\n".format(header) + yam += " UUID: '{0}'\n".format(uuid) + for param in card: + yam += ' {0}: "{1}"\n'.format(param, card[param]) + else: + yam = "" + + return yam + +def yamMechanical(card): + # Check which model we need + useDensity = False + useIso = False + useLinearElastic = False + for param in card: + if param in ["Density"]: + useDensity = True + elif param in ["BulkModulus", "PoissonRatio", "ShearModulus", "YoungsModulus"]: + useIso = True + elif param in ["AngleOfFriction", "CompressiveStrength", "FractureToughness", + "UltimateStrain", "UltimateTensileStrength", "YieldStrength", "Stiffness", "Hardness"]: + useLinearElastic = True + + yam = "" + if useLinearElastic: + return yamSection(card, 'LinearElastic', '7b561d1d-fb9b-44f6-9da9-56a4f74d7536') + if useIso: + yam = yamSection(card, 'IsotropicLinearElastic', 'f6f9e48c-b116-4e82-ad7f-3659a9219c50') + if useDensity: + return yam + yamSection(card, 'Density', '454661e5-265b-4320-8e6f-fcf6223ac3af') + + # default mechanical model + return "" + +def yamFluid(card): + # Split out density + for param in card: + if param not in ["Density"]: + return yamSection(card, 'Fluid', '1ae66d8c-1ba1-4211-ad12-b9917573b202') + + return yamSection(card, 'Density', '454661e5-265b-4320-8e6f-fcf6223ac3af') + +def yamThermal(card): + return yamSection(card, 'Thermal', '9959d007-a970-4ea7-bae4-3eb1b8b883c7') + +def yamElectromagnetic(card): + return yamSection(card, 'Electromagnetic', 'b2eb5f48-74b3-4193-9fbb-948674f427f3') + +def yamArchitectural(card): + return yamSection(card, 'Architectural', '32439c3b-262f-4b7b-99a8-f7f44e5894c8') + +def yamCost(card): + return yamSection(card, 'Costs', '881df808-8726-4c2e-be38-688bb6cce466') + +def yamRendering(card): + # Check which model we need + useTexture = False + useAdvanced = False + for param in card: + if param in ["TexturePath", "TextureScaling"]: + useTexture = True + elif param in ["FragmentShader", "VertexShader"]: + useAdvanced = True + + if useAdvanced: + return yamSection(card, 'AdvancedRendering', 'c880f092-cdae-43d6-a24b-55e884aacbbf') + if useTexture: + return yamSection(card, 'TextureRendering', 'bbdcc65b-67ca-489c-bd5c-a36e33d1c160') + + # default rendering model + return yamSection(card, 'BasicRendering', 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e') + +def yamVectorRendering(card): + return yamSection(card, 'VectorRendering', 'fdf5a80e-de50-4157-b2e5-b6e5f88b680e') + +def saveYaml(card, output): + yam, yamModels = yamGeneral(card["General"]) + if len(card["Mechanical"]) > 0 or \ + len(card["Fluidic"]) > 0 or \ + len(card["Thermal"]) > 0 or \ + len(card["Electromagnetic"]) > 0 or \ + len(card["Architectural"]) > 0 or \ + len(card["Cost"]) > 0 or \ + len(yamModels) > 0: + yam += "Models:\n" + yam += yamModels + if "Mechanical" in card: + yam += yamMechanical(card["Mechanical"]) + if "Fluidic" in card: + yam += yamFluid(card["Fluidic"]) + if "Thermal" in card: + yam += yamThermal(card["Thermal"]) + if "Electromagnetic" in card: + yam += yamElectromagnetic(card["Electromagnetic"]) + if "Architectural" in card: + yam += yamArchitectural(card["Architectural"]) + if "Cost" in card: + yam += yamCost(card["Cost"]) + if len(card["Rendering"]) > 0 or len(card["VectorRendering"]) > 0: + yam += "AppearanceModels:\n" + if "Rendering" in card: + yam += yamRendering(card["Rendering"]) + if "VectorRendering" in card: + yam += yamVectorRendering(card["VectorRendering"]) + + file = open(output, "w", encoding="utf-8") + file.write(yam) + file.close() + +def convert(infolder, outfolder): + a_path = infolder + '/**/*.FCMat' + dir_path_list = glob.glob(a_path, recursive=True) + + for a_path in dir_path_list: + p = Path(a_path) + relative = p.relative_to(infolder) + out = Path(outfolder) / relative + print("('{0}', '{1}') -> {2}".format(infolder, relative, out)) + + try: + card = read(p) + except Exception: + print("Error converting card '{0}'. Skipped.") + continue + + out.parent.mkdir(parents=True, exist_ok=True) + saveYaml(card, out) + +import argparse +parser = argparse.ArgumentParser() +parser.add_argument("infolder", help="Input folder containing older material cards") +parser.add_argument("outfolder", help="Output folder to place the converted material cards") +args = parser.parse_args() + +print("Input folder '{0}'".format(args.infolder)) +print("Output folder '{0}'".format(args.outfolder)) + +convert(args.infolder, args.outfolder) \ No newline at end of file diff --git a/src/Mod/Material/materialtools/cardutils.py b/src/Mod/Material/materialtools/cardutils.py index bde7157a20..56dfea0ab5 100644 --- a/src/Mod/Material/materialtools/cardutils.py +++ b/src/Mod/Material/materialtools/cardutils.py @@ -25,19 +25,15 @@ __url__ = "http://www.freecad.org" import os from os.path import join +from pathlib import Path import FreeCAD +import Material unicode = str -# TODO: -# move material GUI preferences from FEM to an own preference tab in Material -# move preference GUI code to material module -# https://forum.freecad.org/viewtopic.php?f=10&t=35515 - - # TODO: # implement method check_material_keys from FEM material task panel for material editor # may be move out of the FEM material task panel to here @@ -62,36 +58,127 @@ this has been done already by eivind see https://forum.freecad.org/viewtopic.php?f=38&t=16714 ''' +def get_material_preferred_directory(category=None): + """ + Return the preferred material directory. In priority order they are: + 1. user specified + 2. user modules folder + 3. system folder + """ + mat_prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Material/Resources") + use_built_in_materials = mat_prefs.GetBool("UseBuiltInMaterials", True) + use_mat_from_config_dir = mat_prefs.GetBool("UseMaterialsFromConfigDir", True) + use_mat_from_custom_dir = mat_prefs.GetBool("UseMaterialsFromCustomDir", True) + + preferred = None + + if use_built_in_materials: + if category == 'Fluid': + preferred = join( + FreeCAD.getResourceDir(), "Mod", "Material", "Resources", "Materials", "FluidMaterial" + ) + + elif category == 'Solid': + preferred = join( + FreeCAD.getResourceDir(), "Mod", "Material", "Resources", "Materials", "StandardMaterial" + ) + + else: + preferred = join( + FreeCAD.getResourceDir(), "Mod", "Material" + ) + + if use_mat_from_config_dir: + user = join( + FreeCAD.ConfigGet("UserAppData"), "Material" + ) + if os.path.isdir(user): + preferred = user + + if use_mat_from_custom_dir: + custom = mat_prefs.GetString("CustomMaterialsDir", "") + if len(custom.strip()) > 0: + preferred = custom + + return preferred + +def get_material_preferred_save_directory(): + """ + Return the preferred directory for saving materials. In priority order they are: + 1. user specified + 2. user modules folder + """ + mat_prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Material/Resources") + use_mat_from_config_dir = mat_prefs.GetBool("UseMaterialsFromConfigDir", True) + use_mat_from_custom_dir = mat_prefs.GetBool("UseMaterialsFromCustomDir", True) + + if use_mat_from_custom_dir: + custom = mat_prefs.GetString("CustomMaterialsDir", "") + if len(custom.strip()) > 0: + # Create the directory if it doesn't exist + try: + if not os.path.isdir(custom): + os.makedirs(custom) + return custom + except Exception as ex: + print(ex) + pass + + if use_mat_from_config_dir: + user = join( + FreeCAD.ConfigGet("UserAppData"), "Material" + ) + try: + if not os.path.isdir(user): + os.makedirs(user) + return user + except Exception as ex: + print(ex) + pass + + + return "" + # ***** get resources for cards ****************************************************************** def get_material_resources(category='Solid'): resources = {} # { resource_path: icon_path, ... } - # TODO: move GUI preferences from FEM to a new side tab Material - # https://forum.freecad.org/viewtopic.php?f=10&t=35515 mat_prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Material/Resources") use_built_in_materials = mat_prefs.GetBool("UseBuiltInMaterials", True) + use_mat_from_modules = mat_prefs.GetBool("UseMaterialsFromWorkbenches", True) use_mat_from_config_dir = mat_prefs.GetBool("UseMaterialsFromConfigDir", True) use_mat_from_custom_dir = mat_prefs.GetBool("UseMaterialsFromCustomDir", True) if use_built_in_materials: if category == 'Fluid': builtin_mat_dir = join( - FreeCAD.getResourceDir(), "Mod", "Material", "FluidMaterial" + FreeCAD.getResourceDir(), "Mod", "Material", "Resources", "Materials", "FluidMaterial" ) else: builtin_mat_dir = join( - FreeCAD.getResourceDir(), "Mod", "Material", "StandardMaterial" + FreeCAD.getResourceDir(), "Mod", "Material", "Resources", "Materials", "StandardMaterial" ) resources[builtin_mat_dir] = ":/icons/freecad.svg" + if use_mat_from_modules: + module_prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Material/Resources/Modules") + module_groups = module_prefs.GetGroups() + for group in module_groups: + module = module_prefs.GetGroup(group) + module_mat_dir = module.GetString("ModuleDir", "") + module_icon_dir = module.GetString("ModuleIcon", "") + if len(module_mat_dir) > 0: + resources[module_mat_dir] = module_icon_dir + if use_mat_from_config_dir: config_mat_dir = join( FreeCAD.ConfigGet("UserAppData"), "Material" ) - resources[config_mat_dir] = ":/icons/preferences-general.svg" + if os.path.exists(config_mat_dir): + resources[config_mat_dir] = ":/icons/preferences-general.svg" if use_mat_from_custom_dir: custom_mat_dir = mat_prefs.GetString("CustomMaterialsDir", "") @@ -106,6 +193,62 @@ def get_material_resources(category='Solid'): return resources +def get_material_libraries(): + + resources = {} # { resource_path: icon_path, ... } + + mat_prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Material/Resources") + use_built_in_materials = mat_prefs.GetBool("UseBuiltInMaterials", True) + use_mat_from_modules = mat_prefs.GetBool("UseMaterialsFromWorkbenches", True) + use_mat_from_config_dir = mat_prefs.GetBool("UseMaterialsFromConfigDir", True) + use_mat_from_custom_dir = mat_prefs.GetBool("UseMaterialsFromCustomDir", True) + + if use_built_in_materials: + builtin_mat_dir = join( + FreeCAD.getResourceDir(), "Mod", "Material", "Resources", "Materials" + ) + resources["System"] = (builtin_mat_dir, ":/icons/freecad.svg") + + if use_mat_from_modules: + module_prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Material/Resources/Modules") + module_groups = module_prefs.GetGroups() + for group in module_groups: + print("\tGroup - {0}".format(group)) + module = module_prefs.GetGroup(group) + module_mat_dir = module.GetString("ModuleDir", "") + module_icon = module.GetString("ModuleIcon", "") + if len(module_mat_dir) > 0: + resources[group] = (module_mat_dir, module_icon) + + if use_mat_from_config_dir: + config_mat_dir = join( + FreeCAD.ConfigGet("UserAppData"), "Material" + ) + if os.path.exists(config_mat_dir): + resources["User"] = (config_mat_dir, ":/icons/preferences-general.svg") + + if use_mat_from_custom_dir: + custom_mat_dir = mat_prefs.GetString("CustomMaterialsDir", "") + if os.path.exists(custom_mat_dir): + resources["Custom"] = (custom_mat_dir, ":/icons/user.svg") + + return resources + + +def list_cards(mat_dir, icon): + import glob + a_path = mat_dir + '/**/*.FCMat' + print("path = '{0}'".format(a_path)) + dir_path_list = glob.glob(a_path, recursive=True) + # Need to handle duplicates + + cards = [] + for a_path in dir_path_list: + p = Path(a_path) + relative = p.relative_to(mat_dir) + cards.append(relative) + + return cards def output_resources(resources): FreeCAD.Console.PrintMessage('Directories in which we will look for material cards:\n') @@ -117,24 +260,27 @@ def output_resources(resources): # used in material editor and FEM material task panels def import_materials(category='Solid', template=False): - - resources = get_material_resources(category) - + materialManager = Material.MaterialManager() + mats = materialManager.Materials materials = {} cards = {} icons = {} - for path in resources.keys(): - materials, cards, icons = add_cards_from_a_dir( - materials, - cards, - icons, - path, - resources[path] - ) + for matUUID in mats: + mat = materialManager.getMaterial(matUUID) + physicalModels = mat.PhysicalModels + fluid = ('1ae66d8c-1ba1-4211-ad12-b9917573b202' in physicalModels) + if not fluid: + path = mat.LibraryRoot + "/" + mat.Directory + print(path) + materials[path] = mat.Properties + cards[path] = mat.Name + icons[path] = mat.LibraryIcon + + print(path) + print(mat.Properties) return (materials, cards, icons) - def add_cards_from_a_dir(materials, cards, icons, mat_dir, icon, template=False): # fill materials and icons import glob @@ -220,6 +366,8 @@ def get_material_template(withSpaces=False): # https://www.freecad.org/wiki/Material_data_model # https://www.freecad.org/wiki/Material + print("Call to get_material_template() successful") + import yaml template_data = yaml.safe_load( open(join(FreeCAD.ConfigGet('AppHomePath'), 'Mod/Material/Templatematerial.yml')) @@ -247,7 +395,7 @@ def get_material_template(withSpaces=False): def create_mat_tools_header(): headers = join(get_source_path(), 'src/Mod/Material/StandardMaterial/Tools/headers') - print(headers) + # print(headers) if not os.path.isfile(headers): FreeCAD.Console.PrintError( 'file not found: {}'.format(headers) @@ -431,7 +579,7 @@ def write_cards_to_path(cards_path, cards_data, write_group_section=True, write_ continue else: card_path = join(cards_path, (card_data['CardName'] + '.FCMat')) - print(card_path) + # print(card_path) if write_group_section is True: write(card_path, card_data, True) else: diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 9dd3de88f0..7cb488ecd4 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -2,9 +2,9 @@ if(MSVC) add_compile_options(/wd4251) option( - gtest_force_shared_crt - "Use shared (DLL) run-time lib even when Google Test is built as static lib." - ON) + gtest_force_shared_crt + "Use shared (DLL) run-time lib even when Google Test is built as static lib." + ON) set(Google_Tests_LIBS oldnames.lib @@ -14,8 +14,8 @@ if(MSVC) optimized msvcprt.lib ) - #Universal C runtime introduced in VS 2015 (cl version 19) - if (NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19")) + # Universal C runtime introduced in VS 2015 (cl version 19) + if(NOT(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19")) list(APPEND Google_Tests_LIBS debug vcruntimed.lib debug ucrtd.lib @@ -40,32 +40,35 @@ endif() set(CMAKE_AUTOMOC ON) function(setup_qt_test) - foreach (_testname ${ARGN}) + foreach(_testname ${ARGN}) add_executable(${_testname}_Tests_run ${_testname}.cpp) add_test(NAME ${_testname}_Tests_run COMMAND ${_testname}_Tests_run) - if (NOT BUILD_DYNAMIC_LINK_PYTHON) + + if(NOT BUILD_DYNAMIC_LINK_PYTHON) list(APPEND ${_testname}_LIBS - ${PYTHON_LIBRARIES} - ) - endif () + ${PYTHON_LIBRARIES} + ) + endif() + target_include_directories(${_testname}_Tests_run PUBLIC - ${Python3_INCLUDE_DIRS} - ${XercesC_INCLUDE_DIRS} - ${QtGui_INCLUDE_DIRS} - ${QtWidgets_INCLUDE_DIRS} - ${QtTest_INCLUDE_DIRS} - ${COIN3D_INCLUDE_DIRS}) + ${Python3_INCLUDE_DIRS} + ${XercesC_INCLUDE_DIRS} + ${QtGui_INCLUDE_DIRS} + ${QtWidgets_INCLUDE_DIRS} + ${QtTest_INCLUDE_DIRS} + ${COIN3D_INCLUDE_DIRS}) target_link_libraries(${_testname}_Tests_run - FreeCADApp - FreeCADGui - ${QtCore_LIBRARIES} - ${QtWidgets_LIBRARIES} - ${QtTest_LIBRARIES} - ${${_testname}_LIBS}) - endforeach () + FreeCADApp + FreeCADGui + ${QtCore_LIBRARIES} + ${QtWidgets_LIBRARIES} + ${QtTest_LIBRARIES} + ${${_testname}_LIBS}) + endforeach() endfunction() add_executable(Tests_run) +add_executable(Material_tests_run) add_executable(Mesh_tests_run) add_executable(Part_tests_run) add_executable(Points_tests_run) @@ -82,4 +85,3 @@ target_link_libraries(Tests_run ${Google_Tests_LIBS} FreeCADApp ) - diff --git a/tests/src/Mod/CMakeLists.txt b/tests/src/Mod/CMakeLists.txt index 3b172b15a3..0d12ca7606 100644 --- a/tests/src/Mod/CMakeLists.txt +++ b/tests/src/Mod/CMakeLists.txt @@ -1,3 +1,4 @@ +add_subdirectory(Material) add_subdirectory(Mesh) add_subdirectory(Part) add_subdirectory(Points) diff --git a/tests/src/Mod/Material/App/CMakeLists.txt b/tests/src/Mod/Material/App/CMakeLists.txt new file mode 100644 index 0000000000..879f74ef06 --- /dev/null +++ b/tests/src/Mod/Material/App/CMakeLists.txt @@ -0,0 +1,6 @@ + +target_sources( + Material_tests_run + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/Model.cpp +) diff --git a/tests/src/Mod/Material/App/Model.cpp b/tests/src/Mod/Material/App/Model.cpp new file mode 100644 index 0000000000..e77102f6db --- /dev/null +++ b/tests/src/Mod/Material/App/Model.cpp @@ -0,0 +1,125 @@ +// SPDX-License-Identifier: LGPL-2.1-or-later + +#include "gtest/gtest.h" + +#include +#ifndef _PreComp_ +#endif + +#include + +#include + +#include +#include +#include + +// clang-format off + +class MaterialTest : public ::testing::Test { + protected: + static void SetUpTestSuite() { + if (App::Application::GetARGC() == 0) { + constexpr int argc = 1; + std::array argv {"FreeCAD"}; + App::Application::Config()["ExeName"] = "FreeCAD"; + App::Application::init(argc, argv.data()); + } + } + + void SetUp() override { + _modelManager = new Materials::ModelManager(); + _materialManager = new Materials::MaterialManager(); + } + + // void TearDown() override {} + Materials::ModelManager* _modelManager; + Materials::MaterialManager* _materialManager; +}; + +TEST_F(MaterialTest, TestApplication) +{ + App::Application& application = App::GetApplication(); + if (&application == nullptr) + ADD_FAILURE() << "Application failure\n"; + + SUCCEED(); +} + +TEST_F(MaterialTest, TestResources) +{ + try { + auto param = App::GetApplication().GetParameterGroupByPath( + "User parameter:BaseApp/Preferences/Mod/Material/Resources"); + EXPECT_NE(param, nullptr); + } + catch (const std::exception &e) + { + FAIL() << "Exception: " << e.what() << "\n"; + } +} + +TEST_F(MaterialTest, TestModelLoad) +{ + EXPECT_NE(_modelManager, nullptr); + + auto density = _modelManager->getModel(QString::fromStdString("454661e5-265b-4320-8e6f-fcf6223ac3af")); + EXPECT_EQ(density.getName(), QString::fromStdString("Density")); + EXPECT_EQ(density.getUUID(), QString::fromStdString("454661e5-265b-4320-8e6f-fcf6223ac3af")); + + auto& prop = density[QString::fromStdString("Density")]; + EXPECT_EQ(prop.getName(), QString::fromStdString("Density")); +} + +TEST_F(MaterialTest, TestMaterialsWithModel) +{ + auto materials = _materialManager->materialsWithModel( + QString::fromStdString("f6f9e48c-b116-4e82-ad7f-3659a9219c50")); // IsotropicLinearElastic + EXPECT_GT(materials->size(), 0); + + auto materialsComplete = _materialManager->materialsWithModelComplete( + QString::fromStdString("f6f9e48c-b116-4e82-ad7f-3659a9219c50")); // IsotropicLinearElastic + EXPECT_LE(materialsComplete->size(), materials->size()); + + auto materialsLinearElastic = _materialManager->materialsWithModel( + QString::fromStdString("7b561d1d-fb9b-44f6-9da9-56a4f74d7536")); // LinearElastic + + // All LinearElastic models should be in IsotropicLinearElastic since it is inherited + EXPECT_LE(materialsLinearElastic->size(), materials->size()); + for (auto itp = materialsLinearElastic->begin(); itp != materialsLinearElastic->end(); itp++) { + auto mat = itp->first; + EXPECT_NO_THROW(materials->at(mat)); + } + + delete materials; + delete materialsComplete; + delete materialsLinearElastic; +} + +TEST_F(MaterialTest, testMaterialByPath) +{ + auto& steel = _materialManager->getMaterialByPath( + QString::fromStdString("StandardMaterial/Metal/Steel/CalculiX-Steel.FCMat"), + QString::fromStdString("System")); + EXPECT_NE(&steel, nullptr); + EXPECT_EQ(steel.getName(), QString::fromStdString("CalculiX-Steel")); + EXPECT_EQ(steel.getUUID(), QString::fromStdString("92589471-a6cb-4bbc-b748-d425a17dea7d")); + + // The same but with a leading '/' + auto& steel2 = _materialManager->getMaterialByPath( + QString::fromStdString("/System/StandardMaterial/Metal/Steel/CalculiX-Steel.FCMat"), + QString::fromStdString("System")); + EXPECT_NE(&steel2, nullptr); + EXPECT_EQ(steel2.getName(), QString::fromStdString("CalculiX-Steel")); + EXPECT_EQ(steel2.getUUID(), QString::fromStdString("92589471-a6cb-4bbc-b748-d425a17dea7d")); + + // Same with the library name as a prefix + auto& steel3 = _materialManager->getMaterialByPath( + QString::fromStdString("StandardMaterial/Metal/Steel/CalculiX-Steel.FCMat"), + QString::fromStdString("System")); + EXPECT_NE(&steel3, nullptr); + EXPECT_EQ(steel3.getName(), QString::fromStdString("CalculiX-Steel")); + EXPECT_EQ(steel3.getUUID(), QString::fromStdString("92589471-a6cb-4bbc-b748-d425a17dea7d")); +} + +// clang-format on diff --git a/tests/src/Mod/Material/CMakeLists.txt b/tests/src/Mod/Material/CMakeLists.txt new file mode 100644 index 0000000000..ff798efcb3 --- /dev/null +++ b/tests/src/Mod/Material/CMakeLists.txt @@ -0,0 +1,15 @@ + +target_include_directories(Material_tests_run PUBLIC + ${EIGEN3_INCLUDE_DIR} + ${OCC_INCLUDE_DIR} + ${Python3_INCLUDE_DIRS} + ${XercesC_INCLUDE_DIRS} +) + +target_link_libraries(Material_tests_run + gtest_main + ${Google_Tests_LIBS} + Material +) + +add_subdirectory(App)