Implementing a Materials Database

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Blacklight
Posts: 41
Joined: Sat Feb 25, 2023 12:10 pm
Location: India
Contact:

Implementing a Materials Database

Post by Blacklight »

So I had applied for GSoC, and wasn't selected. I had two project ideas - making a motor design workflow and a materials database.

I still want to contribute, and was asked to open a thread here. I was stressed out with a lot of stuff this month, and was also learning about ricing my Linux, so I just got free. I even missed the GSoC bonding period :v, but I'll try and go in the same spirit. I'll start with making a materials database since that seems simpler to start with, and I won't get burned out quickly. Maybe I'll start the other one too soon, depending on my mood.

So the plan is to continue with the plan from https://wiki.freecad.org/Material#Material_Database and store the data in an SQLite DB. I was thinking of using MySQL and hosting the database, but SQLite seems like a good option too. Well, even plaintext can work here if we go by the UNIX philosophy, like the current .FCMat files. But then more like a single file, because we have to organize the materials list.

Apparently we cannot use the data from MatWeb, which is listed in https://wiki.freecad.org/Material#Tools because of their license. I will have to find the data from other sources, such as Wikipedia for now.

I'm assuming the list will have a simple list for each category. For example, Aluminium will have alloys 6061, 7075, etc. and for Carbon Fiber, we'll have CFRC, CFRP 30%, CFRP 70% etc. or whatever's common. This is in contrast to MatWeb's database, which lists all commercially available products, and it makes it hard for us to choose an exact value. We'll just make it accurate enough for simulations, and the designer can fill in the actual values as they need it. The ordering could be done by using the Father property

When a material is applied to a part, it should have a different color or texture in the viewport for identification. Custom materials should also have textures, so it would be good to allow editing the material texture. According to the wiki this is done with the Coin3D color model.

For the values, depending on the material, we'll have the structural values - Young's Modulus, Ultimate and Yield Tensile Strength, Density. Specific Strength and Specific Stiffness will be examples of derived quantities. There'll also be values for other stuff like electromagnetic and thermal properties, and also materials like Rubber, Ceramic etc. and whatever they have. We'll also have an option to view the values in different units. We can certainly take some inspiration from Fusion360 here. I'm seeing a lot of ideas on the Wiki page too.

So that's the project introduction thread. I'm supposing this interface will belong in the Part (and PartDesign) workbench? We'll also require the data for the simulation workbenches like FEM and CFD. I'll also have to see how to standardize the values for FEM/CFD use too. For example, the stiffness can be different in X, Y and Z.

I think most of this is understood in the Wiki page too, I was just mentioning it for the thread's sake. Now I'll just have to learn about getting started. I still haven't explored the software on my own yet, but I plan to over the next few weeks alongside my Blender tutorials, making simple stuff.
Keep calm, and be nice to everyone!
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Implementing a Materials Database

Post by wandererfan »

Nice. Looking forward to seeing it.

Random first thoughts...
- shoot for a database agnostic solution (plugin?)
- don't force fit into Part module, keep (mostly) separate. have a toolbar that people can add to the gui.
- we could have an external material getter so we don't need to distribute proprietary content. If the user has a license for MatWeb then we're just providing an access tool, same as a browser.
User avatar
NewJoker
Veteran
Posts: 3018
Joined: Sun Oct 11, 2020 7:49 pm

Re: Implementing a Materials Database

Post by NewJoker »

@Blacklight Any effort to improve the material handling in FreeCAD will definitely be appreciated. Have you seen this thread ? viewtopic.php?t=78242 Perhaps some collaboration with @grandcross would be needed.
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Implementing a Materials Database

Post by yorik »

Indeed in the meantime, there has been a concurrent effort to redesign the materials system started by @grandcross. I think there is more than enough work for two people and it can be very interesting to split tasks. A project driven by several people usually reaches far further than a solo one. I suggest you guys have a chat about this!
User avatar
hholgi
Posts: 149
Joined: Wed Sep 19, 2018 9:35 am
Location: Gütersloh, Germany

Re: Implementing a Materials Database

Post by hholgi »

Is it allowed to propose Campus?

https://www.campusplastics.com/campus/list
Last edited by hholgi on Thu Jun 01, 2023 5:52 am, edited 1 time in total.
MTB racing service for TR in www.rsv-guetersloh.de; RC flight model in www.moewe-delbrueck.de
Uses Anycubic Kobra 2 Pro 3D Printer, FreeCad, CATIA V5, Cura
User avatar
Blacklight
Posts: 41
Joined: Sat Feb 25, 2023 12:10 pm
Location: India
Contact:

