Draft: Fixed a bug in intersection snapping with arcs
This commit is contained in:
parent
06e77239e6
commit
a7d297c33d
|
@ -111,9 +111,11 @@ def isPtOnEdge(pt,edge) :
|
||||||
# return DraftVecUtils.isNull(newArc.Center.sub(center)) \
|
# return DraftVecUtils.isNull(newArc.Center.sub(center)) \
|
||||||
# and DraftVecUtils.isNull(newArc.Axis-axis) \
|
# and DraftVecUtils.isNull(newArc.Axis-axis) \
|
||||||
# and round(newArc.Radius-radius,precision()) == 0
|
# and round(newArc.Radius-radius,precision()) == 0
|
||||||
angle1 = DraftVecUtils.angle(begin.sub(center))
|
angle1 = -DraftVecUtils.angle(begin.sub(center))
|
||||||
angle2 = DraftVecUtils.angle(end.sub(center))
|
angle2 = -DraftVecUtils.angle(end.sub(center))
|
||||||
anglept = DraftVecUtils.angle(pt.sub(center))
|
anglept = -DraftVecUtils.angle(pt.sub(center))
|
||||||
|
if angle2 < angle1:
|
||||||
|
angle2 = angle2 + math.pi*2
|
||||||
if (angle1 < anglept) and (anglept < angle2):
|
if (angle1 < anglept) and (anglept < angle2):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
@ -341,7 +343,8 @@ def findIntersection(edge1,edge2,infinite1=False,infinite2=False,ex1=False,ex2=F
|
||||||
else :
|
else :
|
||||||
return []
|
return []
|
||||||
|
|
||||||
else : # Line isn't on Arc's plane
|
else :
|
||||||
|
# Line isn't on Arc's plane
|
||||||
if dirVec.dot(arc.Curve.Axis) != 0 :
|
if dirVec.dot(arc.Curve.Axis) != 0 :
|
||||||
toPlane = Vector(arc.Curve.Axis) ; toPlane.normalize()
|
toPlane = Vector(arc.Curve.Axis) ; toPlane.normalize()
|
||||||
d = pt1.dot(toPlane)
|
d = pt1.dot(toPlane)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user