diff --git a/src/Mod/Draft/DraftGeomUtils.py b/src/Mod/Draft/DraftGeomUtils.py index ac54097671..d125af80e9 100644 --- a/src/Mod/Draft/DraftGeomUtils.py +++ b/src/Mod/Draft/DraftGeomUtils.py @@ -1116,9 +1116,18 @@ def offset(edge,vector,trim=False): def isReallyClosed(wire): "checks if a wire is really closed" - if len(wire.Edges) == len(wire.Vertexes): return True - v1 = wire.Vertexes[0].Point - v2 = wire.Vertexes[-1].Point + + ## TODO yet to find out why not use wire.isClosed() direct, in isReallyClosed(wire) + + # Remark out below - Found not true if a vertex is used again in a wire in sketch ( e.g. wire with shape like 'd', 'b', 'g'... ) + #if len(wire.Edges) == len(wire.Vertexes): return True + + # Found cases where Wire[-1] are not 'last' vertexes (e.g. Part.Wire( Part.__sortEdges__( .toShape() ) ) + # aboveWire.isClosed() == True, but Wire[-1] are the 3rd vertex for the rectangle + # - use Edges[i].Vertexes[0/1] instead + length = len(wire.Edges) + v1 = wire.Edges[0].Vertexes[0].Point #v1 = wire.Vertexes[0].Point + v2 = wire.Edges[length-1].Vertexes[1].Point #v2 = wire.Vertexes[-1].Point if DraftVecUtils.equals(v1,v2): return True return False