Merge pull request #21578 from lagnat/main
CAM: Dragknife dressup adds unnecessary maneuvers
This commit is contained in:
@@ -149,16 +149,17 @@ class ObjectDressup:
|
||||
return myAngle
|
||||
|
||||
def getIncidentAngle(self, queue):
|
||||
# '''returns in the incident angle in radians between the current and previous moves'''
|
||||
# '''returns in the incident angle in degrees between the current and previous moves'''
|
||||
|
||||
angleatend = float(math.degrees(self.segmentAngleXY(queue[2], queue[1], True)))
|
||||
if angleatend < 0:
|
||||
angleatend = 360 + angleatend
|
||||
angleatstart = float(math.degrees(self.segmentAngleXY(queue[1], queue[0])))
|
||||
if angleatstart < 0:
|
||||
angleatstart = 360 + angleatstart
|
||||
|
||||
incident_angle = angleatend - angleatstart
|
||||
incident_angle = (angleatstart - angleatend + 360) % 360
|
||||
|
||||
# The incident can never be greater than 180 degrees. If it is
|
||||
# then we need to measure the other way around the circle.
|
||||
if incident_angle > 180:
|
||||
incident_angle = 360 - incident_angle
|
||||
|
||||
return incident_angle
|
||||
|
||||
|
||||
Reference in New Issue
Block a user