Sheet Metal Workbench

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
shaise
Posts: 159
Joined: Thu Jun 11, 2015 8:11 am

Sheet Metal Workbench

Postby shaise » Thu Jun 11, 2015 8:34 am

Hi Everyone,

I have recently written a simple Sheet Metal workbench to create parametric sheet metal parts. It's very basic but works quite nice and can be downloaded from here:
http://theseger.com/projects/2015/06/sheet-metal-addon-for-freecad/
However one small thing I was struggling with is how to parent the new created shapes objects over the base ones. (like what happens when you apply a fillet over a cube, the fillet object becomes the parent of the cube in the model tree)
Can someone point me out to a python example code of how to do this?

Thanks!
shai
User avatar
shaise
Posts: 159
Joined: Thu Jun 11, 2015 8:11 am

Re: Sheet Metal Workbench

Postby shaise » Thu Jun 11, 2015 2:10 pm

Ok, Found the solution myself:

I must use my own ViewProvider in order to control tree parenting. (as opposed to using the default provider)
The claimChildren() method is used to collect all child objects

shai
abdullah
Posts: 1504
Joined: Sun May 04, 2014 3:16 pm

Re: Sheet Metal Workbench

Postby abdullah » Thu Jun 11, 2015 2:36 pm

Hi shaise,

First at all thanks for your WB. It looks nice.

As you raised my awareness with this post (I have look into your blog, which linked the blog of another guy that also has done a collection of scripts), I would like to let you know that I would like to see a sheet metal Workbench in FC Master (not just as a plug-in).

I do not know if there are some community plans I am not aware of to develop one separately. I think that having an "official" sheet metal WB, apart from enriching the variety of tools FC has, would also join together this and that another developer, so that the community can profit from small contributions from different parties.

What do you think about this, guys?
User avatar
microelly2
Posts: 2363
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Sheet Metal Workbench

Postby microelly2 » Thu Jun 11, 2015 2:55 pm

Python workbenches, macros and other standalone plugins have the property to allow very speedy development. I think they can live their own life until they are complete enough to move to the master. The git logs and the forum are good places to communicate. The development of the drawing dim workbench is a good example.
I watch the process and if there are interesting changes I update my environment.
ickby
Posts: 2431
Joined: Wed Oct 05, 2011 7:36 am

Re: Sheet Metal Workbench

Postby ickby » Thu Jun 11, 2015 2:59 pm

What do you think about this, guys?

In my oppinion JMG's effort seems more comprehensive and has more functionality included, I would say we should see if his experiment is going to succeed and if we could integrate his work.
User avatar
shaise
Posts: 159
Joined: Thu Jun 11, 2015 8:11 am

Re: Sheet Metal Workbench

Postby shaise » Thu Jun 11, 2015 3:15 pm

I definitely agree JMG's work is far better then mine, specially with the unfold option. If there is to be an official Sheet Metal workbench, it should be his. BTW I have uploaded my code to github: https://github.com/shaise/FreeCAD_SheetMetal
ulrich1a
Posts: 1379
Joined: Sun Jul 07, 2013 12:08 pm

Re: Sheet Metal Workbench

Postby ulrich1a » Thu Jun 11, 2015 5:11 pm

shaise wrote:specially with the unfold option.
Unfolding can be done with a macro. You may already know: http://www.freecadweb.org/wiki/index.ph ... alUnfolder

The macro is limited which type of bends it can handle. I can only handle bends correctly, where the side-edges are circle arcs.

Ulrich
User avatar
shaise
Posts: 159
Joined: Thu Jun 11, 2015 8:11 am

Re: Sheet Metal Workbench

Postby shaise » Thu Jun 11, 2015 6:14 pm

Hey Ulrich!

Your macro works great on my folded metals!
What an amazing piece of code!

If you like I can add it to the work bench.

Image

Image

shai
abdullah
Posts: 1504
Joined: Sun May 04, 2014 3:16 pm

Re: Sheet Metal Workbench

Postby abdullah » Thu Jun 11, 2015 6:39 pm

Thanks for the feedback guys. I am happy to see so many different efforts.

Hopefully someday they will be integrated together and we will see them in a new WB. :)

But I understand that things need time...
ulrich1a
Posts: 1379
Joined: Sun Jul 07, 2013 12:08 pm

Re: Sheet Metal Workbench

Postby ulrich1a » Thu Jun 11, 2015 9:18 pm

shaise wrote:Hey Ulrich!

Your macro works great on my folded metals!
What an amazing piece of code!

If you like I can add it to the work bench.
Yes do it.
At the time I wrote this macro, there was no workbench available. It needs more options, but it was a start to support sheet metal work.

Ulrich