Sheet metal: add wall tool

Show off your FreeCAD projects here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
JMG
Posts: 288
Joined: Wed Dec 25, 2013 9:32 am
Location: Spain
Contact:

Sheet metal: add wall tool

Post by JMG »

Hi all.

I've made some progress with the sheet metal workbench, being the most remarkable this script:
Image
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
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Sheet metal: add wall tool

Post by yorik »

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!
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Sheet metal: add wall tool

Post by microelly2 »

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.
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Sheet metal: add wall tool

Post by ulrich1a »

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.
In the meantime I made an unfolding algothithm, which works for my testpart.
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
JMG
Posts: 288
Joined: Wed Dec 25, 2013 9:32 am
Location: Spain
Contact:

Re: Sheet metal: add wall tool

Post by JMG »

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 :D
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
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Sheet metal: add wall tool

Post by ulrich1a »

JMG wrote:If you know how to generate the tree, I think we are near to have a working algorithm
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.

Ulrich
Attachments
sheet_ufo2.py.zip
zipped macro to unfold sheet metal needs debugging!
(6.8 KiB) Downloaded 197 times
JMG
Posts: 288
Joined: Wed Dec 25, 2013 9:32 am
Location: Spain
Contact:

Re: Sheet metal: add wall tool

Post by JMG »

Ulrich, I have tried your code and solved some identation problems, but it keeps complaining:

Code: Select all

SystemError: ../Objects/tupleobject.c:125: bad argument to internal function
Which part are you using for testing?
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
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Sheet metal: add wall tool

Post by ulrich1a »

JMG wrote:Which part are you using for testing?
I used the part from your unfold approach. But I realized soon, that the script is too buggy.
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
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
frecd
Posts: 113
Joined: Wed Dec 31, 2014 3:03 am

Re: Sheet metal: add wall tool

Post by frecd »

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
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Sheet metal: add wall tool

Post by ulrich1a »

frecd wrote:Looks good, but is the sheet metal workbench and/or the macro a
work in progress, not yet added to Freecad?
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.

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
Post Reply