help on sheet metal script

Need help, or want to share a macro? Post here!
jaisejames
Posts: 280
Joined: Sat Sep 24, 2016 6:51 am

Re: help on sheet metal script

Postby jaisejames » Fri Mar 08, 2019 4:46 am

Fold sheet metal wall at sketch line.

https://github.com/shaise/FreeCAD_SheetMetal/pull/58

Step to use

1.Select a face to bend
fold along line 1.png
fold along line 1.png (4.33 KiB) Viewed 777 times
2. Select sketch & Press icon
fold along line 2.png
fold along line 2.png (5.11 KiB) Viewed 777 times
3.Select inverbend to flip selection side
fold along line 3.png
fold along line 3.png (6.21 KiB) Viewed 777 times
Feedback & grammatical corrections are welcome.

It is based on fillet. so where it fail, this also fail. [unfold not implemented]
User avatar
shaise
Posts: 345
Joined: Thu Jun 11, 2015 8:11 am

Re: help on sheet metal script

Postby shaise » Sun Mar 10, 2019 6:58 am

Hi jaisejames,

Very nice indeed!!!
But before I merge it, you need to change the nesting of the folds in the tree view. This is the nesting now:
foldwall1.png
foldwall1.png (8.89 KiB) Viewed 746 times
When you are outside a body, this is ok and should look like that, but inside a body this should look different.
All the folds should be one under the other in the same level, and only the sketches are nested under their parent folds.
so more ore less it should look like that (i just edited the image):
foldwall2.png
foldwall2.png (10.29 KiB) Viewed 746 times
You can take a look at my view provider for bends to see how I find out if I am under Body or outside a body.
Regarding unfolds, for now the simplest way is that when unfold=true, the function just returns a copy of the base object without doing any k factor calculation. (actually I think K factor should be taken into account in the bend function, not the unfold function in this case, to simulate real bending)

Thanks again!! great work.

shai
efyx
Posts: 280
Joined: Fri Sep 26, 2014 7:36 pm

Re: help on sheet metal script

Postby efyx » Wed Mar 13, 2019 8:01 am

shaise wrote:
Sun Mar 10, 2019 6:58 am
Congrats for this module. It is getting better and better.
I have mittered joint, and I wan't to increase gap. I am going to combo view section Parameteres Ex and do extend1 to -1 and extednd2 to -2 and gap increase but bend stays as not moved. Is there any option to operate with bend? Or this is a bug and should be changed in the future. Also after mittering stays some trash between bends - should I remove that with a pocket or it is possible to improve that later?
Pic below:
sheetmetal_mitred joint.png
sheetmetal_mitred joint.png (37.5 KiB) Viewed 673 times
Edit: because of that trashes sheet metal cannot unfold
jaisejames
Posts: 280
Joined: Sat Sep 24, 2016 6:51 am

Re: help on sheet metal script

Postby jaisejames » Thu Mar 14, 2019 8:43 am

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

Re: help on sheet metal script

Postby efyx » Thu Mar 14, 2019 10:21 am

jaisejames wrote:
Thu Mar 14, 2019 8:43 am
added a fix for above problem
https://github.com/shaise/FreeCAD_SheetMetal/pull/59
Wow it was fast. It changed a bit but not 100%. See attached file. The triangle stays, and also should be somehow better management of gaps - when selecting two edges and do the mittered joint, actually you have 3 (when midlle is symmetric) to 4 gaps (non symmetric) - when 3 edges you have 4 to 6 gaps. Is it possible to remove somehow that triangles?
Attachments
sheet_metal_test.FCStd
(26.39 KiB) Downloaded 17 times
jaisejames
Posts: 280
Joined: Sat Sep 24, 2016 6:51 am

Re: help on sheet metal script

Postby jaisejames » Thu Mar 14, 2019 10:38 am

Can you do "Mark to recompute" on bend & do a recompute.
screenshot.png
screenshot.png (5.75 KiB) Viewed 609 times
Any other problem, if able to attach a file. I will be able check it.
efyx
Posts: 280
Joined: Fri Sep 26, 2014 7:36 pm

Re: help on sheet metal script

Postby efyx » Thu Mar 14, 2019 10:49 am

jaisejames wrote:
Thu Mar 14, 2019 10:38 am
I done this but nothing changes. On your picture it looks super clean. File was attached above. I've updated sheet workbench also.
jaisejames
Posts: 280
Joined: Sat Sep 24, 2016 6:51 am

Re: help on sheet metal script

Postby jaisejames » Fri Mar 15, 2019 11:14 am

While fixing bug some new bug introduced. new fix is below.

https://github.com/shaise/FreeCAD_SheetMetal/pull/60
jaisejames
Posts: 280
Joined: Sat Sep 24, 2016 6:51 am

Re: help on sheet metal script

Postby jaisejames » Sun Mar 17, 2019 4:31 pm

new test.
Attachments
SheetMetalCmd.py
(49 KiB) Downloaded 20 times
jaisejames
Posts: 280
Joined: Sat Sep 24, 2016 6:51 am

Re: help on sheet metal script

Postby jaisejames » Mon Mar 18, 2019 7:01 am

shaise wrote:
Sun Mar 10, 2019 6:58 am

shai
Last attached file is new extend implementation. could pls check it.
extend_new_implemenation.png
extend_new_implemenation.png (19.63 KiB) Viewed 468 times