Added more cleanup to the pocket shape face before extrusion - greatly improves stability.

This commit is contained in:
Markus Lampert
2017-10-01 13:04:03 -07:00
committed by wmayer
parent f6d4160587
commit af892cc44a
3 changed files with 25 additions and 16 deletions

View File

@@ -100,11 +100,7 @@ class PathGeom:
Return true if the edges start and end at the same point and have the same type of curve.""" % PathGeomTolerance
if type(e0.Curve) != type(e1.Curve):
return False
if not cls.pointsCoincide(e0.valueAt(e0.FirstParameter), e1.valueAt(e1.FirstParameter)):
return False
if not cls.pointsCoincide(e0.valueAt(e0.LastParameter), e1.valueAt(e1.LastParameter)):
return False
return True
return all(cls.pointsCoincide(e0.Vertexes[i].Point, e1.Vertexes[i].Point) for i in range(len(e0.Vertexes)))
@classmethod
def edgeConnectsTo(cls, edge, vector, error=PathGeomTolerance):
@@ -464,3 +460,11 @@ class PathGeom:
shapes = combined
return shapes
@classmethod
def removeDuplicateEdges(cls, wire):
unique = []
for e in wire.Edges:
if not any(cls.edgesMatch(e, u) for u in unique):
unique.append(e)
return Part.Wire(unique)