Merge pull request #7821 from Roy-043/Draft-fix-arcFromSpline

Draft: fix arcFromSpline midpoint bug
This commit is contained in:
Yorik van Havre
2022-11-21 13:30:46 +01:00
committed by GitHub

View File

@@ -33,6 +33,7 @@ import FreeCAD as App
import DraftVecUtils
from draftgeoutils.general import geomType
from draftgeoutils.edges import findMidpoint
# Delay import of module until first use because it is heavy
Part = lz.LazyLoader("Part", globals(), "Part")
@@ -134,8 +135,7 @@ def arcFromSpline(edge):
else:
# circle
p1 = edge.Vertexes[0].Point
ml = edge.Length/2
p2 = edge.valueAt(ml)
p2 = findMidpoint(edge)
ray = p2.sub(p1)
ray.scale(0.5, 0.5, 0.5)
center = p1.add(ray)