From 80736caa348ac9d7ace20e45beea287f3b12f699 Mon Sep 17 00:00:00 2001 From: alafr Date: Sat, 21 Mar 2020 11:42:20 +0100 Subject: [PATCH] Arch Structure: fix multiple extrusions along path Fix the exception when trying to copy a wire with FreeCAD.Vector constructor --- src/Mod/Arch/ArchStructure.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Mod/Arch/ArchStructure.py b/src/Mod/Arch/ArchStructure.py index 5ee6f55f46..fe8adf90a3 100644 --- a/src/Mod/Arch/ArchStructure.py +++ b/src/Mod/Arch/ArchStructure.py @@ -665,21 +665,25 @@ class _Structure(ArchComponent.Component): if i < len(ev): evi = ev[i] else: - evi = FreeCAD.Vector(ev[-1]) + evi = ev[-1] + if isinstance(evi, FreeCAD.Vector): + evi = FreeCAD.Vector(evi) + else: + evi = evi.copy() if i < len(pla): pli = pla[i] else: pli = pla[-1].copy() shi.Placement = pli.multiply(shi.Placement) - if not isinstance(evi, FreeCAD.Vector): + if isinstance(evi, FreeCAD.Vector): + extv = pla[0].Rotation.multVec(evi) + shi = shi.extrude(extv) + else: try: shi = evi.makePipe(shi) except Part.OCCError: FreeCAD.Console.PrintError(translate("Arch","Error: The base shape couldn't be extruded along this tool object")+"\n") return - else: - extv = pla[0].Rotation.multVec(evi) - shi = shi.extrude(extv) base.append(shi) if len(base) == 1: base = base[0]