help on sheet metal script

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
jaisejames
Posts: 384
Joined: Sat Sep 24, 2016 6:51 am

Re: help on sheet metal script

Post by jaisejames »

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 2265 times
2. Select sketch & Press icon
fold along line 2.png
fold along line 2.png (5.11 KiB) Viewed 2265 times
3.Select inverbend to flip selection side
fold along line 3.png
fold along line 3.png (6.21 KiB) Viewed 2265 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: 470
Joined: Thu Jun 11, 2015 8:11 am

Re: help on sheet metal script

Post by shaise »

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 2234 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 2234 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

Post by efyx »

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 2161 times
Edit: because of that trashes sheet metal cannot unfold
jaisejames
Posts: 384
Joined: Sat Sep 24, 2016 6:51 am

Re: help on sheet metal script

Post by jaisejames »

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

Re: help on sheet metal script

Post by efyx »

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 49 times
jaisejames
Posts: 384
Joined: Sat Sep 24, 2016 6:51 am

Re: help on sheet metal script

Post by jaisejames »

Can you do "Mark to recompute" on bend & do a recompute.
screenshot.png
screenshot.png (5.75 KiB) Viewed 2097 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

Post by efyx »

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: 384
Joined: Sat Sep 24, 2016 6:51 am

Re: help on sheet metal script

Post by jaisejames »

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

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

Re: help on sheet metal script

Post by jaisejames »

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

Re: help on sheet metal script

Post by jaisejames »

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