auto generator of furniture / workbench

Show off your FreeCAD projects here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
mobe
Posts: 11
Joined: Mon Jul 27, 2020 12:56 pm

auto generator of furniture / workbench

Post by mobe »

First of all I want to say that in the past I used many of other CAD programs that are very convenient. Because FreeCAD is quite different I didn't want to use it. But after using it now for some time I must say that I'm very much amazed what's it's possibilities are. The python API makes the program so powerful.

In advance I apologize for my english, I know it is not the best.

Here is an example of a workbench I'm working on. It is actually just a part of a bigger project I'm working on.
The workbench generates furniture and also the files for fabrication.

I'm actually not sure how the containers are meant to be used. This workbench uses it as an assembly. Therefore the structure will be generated automatically. The screenshot is in german, but it just says which room it is in and divides also the documentation and fabrication:

Image

By clicking on the new button it generates the structure.
Now you can choose which furniture you want to generate (in this example it would be the table):
menueBarTable.png
menueBarTable.png (9.01 KiB) Viewed 5490 times
Later there is goign to be an UI for that. But for now it is just some variables that defines the parameters of the table.
generatedTableStructure.png
generatedTableStructure.png (52.33 KiB) Viewed 5490 times
It generates a group of all the individual parts that are interlocked. Now by selecting the "Tisch" ("table") group and the fabrication button,
it will copy all files and put those in the coordinate system of the specified CNC.
menueBarFabrication.png
menueBarFabrication.png (8.98 KiB) Viewed 5490 times
It is the "small box in bigger box problem" that must be solved.
At the moment it just takes the outer dimensions of the parts and it starts to arrange the biggest parts first. If the next smaller part doesn't fit anymore, it will go on with the next smaller parts and so on. The parts that doesn't fit anymore will be put on the next sheet. There is one problem at the moment with this. Parts that aren't box shaped will not be put in eachother. When creating a closet the algorythm works fine. But the table on sheet 2 is arranged very ineffectivly. Sheet 1 is way better arranged:

Sheet 1:
sheet1.PNG
sheet1.PNG (39.55 KiB) Viewed 5490 times
Sheet 2:
sheet2.PNG
sheet2.PNG (37.3 KiB) Viewed 5490 times
When the software is arranging the parts, it searches for the 2 parts with the biggest surface and turns the smaller one surface up. Which always is the side that will be milled.
It also creates the dxfs and exports them. Later this won't be neccesary. But at the moment I generate the G-Code with Estlcam. Later on hopefully "Path" will do this automatically.
It also creates a part list, with all the data like price and identnumber of the parts that must be bought.

Image

Here are a few picture of the furniture that were done with this workbench:

Image
Image
Image
Image

There is quite a lot to do:
  • The G-Code should be generated with the help of the Path workbench
  • For the specification of the variables should be an UI
  • The furniture that could be created will be extended
  • The box in box algorythm must be improved
When generating a new furniture, it doens't just change the parameters, it will create a whole new modell every single time.

This is actually not quite relevant, but here is also a small add-on which manages the parts that must be bought:
By selecting the part and clicking on the icon, it will show all the informations about the part:

Image
Image

With the other icon the parts have to be bought can be searched:

Image
Image

It is basically just a sql database with the necessary data. For the creation of the sketches it also uses a database, this has the benefit that the sketch not always has to be created new.
fmluizao
Posts: 78
Joined: Tue Nov 19, 2019 7:16 pm

Re: auto generator of furniture / workbench

Post by fmluizao »

mobe wrote: Tue Jul 28, 2020 8:38 am It is the "small box in bigger box problem" that must be solved.
Maybe you'll find useful:

https://deepnest.io/

https://github.com/Jack000/Deepnest

Its MIT licensed, and give pretty good results.
paullee
Veteran
Posts: 5134
Joined: Wed May 04, 2016 3:58 pm

Re: auto generator of furniture / workbench

Post by paullee »

Looks exciting !

Maybe you can cross-post at Draft, Arch & BIM Sub-Forum ?
Dacicusan
Posts: 6
Joined: Sat Nov 04, 2017 4:51 pm

Re: auto generator of furniture / workbench

Post by Dacicusan »

Hi. I just discovered this project today. Congratulations for your results so far.

Regarding nesting in FreeCAD, there it is already a module for doing that developed by Yorik, called Nester, nester.py

I am interested if it is possible to add some additional features to this workbench like grain orientation and the automatic drawings generation for every single parts? Also I do have some good ideas for generating the dxf files for mechanisation if you are interested into this.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: auto generator of furniture / workbench

Post by Kunda1 »

This looks awesome! Is the code available ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
mobe
Posts: 11
Joined: Mon Jul 27, 2020 12:56 pm

Re: auto generator of furniture / workbench

Post by mobe »

This looks awesome! Is the code available ?
Thanks. I don't know if I post it. Not that I don't want to share it. The code is just quite messy at the moment. If there is enough interest in the add-on, I would clean the code before.

I am interested if it is possible to add some additional features to this workbench like grain orientation and the automatic drawings generation for every single parts? Also I do have some good ideas for generating the dxf files for mechanisation if you are interested into this.
To implement the grain orientation is quite easy.
I don't know if the automatic drawings generation is possible, but I probably won't integrate it because for me this add-on is for my CNC and for that I only need the gcode, not the drawing. But if you want to add something I wouldn't say no ;)
The dxf and gcode file generation is already implemented but thanks for the offer.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: auto generator of furniture / workbench

Post by Kunda1 »

I would think there is interest. Please don't worry about it being messy. If you have POC, put it out there. And then start cleaning it up. This will have a higher probability of garnering interest and contributions
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: auto generator of furniture / workbench

Post by PrzemoF »

There is a post on Polish forum mentioning this thread, so the interest reaches outside the English forum. Please clean the code and publish it. Or just publish it - somewhere out there someone might be waiting for it. You broke ground, other developers might improve your code.
Post Reply