check if two faces are the same using isSame()

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
xc22143
Posts: 139
Joined: Fri Dec 03, 2021 9:52 am

check if two faces are the same using isSame()

Post by xc22143 »

Hello, everyone.

I wanted to check two faces are the same. However, the 'face' has no attribute of face id or name like 'Face1'. https://forum.freecadweb.org/viewtopic.php?t=24624 This post showed we can use face.isSame() to check. However, after I just recomputed the object and I didn't modify anything, it couldn't work. I don't know why. Or, is there another method to help check? Thank you!

Code: Select all

>>> sub = obj.getSubObject("Face3")
>>> f = sub
>>> f.isSame(sub)
True

>>> obj.recompute()
True

>>> sub = obj.getSubObject("Face3")
>>> f.isSame(sub)
False

Code: Select all

OS: Windows 8 Version 6.2 (Build 22000)
Word size of FreeCAD: 64-bit
Version: 0.21.30557 (Git)
Build type: Release
Branch: master
Hash: 8b7c61277a7775b9034fd61713c6d8371b4fec6f
Python 3.8.8, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.2
Installed mods: 
  * 3D_Printing_Tools
  * AnimationFreeCAD 1.0.0
  * basic4_wb
  * Defeaturing
  * Manipulator
  * MyWorkbench
  * WebTools
Post Reply