Re: Implementing a Materials Database

Post by Blacklight »

wandererfan wrote: Mon May 29, 2023 11:22 pm Random first thoughts...
- shoot for a database agnostic solution (plugin?)
- don't force fit into Part module, keep (mostly) separate. have a toolbar that people can add to the gui.
- we could have an external material getter so we don't need to distribute proprietary content. If the user has a license for MatWeb then we're just providing an access tool, same as a browser.
Seems like a good idea to have a database fetcher, since most sites are only free for personal use.
wandererfan wrote: Mon May 29, 2023 11:22 pm - don't force fit into Part module, keep (mostly) separate. have a toolbar that people can add to the gui.
Makes sense comparing with how it's done in Blender. The Arch Texture Workbench also takes a similar approach, but we'll have to make it easier by reducing the extra step of adding the texture manually. It's now Part/PartDesign -> Arch -> Arch Texture.
wandererfan wrote: Mon May 29, 2023 11:22 pm - shoot for a database agnostic solution (plugin?)
You must be referring to something like the Parts Library Addon? Makes sense, keeping it in a simple text format, which can also allow migrating to a database in the future if it gets large. But shouldn't materials also be a core part?

============================================================================
NewJoker wrote: Tue May 30, 2023 8:17 am @Blacklight Any effort to improve the material handling in FreeCAD will definitely be appreciated. Have you seen this thread ? viewtopic.php?t=78242 Perhaps some collaboration with @grandcross would be needed.
yorik wrote: Tue May 30, 2023 2:02 pm Indeed in the meantime, there has been a concurrent effort to redesign the materials system started by @grandcross. I think there is more than enough work for two people and it can be very interesting to split tasks. A project driven by several people usually reaches far further than a solo one. I suggest you guys have a chat about this!
I just saw the thread. Sure, I'll collab with him then.

============================================================================
hholgi wrote: Tue May 30, 2023 2:09 pm Is it allowed to propose Camous?

https://www.campusplastics.com/campus/list
According to this, the data is only free for personal use use by personal visit, and we can't use a bot or scrape the data. Seems like @wandererfan's idea of using an external getter comes handy here.
Last edited by Blacklight on Mon Jun 12, 2023 4:01 pm, edited 2 times in total.
Keep calm, and be nice to everyone!
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Implementing a Materials Database

Post by adrianinsaval »

consider coordinating with viewtopic.php?p=684108
User avatar
Blacklight
Posts: 41
Joined: Sat Feb 25, 2023 12:10 pm
Location: India
Contact:

Re: Implementing a Materials Database

Post by Blacklight »

adrianinsaval wrote: Tue May 30, 2023 7:12 pm consider coordinating with viewtopic.php?p=684108
Yup, on it.
Keep calm, and be nice to everyone!
User avatar
hholgi
Posts: 149
Joined: Wed Sep 19, 2018 9:35 am
Location: Gütersloh, Germany

Re: Implementing a Materials Database

Post by hholgi »

Blacklight wrote: Tue May 30, 2023 7:04 pm ....According to this, the data is only free for personal use. Seems like @wandererfan's idea of using an external getter comes handy here.
Mmmm i'm wondering ... because we use it in our company.
And this is Faurecia/Hella with more than 100000 Persons :D

We use the free version without any payment ...
MTB racing service for TR in www.rsv-guetersloh.de; RC flight model in www.moewe-delbrueck.de
Uses Anycubic Kobra 2 Pro 3D Printer, FreeCad, CATIA V5, Cura
User avatar
Blacklight
Posts: 41
Joined: Sat Feb 25, 2023 12:10 pm
Location: India
Contact:

Re: Implementing a Materials Database

Post by Blacklight »

hholgi wrote: Thu Jun 01, 2023 5:55 am
Blacklight wrote: Tue May 30, 2023 7:04 pm ....According to this, the data is only free for personal use. Seems like @wandererfan's idea of using an external getter comes handy here.
Mmmm i'm wondering ... because we use it in our company.
And this is Faurecia/Hella with more than 100000 Persons :D

We use the free version without any payment ...
It's free if they don't know ;)
But there is a chance that your company is subscribed to their premium plan.
Keep calm, and be nice to everyone!
Post Reply