I found many related topic but I cannot find the right way merges faces. My cases are simple. I would like to merge faces with a common edge (partial or full).
Unsuccessful try
I found this old topic : face union. I made some tries using removeSplitter but no success :
Code: Select all
>>> cp = Part.Compound([doc.Face.Shape, doc.Face001.Shape])
>>> cp.removeSplitter()
<Shape object at 0x7fe3f8029580>
>>> result = cp.removeSplitter()
>>> result.Faces
[<Face object at 0x555e3c9484e0>, <Face object at 0x555e3c9cf8d0>]
s1 and s2 are faces to merge
Code: Select all
>>> Part.ShapeUpgrade.UnifySameDomain(s1.fuse(s2))
<ShapeUpgrade_UnifySameDomain object>
>>> u = Part.ShapeUpgrade.UnifySameDomain(s1.fuse(s2))
>>> u.shape().Faces
[<Face object at 0x56418661fdb0>, <Face object at 0x564185fbb7c0>]
>>> u.build()
>>> u.shape().Faces
[<Face object at 0x5641826eab40>]
>>> s1.Area + s2.Area
357068.22801917716
>>> u.shape().Faces
[<Face object at 0x564186588430>]
>>> s3 = u.shape().Faces[0]
>>> s3.Area
357068.22801917745
Please help

Edits :
- Using shape.sewShape() before using UnifySameDomain help.
- Faces needs to be perfectly coplanar if you expect UnifySameDomain to build a single face from two or more faces.
- Found related commit which is from this october.
- Found more information in OCCT reference manual
- SetLinearTolerance seems to have no effect. eg. if 2 faces have a 1 cm gap between them. Using SetLinearTolerance(10) or even 100 do not merge faces.
OS: Manjaro Linux (GNOME/gnome-xorg)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23211 (Git)
Build type: Release
Branch: master
Hash: caf30cd7ce14ebb06f11aa045e9f86ac284fa10a
Python version: 3.8.6
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: French/Switzerland (fr_CH)