Commit Graph

82 Commits

Author SHA1 Message Date
David Carter
4dcd810ac5 Material: Material Preferences
Updates the material preferences including selecting a default material

Preferences adds some options for what gets displayed in the Materials editor.
The option to use the legacy editor is removed in favour of the new
editor.

A new preference page has been added that allows the user to select a
default material. This will then be assigned to any newly created object. In
support of this, a new widget PrefsMaterialTreeWidget has been added as an
extension of the MaterialTreeWidget to automatically save and restore the
selected material.
2024-05-13 11:14:55 -05:00
wwmayer
dd9da969e9 PySide6: Fixes #13533: QSvgWidget is not a child of QtSvg in PySide6 (#13554)
* Create a compatibility module QtSvgWidgets.py to handle PySide2 & PySide6
* In the Arch and Material modules use the QtSvgWidgets module
* Since Qt6 the method QFont.setWeight() doesn't accept an int any more but requires an enum. Since the call of QFont.setBold(True) sets
  a weight of 75 the extra calls of QFont.setWeight(75) can be safely removed

Co-authored-by: Adrián Insaurralde Avalos <36372335+adrianinsaval@users.noreply.github.com>
2024-04-22 18:35:33 -04:00
David Carter
ba20441935 Material: Material appearance
Uses new material system for appearance

Each feature object now has a property called ShapeMaterial that
describes its physical properties. If it has a shape, it has a
material.

The ShapeColor attribute is replaced by a ShapeAppearance attribute.
This is a material list that describes all appearance properties, not
just diffuse color. As a list in can be used for all elements of a
shape, such as edges and faces.

A new widget is provided to allow the user to select materials in a
consistent fashion. It can also launch the material editor with its
more advanced capabilities.
2024-04-04 07:39:58 -05:00
David Carter
2a60613257 Material: Material editor enhancements
Improves compatibility when using the legacy editor.

Corrects a number of issues that prevented saved files from being displayed when using the legacy editor.

