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: 161
Joined: Thu Jun 11, 2015 8:11 am

Re: Sheet Metal Workbench

Postby shaise » Fri Apr 29, 2016 12:16 pm

Hi Everyone,

I have updated the workbench to use Ulrich's latest version (17).
It seems to solve several unfolding issues.
Updated workbench: http://theseger.com/projects/2015/06/sheet-metal-addon-for-freecad/
Source: https://github.com/shaise/FreeCAD_SheetMetal

shai
triplus
Posts: 4993
Joined: Mon Dec 12, 2011 4:45 pm

Re: Sheet Metal Workbench

Postby triplus » Fri Apr 29, 2016 1:39 pm

Nice work! It's easy to grasp the concept and to produce good results.

I noticed one issue:

Flatten.png
Flatten.png (7.17 KiB) Viewed 1062 times


If you create this and after change the placement of the Unfold object can you confirm FreeCAD freezes?
User avatar
shaise
Posts: 161
Joined: Thu Jun 11, 2015 8:11 am

Re: Sheet Metal Workbench

Postby shaise » Thu Jul 14, 2016 2:43 pm

Hi Ulrich,

Someone has left an issue (#5) regarding the unfolding macro.
It seems that if you unfold an object, add folds to the unfolded sheet then unfold again, the unfolder macro fails.
I investigated it a bit, and it seems that the issue is because the flattened bends surfaces is not planes but rather "splined surfaces" or something. (The result of Part.makeRuledSurface) This causes an error at isVertOpposite function.
I have changed Part.makeRuledSurface to manually creating 4 flat faces.
From:

Code: Select all

   
    Bend_shell = Part.makeRuledSurface (o_wire, b_wire)
    # Part.show(Bend_shell)
       
    for shell_face in Bend_shell.Faces:
      flat_shell.append(shell_face )

To:

Code: Select all

    for i in range(len(o_wire.Edges)) :
      flat_shell.append(self.MakeFace(o_wire.Edges[i], b_wire.Edges[i]))

and add:

Code: Select all

  def MakeFace(self, e1, e2):
    e3 = Part.Line(e1.valueAt(e1.FirstParameter), e2.valueAt(e2.FirstParameter)).toShape()
    e4 = Part.Line(e1.valueAt(e1.LastParameter), e2.valueAt(e2.LastParameter)).toShape()
    w = Part.Wire([e1,e3,e2,e4])
    return Part.Face(w)

This seems to solve the problem.
If you have another solution, or support splined surfaces, please let me know.
Thanks!

Updated workbench: http://theseger.com/projects/2015/06/sheet-metal-addon-for-freecad/
Source: https://github.com/shaise/FreeCAD_SheetMetal

shai
ulrich1a
Posts: 1406
Joined: Sun Jul 07, 2013 12:08 pm

Re: Sheet Metal Workbench

Postby ulrich1a » Thu Jul 14, 2016 4:38 pm

Hi Shai,

thanks for looking into this issue. I am planning to redo the generation of the flattend bend faces. I want to support not only straight edges of flattened bend faces but also other types of geometry at this location.
I have worked on an algorithm how to generate other types of flattened edges. What is missing is the implementation in the sheet unfolder macro and an idea about a reasonable data structure to store the information about all the vertexes and edges involved and their relation against each other. The algorithm needs to inspect all these, and how to store the information will be the next step.

So I will look at your approach, because I do not want to support ruled surfaces in the next version.

Ulrich
efyx
Posts: 157
Joined: Fri Sep 26, 2014 7:36 pm

Re: Sheet Metal Workbench

Postby efyx » Fri Jul 15, 2016 6:38 am

Ulrich1a that means you will proceed sheet metal workbench? If so, it would be very good to add:
- ability of unfold to may perform holes on the bends and then fold it again;
- perform a tool, it should works like a shell - change solid into thin surface, user should be able to show rip edges and bend edges, then automatically it should be changed to sheet metal which could be flat patterned.
User avatar
microelly2
Posts: 2450
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Sheet Metal Workbench

Postby microelly2 » Fri Jul 15, 2016 7:38 am

efyx wrote:- perform a tool, it should works like a shell - change solid into thin surface, user should be able to show rip edges and bend edges, then automatically it should be changed to sheet metal which could be flat patterned.


its not for metal but for paper models
http://freecadbuch.de/doku.php?id=blog: ... _erstellen
efyx
Posts: 157
Joined: Fri Sep 26, 2014 7:36 pm

Re: Sheet Metal Workbench

Postby efyx » Fri Jul 15, 2016 7:56 am

microelly2 wrote:its not for metal but for paper models

Wow that's impressive, is that a problem to add some functionality from sheetmetal workbench +add the K factor and that would be quite good foundation for sheetmetal workbench? Or to use some of this code into sheetmetal workbench.
ulrich1a
Posts: 1406
Joined: Sun Jul 07, 2013 12:08 pm

Re: Sheet Metal Workbench

Postby ulrich1a » Fri Jul 15, 2016 12:22 pm

efyx wrote:- ability of unfold to may perform holes on the bends and then fold it again;
At the moment I am trying to solve the problem of unfolding bends with a hole in it. Unfortunately progress is actually slow. But this is a prerequisite for further enhancements. I will see.

Ulrich
User avatar
Tandini
Posts: 7
Joined: Sat Jul 09, 2016 6:14 pm

Re: Sheet Metal Workbench

Postby Tandini » Tue Aug 30, 2016 10:18 pm

Hi, very useful addition to freeCAD!

I noticed one issue:

NoUnfoldingPossible.png
NoUnfoldingPossible.png (69.1 KiB) Viewed 691 times


Unfolding is not possible. The red shape is instead created.
If you bend the green marked surfaces only, all works fine.
User avatar
shaise
Posts: 161
Joined: Thu Jun 11, 2015 8:11 am

Re: Sheet Metal Workbench

Postby shaise » Wed Aug 31, 2016 7:15 am

Tandini wrote:Unfolding is not possible. The red shape is instead created.
If you bend the green marked surfaces only, all works fine.

For unolding to work, you must first select a face that resides on the surface of the flattened sheet, then press unfold button.