Add a material library for users to pick from
In GitLab by spfeifer on Jan 8, 2018, 17:17
(from issue gitlab-123) wood selection
it would be nice to have a drop down to select the wood type, rather than to have to specify the Modulus of Elasticity, Rupture and Compression breakdown force (but still be able to override those, or add your own wood types to a local (json) database)
those numbers are a bit hard to find (in the correct units)
Some thoughts about this feature.
Requirements:
- There is a database (either a single or multiple text files, maybe
.jsonor.csv) with various pre-defined materials - Users need to be able to add their own materials or override existing materials in the database
- Bow files need to be portable and not depend on the state of the local material library
Step 1: Support for materials (See #224)
-
In the model tree, add a new top-level item called "Materials"
-
Users can add materials there by specifying various properties
- Metadata
- Name
- Description (?)
- Source
- Color
- Density
- Elastic modulus
- Anything needed for material failure (#64)
- Metadata
-
The materials and their properties are stored directly in the bow files for portability
-
Materials that were added to the model can be selected for the layers via comboboxes
Step 2: Material library
- Materials can still be added manually like above, but also selected from a database
- Selecting from the database just copies the material properties into the bow file, as if it were created manually. No external reference to the database.
- The materials can be edited in two places:
- After adding them to the bow file: Only changes the material in the bow file
- In the database: Users can create new entries or modify existing ones. This does not change the behaviour of any bow files that previously added those materials (-> reproducible results).
- The user interface should allow filtering and sorting the available materials
- The main interface should probably be a table where the available materials can be sorted by various columns. Also allow filtering by name, keywords, ranges of properties, etc.
- Idea: Add a second tab where the materials are shown as points in a configurable x-y-plot, e.g. elastic modulus vs density (ashby chart) and other combinations.
- Open questions:
- New versions of VirtualBow might expand or modify the default materials. Such updates must not change any materials that were added or modified by the users. Maybe have two files (or sets of entries), one with default materials that is updated and one with user materials that are left untouched? (When looking for materials, user materials have precedence, so they can override existing materials.)
- Where should the database file(s) be located? In the installation directory they might be deleted when installing new versions of VirtualBow. The preferred place for such things also depends on the OS (see
QStandardPaths::AppDataLocation). This should be documented so that users can find and backup their materials or exchange them with other users. - What to do about string materials? Selecting them from a database would be useful too, but they don't fit in with the rest of the materials, because very different properties are required.
For the pre-defined materials we can take the data from the wood database (https://www.wood-database.com/). Eric Meier, the creator of this site, has kindly given me the permission to do so as long as the original source is stated.
It would also be good to be able to group materials into categories and filter them. Maybe let each material definition have an arbitrary number of tags like "wood", "fiberglass", etc. ...