Commit Graph

40 Commits

Author SHA1 Message Date
David Carter
d9017bcca3 Material: Material editor enhancements (#11764)
Continues the work of the material subsystem improvements.

Add support for embedded SVG files. These are not the same
as image files so need to be handled differently.

Add the ability to filter materials in the editor when called from
code. This allows programs to select objects supporting specific
models, complete models, older models, etc.

Updated tests, and refactored code.

New models and materials supporting patterns such as used by the
TechDraw workbench.

fixes #11686 - checks for the presense of a model property before
assinging a value. This can happen when a required model definition is
not available.

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-01-06 18:11:53 -06:00
David Carter
3dd6a67804 Material: Material editor enhancements
Continues the work of the material subsystem improvements.

This merge covers the continued development of the material editor. The
primary improvements are the addition of new data types, a new
appearance preview UI, and changes in the array data types.

New data types were added to support more advanced workflows, such as
the Render Workbench.The Image datatype allows the material to embed
the image in the card instead of pointing to an image in an external
file. Multi-buyte strings span multiple lines as the name implies.
It preserves formatting accross those lines. Also several list types
are now supported, with the primary difference being the editors.
List is a list of strings, FileList is a list of file path names, and
ImageList is a list of embedded images.

For the appearance preview, the UI now uses the same Coin library as
is used in the documents, meaning the preview will look exactly the
same as the material will be shown in the documents.

The array data types are now more complete. The default value wasn't
being used as originially envisioned and was tehrefore removed. For
3D arrays, the Python API was implemented.

There were a lot of code clean ups. This involved removing logging
statements used for debugging during development, reduction of lint
warnings, and code refactoring.

The editor can automatically convert from previous format files to the
current format. This has been extended to material files generated by
the Render WB. Old format files are displayed in the editor with a
warning icon. Selecting one will require saving the file in the new
format before it can be used.
2023-12-06 08:48:34 -06:00
David Carter
332bf7ed08 Material: Continued Material enahncements
Continues the work of the material subsystem improvements.

Several important items are included in this merge. In terms of new
capabilities, this merge adds List and MultiLineString as valid
property types, complete with editing dialogs. This will help with
backwards compatibility for external workbenches, such as Render.

Stability has been a big focus. New unit tests help to verify features
work as expected. Bugs have been fixed and crashes avoided.

Material cards have had a renaming to their tree structure. For
example, 'StandardMeterials' is redundant, so this was renamed to
'Standard'. The cards themselves are more compliant fully passing the
yamllint tests.

More soon.
2023-11-20 12:19:29 -06:00
wmayer
ec0d9774fd Material: use get_filename_component() instead of cmake_path() to support older CMake versions 2023-11-03 16:41:11 +01:00
David Carter
d1e96a5195 Material: Material editor enhancements
Continues the work of the material subsystem improvements.

This merge covers the continued development of the material editor. The
primary improvements are in the handling of 2D and 3D array properties.
These properties are now fully editable, and can be saved and restored.

The cards now separate the author and license. These were previously
saved as a single item. Future support will be provided for standard
open source licenses.

Saving operations validate the cards to ensure UUIDs of materials are
considered. Warnings are given when a save could potentially impact the
models, such as saving over a material instead of creating a new
instance.

The editor is still not complete. There are a number of functional
elements, such as drag/drop operations, folder creation, and deletion
operations that need to be added to the main tree. State needs to be
saved and restored to improve the user experience. The appearance
preview also needs significant work. This will be handled in a future
PR.
2023-10-24 12:36:36 -04:00
wmayer
fa3c0418c3 Material: use get_filename_component() instead of cmake_path() to support older CMake versions 2023-09-29 07:32:58 -05: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
Uwe
7eb560bdab [Material] add new card to CMake 2023-02-26 04:21:32 +01:00
luzpaz
72166fed46 Fix misc. typos and whitespace 2023-02-22 23:46:18 +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
f942353ef3 [Material] new card for Iron 2023-02-09 06:25:43 +01:00
Uwe
a7e02a48fa [Material] add new card for carbon dioxide 2023-02-03 02:37:27 +01:00
luzpaz
79e150a81b Fix trailing whitespace, typos, headers
Fix trailing whitespace, typos, and header uniformity.
2023-01-23 00:34:37 +01:00
Uwe
388dab1cf2 [Material] add materials used by our examples
- add generic copper and invar
- also extend the generic aluminum card
2022-08-10 02:08:35 +02:00
Uwe
bb5c445848 [FEM] add generic Aluminum material
- with full thermal info
2022-07-26 03:20:27 +02:00
donovaly
40eb30ce8c [FEM] add a Graphite material card 2021-03-28 10:56:13 +02:00
donovaly
e001b133a9 [FEM] add missing material cards to CMakeLists.txt
This fixes issue 1. reported here: https://forum.freecadweb.org/viewtopic.php?f=18&t=56912#p489666
2021-03-24 17:02:06 +01:00
donovaly
3e25e6cc1f [FEM] add material cards for gases
also add electrical conductivity for air and water
2021-03-22 10:15:20 +01:00
Xia, Qingfeng
555f07a1dc Material: update fluid material and correct 2 value errors 2020-02-04 21:20:40 +01: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
4f3bcf05b9 Material: card utils, add new module 2019-04-25 20:43:06 +02:00
Bernd Hahnebach
c7531ec6cf Material: cards, some fixes in generic cards 2019-02-21 21:53:04 +01:00
Bernd Hahnebach
d2557c66bd Material: cmake, add the new generic cards 2019-02-21 13:51:44 +01:00
caceres
7be816033a Material: MaterialEditor migrate to model/view 2018-12-29 12:47:30 -02:00
wmayer
8088aa159f CMake 2.8.12 and lower allowed the SOURCE signature in add_custom_command
In CMake 3.0 the policy CMP0050 was introduced where it could be set to OLD to keep this behaviour while for NEW an error was raised.
Since CMake 3.5.2 a warning comes up when using the OLD behaviour and that it will be removed in a future version.

In FreeCAD we switched to the new behaviour now and removed the SOURCE signature from add_custom_command which affects the macros
fc_copy_sources, fc_target_copy_resource and fc_target_copy_resource_flat and their usage.
It's not possible any more to add files to a target by using the macros. Now a file must be added to the target before using the macros.

This commit fixes it for Arch, Draft, OpenSCAD, Material, Plot and Ship
2018-08-20 11:47:39 +02:00
qingfengxia
3c8e0355d8 Fem: add air and water fluid material into data/Mod/Material 2017-01-19 00:08:02 +00:00
Ian Rees
0a70ce4eef Add cmake checks for BUILD_GUI to some modules 2016-02-13 13:45:27 +13:00
Bernd Hahnebach
5c7905742a FEM: small changes in CalculiX standard steel material 2016-02-02 07:18:47 +01:00
Yorik van Havre
3d53b383b4 Material: Fixed bug in cmake file from commit 6685ae0 2015-04-12 19:21:32 -03:00
Przemo Firszt
ef7dcd4a80 FEM: Add "None" and simplify material setting
The "-->choose Material" has been replaced with a not defined material.
That makes setting/retrieving material to/from the object much easier
and allows user to have a "not defined" material. Previously it wasn't
possible to change i.e. form Steel to "not defined".

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:06 +02:00
Bernd Hahnebach
075663b5e7 make main material cards to work correctly with FemWB 2015-02-26 21:25:59 +01:00
Sebastian Hoogen
27cd61f849 Build python Qt resource files at compile time
fixes #1888
2015-01-02 11:14:07 +01:00
wmayer
c68b8ab9b2 + avoid to build Material target all the time 2014-04-07 12:01:55 +02:00
wmayer
b87f75162d + Copy material editor UI file 2014-01-07 10:41:37 +01:00
jriegel
c5978fa32a add SCL python files 2014-01-05 22:31:15 +01:00
jriegel
0b1dc89b01 group for Material project 2013-12-30 19:03:40 +01:00
Yorik van Havre
348329b7b9 Material: Created material editor
Materal editor is now funcional, abeit not complete. Can be used to
create and save new cards. Lauch from within FreeCAD with
import MaterialEditor; MaterialEditor.openEditor()
2013-11-19 19:27:15 -02:00
wmayer
9d72a26d23 Fix Material target 2013-09-09 13:48:39 +02:00
jriegel
a495693c9d Update Fem workbench
Adding new materials and making some of the objects to python objects
2013-08-11 23:08:43 +02:00
jriegel
51ccff8ff9 Add file importer, standard material and Yoriks gui prototype 2013-06-01 20:27:30 +02:00