Draft: Bugfix in snapping
This commit is contained in:
parent
88493ec0e5
commit
01d5193296
|
@ -324,16 +324,19 @@ class Snapper:
|
||||||
# calculating the nearest snap point
|
# calculating the nearest snap point
|
||||||
shortest = 1000000000000000000
|
shortest = 1000000000000000000
|
||||||
origin = Vector(self.snapInfo['x'],self.snapInfo['y'],self.snapInfo['z'])
|
origin = Vector(self.snapInfo['x'],self.snapInfo['y'],self.snapInfo['z'])
|
||||||
winner = [Vector(0,0,0),None,Vector(0,0,0)]
|
winner = None
|
||||||
|
fp = point
|
||||||
for snap in snaps:
|
for snap in snaps:
|
||||||
if (not snap) or (snap[0] == None):
|
if (not snap) or (snap[0] == None):
|
||||||
print "debug: Snapper: invalid snap point: ",snaps
|
pass
|
||||||
|
#print "debug: Snapper: invalid snap point: ",snaps
|
||||||
else:
|
else:
|
||||||
delta = snap[0].sub(origin)
|
delta = snap[0].sub(origin)
|
||||||
if delta.Length < shortest:
|
if delta.Length < shortest:
|
||||||
shortest = delta.Length
|
shortest = delta.Length
|
||||||
winner = snap
|
winner = snap
|
||||||
|
|
||||||
|
if winner:
|
||||||
# see if we are out of the max radius, if any
|
# see if we are out of the max radius, if any
|
||||||
if self.radius:
|
if self.radius:
|
||||||
dv = point.sub(winner[2])
|
dv = point.sub(winner[2])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user