I am trying to apply the solution of this thread "https://forum.freecadweb.org/viewtopic.php?f=22&t=35723".
The difference here is, that there aren't two faces now, but a face and its projection.
So the problem here is, that the length of the Wires from the face and the compound's Wire list is different from the Wires list length. The face's wire list got the OuterWire/Wire merged into one Wire.
In order to merge the OuterWire into one Wire in the projection too, I used the following code:
Code: Select all
project = Face2.project([face1])
comp = Part.makeCompound([])
comp.add(project)
comp.Wires
[]
comp.connectEdgesToWires()
tolerance and trying out the Shared=True and =False option
Following is my failing approach to form the longest wire manually:
Code: Select all
outerWire = []
lenOuterWire = len(face.Wires[0].Edges)
for wire in comp.Wires[slice(None, lenOuterWire)]:
outerWire.append(wire)
wire1 = Part.Wire(outerWire)
wire2 = Part.Wire(comp.Wires[slice(lenOuterWire,None)])
wire2.append(wire1)
#Part.OCCError: class Standard_NoSuchObject BRepFill_CompatibleWires::SameNumberByPolarMethod : the wires must be closed
wire1.isClosed()
# prints False
#The other wires are closed
wire1 = Part.Wire(outerWire, closed = True) # didn't raise an error, but still is not closed.
wire = Part.Wire(project.Edges) # leads to Part.OCCError: BRep_API: command not done