Reduces the verbosity of console messages.
2024-02-05 08:46:04 -06:00
DeflateAwning
1e3179e9bc Find and replace http://freecad.org to https://freecad.org
Find and replace:
http:\/\/(.{0,10})freecad
https://$1freecad
Done in all remaining files (after doing it in SVGs in the last commit)
2023-10-29 22:39:22 -06:00
David Carter
902af79514 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.
2023-09-25 11:04:01 -04:00
Roy-043
85c2c973d8 Material: Avoid dictionary.keys() where possible 2023-08-10 00:59:02 +02:00
luzpaz
38a01939e0 Migrate domain name from freecadweb to freecad (#9352)
* Migrate domain name from freecadweb to freecad
* Migrate src/Mod/Material files
* Migrate Stylesheet related files
* Migrate *.svg files
* Migrate miscellaneous files
* Migrate some build files
* Migrate recently added TD AR_IRAM template files

Closes #6415
2023-04-24 15:19:20 -05:00
wmayer
351a25681a Material: fix icon path 2023-03-27 11:27:32 +02:00
luzpaz
9df1f9f8f5 [Material] fix grammar 2023-02-25 09:59:24 +01:00
Uwe
688e42df89 [Material] remove unused Help button in editor dialog 2023-02-24 03:47:19 +01:00
Uwe
04695d9c4c [Material] fix major bug of wrong decimals
This PR fixes the long-standing major bug that for languages using ',' as decimal separator the material editor was useless. (bug no. 10 in https://forum.freecad.org/viewtopic.php?t=56912)
  the issue was that the value was handled as text. This PR:
- using a spinbox instead if a text edit to modify numbers (has also the advantage to be able to change values by spinning)
- sets min/max properly for all number data types

- also avoid rounding artifacts when changing Float values
2023-02-23 03:06:44 +01:00
Uwe
6a689e3e97 [Material] fix bugs for external material files
- handle case that material cards are chosen from folders outside of the standard material folders

- also reduce singleStep size for spin edits for more convenience
2023-02-22 05:25:06 +01:00
Uwe
e1e65e5b3a [Material] fix card selection bug
- fixes bug number 7 of this list: https://forum.freecad.org/viewtopic.php?style=5&p=489666#p489666

- also fix warning about too short variable name
2023-02-19 07:46:52 +01:00
Uwe
51a3428276 [FEM] fix material handling of fluids
- the material editor failed for Fluid materials because this info was not passed to it. Instead always solid materials were loaded.

- also fix warning about too long variable name and remove unnecessary debug code
2023-02-19 02:57:12 +01:00
Uwe
c19efe0842 [Material] fix bugs with missing icons
- at the moment you get several warnings about missing icons when starting the Material editor
  The reason is that they are not registered in CMake

- also remove icon from Material icon editor. As it is a child of FreeCAD it should have the same FreeCAD icon as all other FreeCAD widgets.

- also fix warning about too short variable name
2023-02-19 00:47:44 +01:00
Uwe
b104dba959 [Material] editor: improve float input
- it is very annoying to get a dozen decimals on editing floats. 6 do the job for all cases and a spinBox is preferred.
2023-02-11 04:14:30 +01:00
Uwe
a2ffadcb59 [FEM] use magnetization constraint for 2D
- uses the constraint for 2D magnetodynamics to perform e.g. Elmer's tutorial non. 15

- modify the Material manager to get rid of magnetization but keep the vectorial functionality because in future there will be support for e.g. birefringence materials etc.
2023-02-09 15:43:42 +01:00
Uwe
7c4a3c160c [Material] allow to use vectorial properties
- for electromagnetics we have vector fields and thus need to specify components
- as first step use the new material "Magnetization"

- also get rid of annoying debug messages output on normal use in the material dialog
2023-02-09 07:26:22 +01:00
Uwe
4a030cd949 [FEM] remove unneeded checks for Python 3
since we only support Python >=3, these checks can go
2022-07-31 15:36:54 +02:00
Uwe
d81fe59c2e [FEM] remove checks for Python 2 2022-07-27 14:09:23 +02:00
luz paz
4d21ffa904 Fix various typos 2021-07-31 09:46:50 +02:00
Bernd Hahnebach
01c5c1a63c Material editor: add some comments 2021-07-15 09:20:31 +02:00
Bernd Hahnebach
70c8ff15ba Material Editor, code formating 2021-07-15 08:34:51 +02:00
Bernd Hahnebach
29ec98df8d Material, workaround for precision problem 2021-07-15 08:34:49 +02:00
Bernd Hahnebach
323f323864 Material: comments 2021-07-15 00:09:58 +02:00
Bernd Hahnebach
f6978f419e Material: pep8 code formating 2020-11-18 08:15:50 +01:00
Bernd Hahnebach
94905acf05 Material: fix open material editor with empty material, regression was added with commit 66d2688 2020-11-09 19:29:55 +01:00
Yorik van Havre
cb245845c5 Material: Mateiral editor UI fixes
- Fixed color buttons
- Introduced "Section Color" property
- Fixed named properties
- Added preview icons
- Remember UI dimensions and expanded states
2020-10-27 19:16:58 +01:00
Dietmar Czekay
21f75b6ed4 change "User defined" to "UserDefined"
changed "User defined" in src/Mod/Material/Templatematerial.yml and
src/Mod/Material/MaterialEditor.py
2019-09-04 11:29:09 -03:00
luz.paz
c2827611be [Crowdin] string fix + misc. typo and whitespace fixes
* Crowdin link: https://crowdin.com/translate/freecad/6766/en-hu#6576162  
* Tacked on a few typo+whitespace fixes
2019-06-20 18:42:09 +02:00
Bernd Hahnebach
d30c3fb1a0 Materials: editor, improve comments 2019-06-05 21:49:16 +02:00
Bernd Hahnebach
8827187935 Material: editor, allow duplicate card names and other improvements 2019-04-25 20:43:07 +02:00
Bernd Hahnebach
f69537ed30 Material: mat card template for material editor, move to a much more pythonic one 2019-04-25 20:43:07 +02:00
Bernd Hahnebach
eb21144c4b Material: card utils, move card methods from material editor to card utils module
- isolate card tools for further use in other modules
- possible use of card tools in cmd mode
- add some methods for better card handling
- add some output methods for better card debuging
- editor, better names for methods
- add preference to sort cards and add duplicate cards too
- use icon in mat editor card combo box
2019-04-25 20:43:06 +02:00
Bernd Hahnebach
d0bee305e9 Material: editor, add author 2019-04-25 20:43:06 +02:00
Bernd Hahnebach
d6582737a7 Material, editor and main module, code formating 2019-04-23 09:13:16 +02:00
Bernd Hahnebach
ac71d82dd4 Material: editor, code formating, line length, prints, add some comments 2019-04-23 09:13:04 +02:00
Bernd Hahnebach
4cb913d12c Material and FEM: card reader and writer, make sure to import the same in all modules 2019-04-23 09:13:02 +02:00
Bernd Hahnebach
7f5094231e Material: editor, sort cards in combo box 2019-04-23 09:13:00 +02:00
Bernd Hahnebach
c2e45cd4a9 Material: editor code formating, white space and remove new lines 2019-03-05 13:43:20 +01:00
Bernd Hahnebach
212458a8ea Material: editor, sort cards in combo box 2019-02-21 13:51:43 +01:00
Bernd Hahnebach
a53ffb729c Material: editor, some comments 2019-02-21 13:51:43 +01:00
wmayer
5873d9651e fixes 0003825: file location not stored when opening/saving materials 2019-02-16 22:53:54 +01:00
Bernd Hahnebach
04fbd8f6e6 Material: editor, white spaces 2019-02-15 19:02:43 +01:00
Bernd Hahnebach
f3d652fbea Material: editor, get rid of duplicate unit definition
- in mat editor xml file and in FreeCAD unit system
- remove it from material editor xml file and get it from FreeCAD unit system
2019-02-14 21:11:23 +01:00
Yorik van Havre
671addb4cd Material: Provisorily hide preview fields while mat preview is not implemented 2019-02-14 10:49:24 -02:00
Bernd Hahnebach
0bfcc2872a Material: code formating, flake8 2019-01-05 12:17:52 +01:00
Bernd Hahnebach
8166145d0c Material: code formating, file beginnings Python block comment with space, flake8 E265 2019-01-05 12:17:52 +01:00
Yorik van Havre
0970989adf Material: Fixed py3/import issues 2018-12-29 14:40:25 -02:00