Sheetmetal workbench, Unorientable shape causes error

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
balvie
Posts: 16
Joined: Sun Jan 09, 2022 5:42 pm

Sheetmetal workbench, Unorientable shape causes error

Post by balvie »

Using Sheetmetal WB in a project went okay, but when changing some aspects of the total design, the folds were meshed/corrupted.
The report viewer comes up with:

Code: Select all

11:16:49  3.0
11:16:49  Traceback (most recent call last):
  File "C:\Users\rene\AppData\Roaming\FreeCAD\Mod\sheetmetal\SheetMetalFoldCmd.py", line 259, in execute
    s = smFold(bendR = fp.radius.Value, bendA = fp.angle.Value, flipped = fp.invert, unfold = fp.unfold, kfactor = fp.kfactor, bendlinesketch = fp.BendLine,
  File "C:\Users\rene\AppData\Roaming\FreeCAD\Mod\sheetmetal\SheetMetalFoldCmd.py", line 209, in smFold
    bendsolid = SheetMetalBendSolid.BendSolid(flatface, bendEdge, bendR, thk, neutralRadius, revAxisV, flipped)
  File "C:\Users\rene\AppData\Roaming\FreeCAD\Mod\sheetmetal\SheetMetalBendSolid.py", line 130, in BendSolid
    nextFace.check(True) # No output = good
<class 'ValueError'>: Unorientable shape
The tooltip at the mouse pointer also indicates "Unorientable shape" and the fold icon has a red part in it:
Clipboard01 sheetmetal treeview in error.jpg
Clipboard01 sheetmetal treeview in error.jpg (9.55 KiB) Viewed 1743 times
The solution for me was, after numerous changes in effort of finding the cause, to start over again. But... this seems not a viable solution.
I deleted the folds and started over again with the same sketch: no solution.
What now?
Start off with a brand new sketch?

I use:
Sheetmetal WB V0.2.49 03 Jul 2021

and have:
OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24267 +99 (Git)
Build type: Release
Branch: Branch_0.19.3
Hash: 6530e364184ce05ccff39501e175cf2237e6ee4b
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: English/Netherlands (en_NL)

Thanks for any repsonse in advance.
User avatar
Roy_043
Veteran
Posts: 8540
Joined: Thu Dec 27, 2018 12:28 pm

Re: Sheetmetal workbench, Unorientable shape causes error

Post by Roy_043 »

Without a file nobody will be able to help.
balvie
Posts: 16
Joined: Sun Jan 09, 2022 5:42 pm

Re: Sheetmetal workbench, Unorientable shape causes error

Post by balvie »

So here's the file.
BracketB.FCStd
(23.25 KiB) Downloaded 33 times
I know the ketch is not fully constrained it is not, I've tested it with other small designs and that did not seem to be an showstopper.
The Bracket is supposed to be ushaped in the end.
User avatar
Shalmeneser
Veteran
Posts: 9546
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Sheetmetal workbench, Unorientable shape causes error

Post by Shalmeneser »

If the folding line is too near to the b-spline, there is an error.
Attachments
Capture du 2022-01-25 19-16-52.png
Capture du 2022-01-25 19-16-52.png (2.64 KiB) Viewed 1630 times
balvie
Posts: 16
Joined: Sun Jan 09, 2022 5:42 pm

Re: Sheetmetal workbench, Unorientable shape causes error

Post by balvie »

Thanks for your efforts!!

I checked it and could reprpduce the correct working wehn dthe fold is more away from the b-spline.
The error message haowever may be different. I tested and tested on several new design files and sometimes it complained about ".. our of bound".
So now I need to change the design to cope with this.I will do that.

I hope that in due time the application be adapted for this issue.

Again, thanks for poining me out to this "flaw".
User avatar
Shalmeneser
Veteran
Posts: 9546
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Sheetmetal workbench, Unorientable shape causes error

Post by Shalmeneser »

Sometime replacing b-splines with arcs...
MRx
Posts: 319
Joined: Wed Jul 08, 2020 5:59 am
Location: Tainan / Taiwan

Re: Sheetmetal workbench, Unorientable shape causes error

Post by MRx »

B-Splines decrease the performance of an object and it's easier to run into issues when using b-splines, use arcs whenever possible.
balvie
Posts: 16
Joined: Sun Jan 09, 2022 5:42 pm

Re: Sheetmetal workbench, Unorientable shape causes error

Post by balvie »

Okay, so with the help of you guys, I've been able to make progress.
I changed all the b-splines into curves and made a nice assembly of various parts. It represents a bracket with which two displays are mounted onto a sailing boat's mast. See below for an impression.
Assembly on screen.png
Assembly on screen.png (66.47 KiB) Viewed 1471 times
Then I wanted to make some small additions to the basic shape of the main pad. Namely the holes in the brackets at the sides.

However, as soon as I make that change (add one hole) in the sketch, I got a "list index out of range".

Code: Select all

15:29:42  4.405985903985425
15:29:42  Traceback (most recent call last):
  File "C:\Users\rene\AppData\Roaming\FreeCAD\Mod\sheetmetal\SheetMetalFoldCmd.py", line 259, in execute
    s = smFold(bendR = fp.radius.Value, bendA = fp.angle.Value, flipped = fp.invert, unfold = fp.unfold, kfactor = fp.kfactor, bendlinesketch = fp.BendLine,
  File "C:\Users\rene\AppData\Roaming\FreeCAD\Mod\sheetmetal\SheetMetalFoldCmd.py", line 123, in smFold
    solid0 = cutSolid.childShapes()[1]
<class 'IndexError'>: list index out of range
That error in the sketch of the pad, made the subsequent (lower in te tree) folds go into error with that same message. This can be seen in the tree view:
Clipboard01 sheetmetal treeview in error 2.jpg
Clipboard01 sheetmetal treeview in error 2.jpg (8.06 KiB) Viewed 1471 times
This has happend now more than twice and I spent all day figuring out why this happends and what can be done about it. Maybe the b-splines were not the cause?

When it happends, I delete the folds, move some objects up and down the tree and start again. I Include the design files: One okay working:
Bracket prepared for test.FCStd
(217.28 KiB) Downloaded 25 times
One with first error:
Bracket test for fail succes.FCStd
(216.89 KiB) Downloaded 18 times
Of course I will keep on testing here as well, there's got to be a solution.

Looking forweard to your more than welcome reactions.
chrisb
Veteran
Posts: 54160
Joined: Tue Mar 17, 2015 9:14 am

Re: Sheetmetal workbench, Unorientable shape causes error

Post by chrisb »

SheetMetal relies on faces, which can cause problems known from the topological naming problem.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
balvie
Posts: 16
Joined: Sun Jan 09, 2022 5:42 pm

Re: Sheetmetal workbench, Unorientable shape causes error

Post by balvie »

And so I did some more testing. Trying to find the "thing" that causes the error. The approach is to take an errorneous design and subsequently delete things from it. So I did.
I had, in one file:
  • Body
    Origin
    Pad (with Sketch)
    Fold
    Fold001
    Pocket
In which I made an extra hole in Sketch ->> error.

Then I did the following:
Taking off Pocket, make an extra hole in Sketch ->> error.
Taking off Pocket and Fold001, make an extra hole in Sketch ->> error.
Taking off Pocket, Fold001 and Fold, make an extra hole in Sketch ->> NO error.

Then I took that (almost empty) design and added an extra pocket based on en new sketch and tried to modify the primairy pad. With succes. So not much to conclude here and now and it seems that it has something to do with the Folds.

Next thing I did was to go back to that (almost empty) design, add a fold again and and try to make an extra hole in Sketch ->> error.

So it seems that some way or another the extra adidng of a hole in a previous Sketch, while there is a subsequent Fold, the Sheetmetal WB detects an error.

So I started a new design. Made a pad of 3mm and folded it. Then I went to the sketch of the pad and tried to add a hole.... (same) ERROR.
Finally a small reproducable design:
Clipboard01 - simple design with error.jpg
Clipboard01 - simple design with error.jpg (37.37 KiB) Viewed 1424 times
The design is added here:
Simple shaped with error.FCStd
(21.02 KiB) Downloaded 18 times
So I now do not know what to do next.
Post Reply