shaise / FreeCAD_SheetMetal

A simple sheet metal workbench for FreeCAD
http://theseger.com/projects/2015/06/sheet-metal-addon-for-freecad/
GNU Lesser General Public License v2.1
193 stars 56 forks source link

Base Shape Tub, Hat and Box size wrong #298

Open RexLinz opened 7 months ago

RexLinz commented 7 months ago

Creating any of Tub, Hat or Box the resulting size of the resulting is wrong in one dimension.

Test:

  1. Create a Base Shape "Tub" with thickness=1mm, radius=1mm, length=30mm and width=20mm.
  2. Measure outside dimensions which will be 22x30 mm.

Screenshot attached.

Cause: For Tub, Hat and Box width AND length has to be corrected by 2.0 * bendCompensation but just length is done so.

Solution: I have changed the code in SheetMetalBaseShapeCmd.py, function smCreateBaseShape starting line 141 to expicitly deal with all cases as shown below.

def smCreateBaseShape(type, thickness, radius, width, length, height, flangeWidth, fillGaps): bendCompensation = thickness + radius height -= bendCompensation if type == "U-Shape": numfolds = 2 width -= 2.0 bendCompensation elif type == "Tub" or type == "Hat" or type == "Box": numfolds = 4 width -= 2.0 bendCompensation length -= 2.0 * bendCompensation else: numfolds = 1 width -= bendCompensation ... SheetMetalSize

shaise commented 7 months ago

You are definitely correct. Thanks!

RexLinz commented 7 months ago

Well done project. Nice to contribute a little bit to that.

Roland

Am 10.02.2024 08:12 schrieb Shai Seger @.***>:

You are definitely correct. Thanks!

— Reply to this email directly, view it on GitHubhttps://github.com/shaise/FreeCAD_SheetMetal/issues/298#issuecomment-1936909626, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACOHVDQG2TT6RNJMT2RASPDYS4MXDAVCNFSM6AAAAABDBXIDPWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZWHEYDSNRSGY. You are receiving this because you authored the thread.Message ID: @.***>