I am sure you had fixed the issue, thanks to your works
However, this maybe a cornercase it is not working? Kind of random in the result for different Wall Width...
Quick study of the faces.py, and test of below for reference @Roy_043.
As the edges are sorted by Part.getSortedClusters(skGeomEdges), Edge5 is apparently sorted after Edge4 resulting in a 5 edges wire, resulting in the awkward projection in the lower-left corner. User intervention, e.g. selection and exclusion of the diagonal lines in the Part sorting mechanism, may be required.
for (edge1, edge2) in zip(w1.Edges, w2.Edges):
face = create_face(edge1, edge2)
if face is None:
return None
## TODO Paul 2023.1.1
Part.show(face)
faces.append(face)
I was a little surprised to see that sketches are handled separately (and differently). If you create a PartDesign_SubShapeBinder from the sketch and use that as the base for a wall you get a different result (only the 4 orthogonal edges are then used). Maybe create an issue on GitHub for this?
Another strange and unexpected issue is that the Shape of the Sketch only has a single wire with 6 edges.
def bind(w1, w2, per_segment=False):
"""Bind 2 wires by their endpoints and returns a face.
...
"""
## TODO Paul 2023.1.1
Part.show(w1)
Part.show(w2)
A side remarks : These 2 looks like 2 closed profiles, but the last 2 opposite segment, in 'reverse' direction, created the 'self-intersecting' wire and non-closed faces, make the 'per-segment' mechanism not good to tackle this case.
Roy_043 wrote: ↑Sun Jan 01, 2023 10:52 am
I was a little surprised to see that sketches are handled separately (and differently). If you create a PartDesign_SubShapeBinder from the sketch and use that as the base for a wall you get a different result (only the 4 orthogonal edges are then used). Maybe create an issue on GitHub for this?
Another strange and unexpected issue is that the Shape of the Sketch only has a single wire with 6 edges.
In ArchWall, Sketch Edges get Part.getSortedClusters(Sketch Edges), which find connected edges - in this cases 2 wires : 5 edges, and 1 edge. This is one way how Yorik make ArchWall works; alternative is just use Sketch.Shape.Wires. Long story behind.
Can you show the workflow of PartDesign_SubShapeBinder ?
EDIT - Indeed, the Sketch has single wire of 6 edges (final edge disconnected ! ) ? See screencapture / File
def offsetWire(wire, dvec, bind=False, occ=False,
....
closed = wire.isClosed()
# should use Draft isReallyClosed()
It should return 'False' for this wire (4 edges rectangle with diagonal edges), but it return 'True'.
Notwithstanding that, Part.getSortedClusters(Sketch Edges) would group one of the diagonal into 1st wire as they can be understood connected, the algorithm would still result in funny projection on the lower-left corner if without user intervention.