From 0c1f659fde1b36fa24035456141d8ffee1eae679 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Tue, 28 Jul 2020 18:18:22 +0800 Subject: [PATCH] assembly: fix constraint multiply element update --- freecad/asm3/assembly.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/freecad/asm3/assembly.py b/freecad/asm3/assembly.py index b1df3c8..aa2b503 100644 --- a/freecad/asm3/assembly.py +++ b/freecad/asm3/assembly.py @@ -2304,7 +2304,7 @@ class AsmConstraint(AsmGroup): # element shape offset = FreeCAD.Vector(getattr(obj,'OffsetX',0), - getattr(obj,'Offset&',0), + getattr(obj,'OffsetY',0), getattr(obj,'Offset',0)) poses = poses[:count] infos0 = firstChild.Proxy.getInfo(expand=True)[:count] @@ -2374,6 +2374,10 @@ class AsmConstraint(AsmGroup): firstChild.Proxy.infos = order self.prevOrder = used + from . import solver + if solver.isBusy(): + return + # now for those instances that are 'out of place', lets assign some # initial placement @@ -2403,14 +2407,21 @@ class AsmConstraint(AsmGroup): if ref: pla = pla.multiply(ref) else: - pla = info0.Placement.multiply(pla.multiply(pla0.inverse())) + pla = pla.multiply(p0.inverse()) showPart(partGroup,info0.Part) touched = True - setPlacement(info0.Part,pla,True) - if touched: - firstChild.Proxy.getInfo(True) - firstChild.purgeTouched() + # DO NOT purgeTouched here. We shall leave it as touched and + # trigger a second pass of recomputation to property update the + # associated element of this part. + # + # setPlacement(info0.Part,pla,purgeTouched=True) + # + setPlacement(info0.Part,pla) + + # if touched: + # firstChild.Proxy.getInfo(True) + # firstChild.purgeTouched() def execute(self,obj): if not getattr(self,'_initializing',False) and\