cadquery
                                
                                 cadquery copied to clipboard
                                
                                    cadquery copied to clipboard
                            
                            
                            
                        Fuse fails to clean a face that is based on a somewhat tangled wire
- Similar as in CQ SVG export, the wire is created from projected edges using cq.Wire.combine. The result has 7 edges.
- The wire edge order is shown in screenshot, it forms a sort of number "8" loop:

- The wire is then converted to face using cq.Face.makeFromWires - the face looks OK, but the underlying Wire is still tangled
- Further attempts to fuse, combine, clean, etc. fail to clean up the underlying wire.
- Exporting face to brep shows the 7 edges still there in the brep file, however, importBrep appears to clean the wire (!)
- The wire brep seems to be imported with the original 7 edges intact (seems correct).
Attached are both breps for the face and the wire. breps.tar.gz
I also tried to fuse these two faces (illustrated in wireframe)

and the result was a face like this (illustrated in wireframe)

Tested the imports like this
import cadquery as cq
import logging
logger = logging.getLogger(__name__)
face = cq.Face.importBrep('projected_face.brep')
wire = face.outerWire()
wire2 = cq.Face.importBrep('projected_wire.brep')
logger.info(face.Area())
show_object(face, 'face') # Face is correct size
show_object(wire, 'wire') # Clean wire with 4 edges
show_object(wire2, 'wire2') # Tangled wire, OK as expected
I wonder if sortWiresByBuildOrder would help here.
In this case there's only one wire, sortWiresByBuildOrder expects two or more. Under the hood it uses Face.makeFromWires, which does not resolve the issue (step 3 in the original description).
edgesToWires does not change anything either (uses ShapeAnalysis_FreeBounds.ConnectEdgesToWires).