[Feature Request] Python AI in FreeCad

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
SmileyFaceImoji
Posts: 10
Joined: Mon Jun 27, 2022 10:09 am

[Feature Request] Python AI in FreeCad

Post by SmileyFaceImoji »

Good day to the FreeCad community

I am Owethu Msomi from Durban, South Africa and I am studying back-end development at University, though engineering is my hobby and passion.

I would like to ask if there is a way to implement artificial intelligence(AI) into freecad as a workbench or have it baked into the next major update, for example:

I like to design parts that go on vehicles so weight saving is key, so the AI will do material reductions on a body and every time it removes 1mm of material, for example, it will do an FEM stress analysis to see if the reduction causes the body to be weaker and if not it will save and continue until it reaches the limit.

Another example could be if you have 2 or more ends of something that need to be joined together, you could then specify the general shape you want the part to be and how many Newtons of force it must handle, the AI could then create the joining part using the part and FEM workbenches respectively.

I would like to understand how much of coding and expertise will be needed to create such a workbench or modification to FreeCad, I have been wanting to learn python for AI purposes and I thought this would be an amazing tool in FreeCad and could attract more users and developers.
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: [Feature Request] Python AI in FreeCad

Post by onekk »

You could already import external python library in FC and use them.

Integrating in FC is another task, but I don't see many places were a "bunch of algorithm" will be useful when modelling in 3D engineering.

But I'm not an AI expert.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
SmileyFaceImoji
Posts: 10
Joined: Mon Jun 27, 2022 10:09 am

Re: [Feature Request] Python AI in FreeCad

Post by SmileyFaceImoji »

@onekk thanks for the reply, a workbench that is a fuse of FEM and part design, so it can make your models more efficient(use less material) by removing unnecessary material without compromising your stress analysis or thermal analysis etc. is what I'm thinking of

I don't know if it's a dumb idea but I thought of it since I wanted to learn ML and AI and thought it would do great for making models with minimal weight and increased strength properties
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: [Feature Request] Python AI in FreeCad

Post by chrisb »

I wouldn't call this AI, but that's a different discussion. Nevertheless such a workbench could be helpful. I don't think it must be integrated in the FreeCAD base system, but an addon would be nice.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
nemesis
Posts: 372
Joined: Tue Mar 25, 2014 11:24 pm
Location: France, Lyon

Re: [Feature Request] Python AI in FreeCad

Post by nemesis »

Hi,
Isn't topological optimisation about that?

https://forum.freecadweb.org/viewtopic.php?t=15460

for AI and machine learning you need a large amount of input data to train your model first, so could be complicated.
SmileyFaceImoji
Posts: 10
Joined: Mon Jun 27, 2022 10:09 am

Re: [Feature Request] Python AI in FreeCad

Post by SmileyFaceImoji »

@nemesis this is exactly what I was thinking of, thanks so much, is this a workbench I can find in the addon manager
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: [Feature Request] Python AI in FreeCad

Post by onekk »

In fact Artificial Intelligence is a misleading term.

If you see his history is simple a "multivariate analysis" with some "fuzzy logic" added so it's "hit ratio" is way better from those reached by a "pool of human expert".

The ability to have "consistent rules when evaluating" and to process a very large amount of data do the big difference from results achieved by humans.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: [Feature Request] Python AI in FreeCad

Post by adrianinsaval »

topology optimization is not AI, it's just iterative optimization using FEM, complex stuff but doable.
User avatar
nemesis
Posts: 372
Joined: Tue Mar 25, 2014 11:24 pm
Location: France, Lyon

Re: [Feature Request] Python AI in FreeCad

Post by nemesis »

SmileyFaceImoji wrote: Sat Oct 01, 2022 5:38 pm @nemesis this is exactly what I was thinking of, thanks so much, is this a workbench I can find in the addon manager
that's a group of macro, definitely usable I played with it and it works, but you need high computing power when you launch iteration.

if you want to do some ML with this you'll need to run several example of optimizaton, and feed you ML model with this.
I imagine that would be something like

1 perform several (like 1000) BESO opimisation of different design

2 split you 1000 in 2 sample, one to buil the model, one to test the model

3 build a model with:
initial geometry
boundary conditons of FEM
associated results
....
4- test if your model is able to predict the optimization on the test sample

5 - getting rich :lol:
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: [Feature Request] Python AI in FreeCad

Post by onekk »

It depends heavily on the fact that there are similarities in models, and that the ML could "find" or "guess" these similarities and derive a rule.

1000 samples could or could not be sufficient to be a "significative sample"

If I don't go wrong as example in image recognition samples are some order of magnitude higher.

But if you use internet you will find more infos about this thing.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
Post Reply