Draft: move more functions to draftgeoutils.geometry

This commit is contained in:
vocx-fc
2020-05-31 02:54:04 -05:00
committed by Yorik van Havre
parent 85321f28da
commit 7b3052fd76
2 changed files with 14 additions and 10 deletions

View File

@@ -113,16 +113,7 @@ from draftgeoutils.offsets import pocket2d
from draftgeoutils.edges import orientEdge
def mirror(point, edge):
"""Find mirror point relative to an edge."""
normPoint = point.add(findDistance(point, edge, False))
if normPoint:
normPoint_point = Vector.sub(point, normPoint)
normPoint_refl = normPoint_point.negative()
refl = Vector.add(normPoint, normPoint_refl)
return refl
else:
return None
from draftgeoutils.geometry import mirror
from draftgeoutils.arcs import isClockwise

View File

@@ -319,3 +319,16 @@ def calculatePlacement(shape):
pla.Rotation = r
return pla
def mirror(point, edge):
"""Find mirror point relative to an edge."""
normPoint = point.add(findDistance(point, edge, False))
if normPoint:
normPoint_point = FreeCAD.Vector.sub(point, normPoint)
normPoint_refl = normPoint_point.negative()
refl = FreeCAD.Vector.add(normPoint, normPoint_refl)
return refl
else:
return None