edwilliams16 wrote: ↑Tue Aug 02, 2022 6:30 pm
When can the shared TShape have different Placements?
This usually happens for pad operations. As a test create a rectangular sketch and pad it. Hover over the bottom and top face to get their indexes. Assuming it's 5 and 6 then
Code: Select all
pad = App.ActiveDocument.Pad.Shape
pad.Face5.isPartner(pad.Face6)
will return true.
Checking their placements:
Code: Select all
pad.Face5.Placement # Placement [Pos=(0,0,0), Yaw-Pitch-Roll=(0,0,0)]
pad.Face6.Placement # Placement [Pos=(0,0,10), Yaw-Pitch-Roll=(0,0,0)]
It isn't clear to me where isSame() or isPartner() is the more precise comparison.
From the above example you can easily see that isPartner() would lead to a false-positive check. So, you really must use isSame().
edwilliams16 wrote: ↑Wed Aug 03, 2022 8:08 am
How do I create an example of an object with edges that are isPartner, but not isEqual?
That's fairly easy. Simply create a standard box. By hovering the mouse over two adjacent faces you can see that Face2 and Face6 share a common edge.
Code: Select all
box = App.ActiveDocument.Box.Shape
f2 = box.Face2
f6 = box.Face6
# by testing 16 possible cases you will find this shared edge
f2.Edge2.isPartner(f6.Edge3) # True
In this case isSame() will also return true because the faces are topologically connected.
However, isEqual() will return false.
Code: Select all
f2.Edge2.isEqual(f6.Edge3) # False
If you have two adjacent faces with consistent orientation then isEqual() will always return false for their shared edge.