Open voneiden opened 2 years ago
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).
1) Similar as in CQ SVG export, the wire is created from projected edges using cq.Wire.combine. The result has 7 edges. 2) The wire edge order is shown in screenshot, it forms a sort of number "8" loop:
3) The wire is then converted to face using cq.Face.makeFromWires - the face looks OK, but the underlying Wire is still tangled 4) Further attempts to fuse, combine, clean, etc. fail to clean up the underlying wire. 5) Exporting face to brep shows the 7 edges still there in the brep file, however, importBrep appears to clean the wire (!) 6) 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