paullee wrote: ↑Sat Mar 12, 2022 3:48 pm
Can you enlighten if this change fix the OP problem
As already mentioned: Yes.
paullee wrote: ↑Sat Mar 12, 2022 3:48 pm
Can you enlighten if this change fix the OP problem and what is the difference ?
In some cases a copied shape will have a Placement that is not the same as its original. Manipulations based on the Placement will then lead to faulty results. Using transformShape instead avoids this. But I have yet to check if this is the case here.
w=Gui.Selection.getSelection()[0] # window
wl=Gui.Selection.getSelection()[0] # wall
for i in range(0,5000):
ws=w.Proxy.getSubVolume(w)
wlpi=FreeCAD.Placement().multiply(wl.Placement.inverse()).multiply(w.Placement)
ws.Placement=wlpi
paullee wrote: ↑Sat Mar 12, 2022 6:21 pm
It seems the order of inversing placement needs to take in account of the Window's placement, and below rectify the problem?
I have to admit that I do not understand this difference.
Note that the .Placement.multiply(placement) structure occurs elsewhere in the file. I suppose it would have to be changed there as well?
Thanks. I understand the multiplication of placement is not 'commutative' in mathematics sense - so multiplication needs to be in the particular order of successive placement manipulation.
And further examining other Additions / Subtraction cases, and the bug seems exist. It can be shown that only Window object (getSubVolume) works correctly.