help on sheet metal script
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Posts: 384
- Joined: Sat Sep 24, 2016 6:51 am
help on sheet metal script
I have modified sheet metal.py to add miter angle. but it is not unfolding. Help on this.
- Attachments
-
- SheetMetalCmd.py
- (14.84 KiB) Downloaded 186 times
Re: help on sheet metal script
I think you have to be a bit more specific. Give some information, what you want to achieve, what error message appears,...
-
- Posts: 384
- Joined: Sat Sep 24, 2016 6:51 am
Re: help on sheet metal script
I made some changes to wall creation. In case miter angle, it will create two faces at the bend length & part loft between both instead of extrude.
Code is given as below
Code is given as below
Code: Select all
if extLen > 0 :
# calculate miter length
seamlen = extLen * math.tan(math.radians(miterA))
seamgap1 = gap1 + seamlen
seamgap2 = len - gap2 - seamlen
if seamlen :
seamEdge = thkEdge.copy()
# make second face for lofting
seamFace = smMakeFace(seamEdge, revDir, seamgap1, seamgap2)
seamFace.rotate(revAxisP, revAxisV, bendA)
seamFace.translate(wallFace.normalAt(0,0) * extLen)
wallSolid = Part.makeLoft([wallFace.Wires[0],seamFace.Wires[0]],True)
else:
wallSolid = wallFace.extrude(wallFace.normalAt(0,0) * extLen)
resultSolid = resultSolid.fuse(wallSolid)
-
- Posts: 384
- Joined: Sat Sep 24, 2016 6:51 am
Re: help on sheet metal script
pic of miter angle
Re: help on sheet metal script
miter angle could be a very nice addition...jaisejames wrote: ↑Fri Nov 10, 2017 7:17 am I made some changes to wall creation. In case miter angle, it will create two faces at the bend length & part loft between both instead of extrude.
Code is given as below
...
the unfolder code is in
https://github.com/shaise/FreeCAD_Sheet ... nfolder.py
may be @shaise or @ulrich1a may have a hint
Re: help on sheet metal script
I agree. I will add a miter option to the to-do list...
Re: help on sheet metal script
SheetMetallcmd.py produces mitering parts by makeloft
Faces of resulting part are BSplineSurfaces, which are not necessary planes.
Unfold tool will sort them out, while doing his plausibility checks.
Is this is a bad idea for a sheetmetal part?
So try to make mitering part by sweeping, this will produce plane faces, same as extrude used by sheetmetalWB
Code: Select all
wallSolid = Part.makeLoft([wallFace.Wires[0],seamFace.Wires[0]],True)
Unfold tool will sort them out, while doing his plausibility checks.
Is this is a bad idea for a sheetmetal part?
So try to make mitering part by sweeping, this will produce plane faces, same as extrude used by sheetmetalWB
-
- Posts: 384
- Joined: Sat Sep 24, 2016 6:51 am
Re: help on sheet metal script
Thanks for the hint. updated script is attached. we need to add some gap to work unfold.
- Attachments
-
- SheetMetalCmd.py
- (15.22 KiB) Downloaded 147 times
Re: help on sheet metal script
Very nice! now Unfold work as well.
@jaisejames, with your permission, I will add this fix to the release.
shai
@jaisejames, with your permission, I will add this fix to the release.
shai