chbergmann / CurvedShapesWorkbench

FreeCAD Workbench for creating 3D shapes from 2D curves
GNU Lesser General Public License v3.0
60 stars 11 forks source link

CurvedSegment: "Twist Reverse" on same-shape part causes part crash #47

Open AIRCAP opened 2 weeks ago

AIRCAP commented 2 weeks ago
11:13:11  Traceback (most recent call last):
  File "~/.local/share/FreeCAD/Mod/CurvedShapes/./CurvedSegment.py", line 105, in execute
    self.makeRibs(fp)
  File "~/.local/share/FreeCAD/Mod/CurvedShapes/./CurvedSegment.py", line 140, in makeRibs
    ribs = makeRibsSameShape(fp, fp.Items, False, makeStartEnd)
  File "~/.local/share/FreeCAD/Mod/CurvedShapes/./CurvedSegment.py", line 278, in makeRibsSameShape
    newpoles.append(vectorMiddlePlane(poles1[p], poles2[p], fraction, plane)-fraction*offset)
<class 'IndexError'>: list index out of range
11:13:11  Recompute failed!

this triggers #46 and the part is permanently broken (will never recompute again even if parameters are changed)

my line numbers don't match master, 278 is

                else:
                    newpoles.append(vectorMiddlePlane(poles1[p], poles2[p], fraction, plane))

the reason is hat reorderpoints() somehow gives not enough points. (2 out of 8 in the example file)

example file: reorderpointsbug.zip

AIRCAP commented 4 days ago

no longer crashes part, can be worked around with forceinterpolation, dunno if it triggers an exception still, leaving open for more tests