Skip to content

Commit

Permalink
Draft: move more functions to draftgeoutils.geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
vocx-fc authored and yorikvanhavre committed Jun 3, 2020
1 parent 85321f2 commit 7b3052f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
11 changes: 1 addition & 10 deletions src/Mod/Draft/DraftGeomUtils.py
Expand Up @@ -113,16 +113,7 @@
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
Expand Down
13 changes: 13 additions & 0 deletions src/Mod/Draft/draftgeoutils/geometry.py
Expand Up @@ -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

0 comments on commit 7b3052f

Please sign in to comment.