Sheet metal: add wall tool
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Sheet metal: add wall tool
Hi all.
I've made some progress with the sheet metal workbench, being the most remarkable this script:
Video:
https://www.youtube.com/watch?v=OciAZodqjjw
As can be seen, it adds a new wall to an existing sheet. It can also generate square relief slots and place a sketch on the generated wall automatically.
Currently, I'm working with the unfolding algorithm where I'm going to need help, I will ask once I completely define my question.
What do you think about the addWall tool? Other CAD software uses sightly different methods to do this, I implemented this one for being the most balanced between usability and code complexity. But ideas accepted
Code and instructions here
edited: added a picture
Javier.
I've made some progress with the sheet metal workbench, being the most remarkable this script:
Video:
https://www.youtube.com/watch?v=OciAZodqjjw
As can be seen, it adds a new wall to an existing sheet. It can also generate square relief slots and place a sketch on the generated wall automatically.
Currently, I'm working with the unfolding algorithm where I'm going to need help, I will ask once I completely define my question.
What do you think about the addWall tool? Other CAD software uses sightly different methods to do this, I implemented this one for being the most balanced between usability and code complexity. But ideas accepted
Code and instructions here
edited: added a picture
Javier.
Last edited by JMG on Thu Dec 11, 2014 1:32 pm, edited 1 time in total.
FreeCAD scripts, animations, experiments and more: http://linuxforanengineer.blogspot.com.es/
Open source CNC hot wire cutter project (NiCr): https://github.com/JMG1/NiCr
Exploded Assembly Workbench: https://github.com/JMG1/ExplodedAssembly
Open source CNC hot wire cutter project (NiCr): https://github.com/JMG1/NiCr
Exploded Assembly Workbench: https://github.com/JMG1/ExplodedAssembly
Re: Sheet metal: add wall tool
I think that's the big advantage of opensource software, you don't need to do like commercial apps, and can do as you think it's best Very nice work!
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: Sheet metal: add wall tool
Very nice and intuitive.
When the wallFace, bend and MainObject stay separate objects and there is a part compound hierachy,
it will be easy to animate the unfold/fold process.
This will not only be a paper unfold but a good approximation to thick materials too.
When the wallFace, bend and MainObject stay separate objects and there is a part compound hierachy,
it will be easy to animate the unfold/fold process.
This will not only be a paper unfold but a good approximation to thick materials too.
Re: Sheet metal: add wall tool
In the meantime I made an unfolding algothithm, which works for my testpart.JMG wrote:Currently, I'm working with the unfolding algorithm where I'm going to need help, I will ask once I completely define my question.
It works in two steps:
1. It analyzes the part and builds an internal tree-structure of flat faces and the bending faces.
2. The tree-structure is then traversed, in order to unfold the part starting from the outermost elements of the tree-structure.
I need some more time before publishing: Actually it has no interactive support. There are a few cases, where I know it will fail.
Ulrich
Re: Sheet metal: add wall tool
Thanks to all for your feedback!
Ulrich, that`s exactly what I'm trying to do, but creating the tree of faces is over my python skills at the moment.
I have, more less, the code to save the edges of a face related to its center of area, in order to being able to reconstruct it later (once the center of area location at the unfolded shape is calculated ). If you know how to generate the tree, I think we are near to have a working algorithm
Ulrich, that`s exactly what I'm trying to do, but creating the tree of faces is over my python skills at the moment.
I have, more less, the code to save the edges of a face related to its center of area, in order to being able to reconstruct it later (once the center of area location at the unfolded shape is calculated ). If you know how to generate the tree, I think we are near to have a working algorithm
FreeCAD scripts, animations, experiments and more: http://linuxforanengineer.blogspot.com.es/
Open source CNC hot wire cutter project (NiCr): https://github.com/JMG1/NiCr
Exploded Assembly Workbench: https://github.com/JMG1/ExplodedAssembly
Open source CNC hot wire cutter project (NiCr): https://github.com/JMG1/NiCr
Exploded Assembly Workbench: https://github.com/JMG1/ExplodedAssembly
Re: Sheet metal: add wall tool
I know how to generate the tree, but my code depends heavily on Part-section. And this is total buggy in my version of OCE. I am sure, there are other bugs in my code, but it is difficult to find them under this conditions. I could unfold your part with selection of Face18. You may test it yourself. Select a flat face and run the macro.JMG wrote:If you know how to generate the tree, I think we are near to have a working algorithm
Ulrich
- Attachments
-
- sheet_ufo2.py.zip
- zipped macro to unfold sheet metal needs debugging!
- (6.8 KiB) Downloaded 197 times
Re: Sheet metal: add wall tool
Ulrich, I have tried your code and solved some identation problems, but it keeps complaining:
Which part are you using for testing?
Code: Select all
SystemError: ../Objects/tupleobject.c:125: bad argument to internal function
FreeCAD scripts, animations, experiments and more: http://linuxforanengineer.blogspot.com.es/
Open source CNC hot wire cutter project (NiCr): https://github.com/JMG1/NiCr
Exploded Assembly Workbench: https://github.com/JMG1/ExplodedAssembly
Open source CNC hot wire cutter project (NiCr): https://github.com/JMG1/NiCr
Exploded Assembly Workbench: https://github.com/JMG1/ExplodedAssembly
Re: Sheet metal: add wall tool
I used the part from your unfold approach. But I realized soon, that the script is too buggy.JMG wrote:Which part are you using for testing?
Here is a version with "less" bugs. But this version can unfold your part.
Select a flat face and run the script from the console or as macro.
Ulrich
- Attachments
-
- unfolded_part.png (11.26 KiB) Viewed 9532 times
-
- sheet_ufo7.py.zip
- proof of concept for simple parts
- (7.98 KiB) Downloaded 201 times
-
- JMGs_part.fcstd
- your test part
- (24.76 KiB) Downloaded 167 times
Re: Sheet metal: add wall tool
Howdy;
Looks good, but is the sheet metal workbench and/or the macro a
work in progress, not yet added to Freecad? I don't see it on my
version.
Newbie Bill
OS: KUbuntu 12.04.5 LTS
Word size: 32-bit
Version: 0.14.3702 (Git)
Branch: releases/FreeCAD-0-14
Hash: b3368125c63289ec8ce9faec2b2ae4c78d436406
Python version: 2.7.3
Qt version: 4.8.1
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.7.0
Looks good, but is the sheet metal workbench and/or the macro a
work in progress, not yet added to Freecad? I don't see it on my
version.
Newbie Bill
OS: KUbuntu 12.04.5 LTS
Word size: 32-bit
Version: 0.14.3702 (Git)
Branch: releases/FreeCAD-0-14
Hash: b3368125c63289ec8ce9faec2b2ae4c78d436406
Python version: 2.7.3
Qt version: 4.8.1
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.7.0
Re: Sheet metal: add wall tool
This functionality is work in progress and actual available by two different macros: The AddWall-Tool from JMG. You will find the link in the first post of this thread. Then there is an unfold macro: sheet_ufo. I add here a version, that should have less issues as the version posted two posts above.frecd wrote:Looks good, but is the sheet metal workbench and/or the macro a
work in progress, not yet added to Freecad?
You have to put sheet_ufo12.py into your macro-folder. Select a flat face of your sheet-metal-part and call the macro.
Ulrich
- Attachments
-
- sheet_ufo12.py.zip
- (10.79 KiB) Downloaded 238 times