def _EnforceMaximumDinstance(self, headSurfacePoint, uiPin): SAFETYFACTOR = 0.99 ecuSurfacePoint = uiPin.surfacePoint distance = headSurfacePoint.GetDistanceToOther(ecuSurfacePoint) areaOfInfluence = uiPin.pin.GetAreaOfInfluence() if distance < areaOfInfluence * SAFETYFACTOR: return distance / areaOfInfluence ecuVector = ecuSurfacePoint.GetAsXYZTuple() v = headSurfacePoint.GetAsXYZTuple() normal = geo2.Vec3Cross(ecuVector, v) rotMat = geo2.MatrixRotationAxis(normal, areaOfInfluence * SAFETYFACTOR) newV = geo2.Multiply(rotMat, ecuVector) headSurfacePoint.SetXYZ(*newV[:3]) return 1.0
def PlaceProbeAtDefaultPosition(self, headID): OFFSET = 0.08 VEC_X = (-1, 0, 0) rotAngle = float(headID) / planetCommon.ECU_MAX_HEADS * 2 * math.pi ecuVector = self.planetUISvc.myPinManager.pinsByID[ self.pin.id].surfacePoint.GetAsXYZTuple() normal = geo2.Vec3Cross(ecuVector, VEC_X) normal = geo2.Vector(*normal) * OFFSET posVec = geo2.Vec3Subtract(ecuVector, normal) posVec = geo2.Vec3Normalize(posVec) rotMat = geo2.MatrixRotationAxis(ecuVector, rotAngle) posVec = geo2.Multiply(rotMat, posVec) surfacePoint = SurfacePoint(*posVec) self.planetUISvc.myPinManager.PlaceExtractionHead( self.pin.id, headID, surfacePoint, self.currentRadius) self.UpdateHeadPosition(headID, surfacePoint)
def _EnforceMaximumDinstance(self, headSurfacePoint, uiPin): """ If the distance between the points is greater than the maximum, we snap headSurfacePoint to the max distance circle and return 1.0. Otherwise, we return the current distance factor [0.0-1.0] """ SAFETYFACTOR = 0.99 ecuSurfacePoint = uiPin.surfacePoint distance = headSurfacePoint.GetDistanceToOther(ecuSurfacePoint) areaOfInfluence = uiPin.pin.GetAreaOfInfluence() if distance < areaOfInfluence * SAFETYFACTOR: return distance / areaOfInfluence ecuVector = ecuSurfacePoint.GetAsXYZTuple() v = headSurfacePoint.GetAsXYZTuple() normal = geo2.Vec3Cross(ecuVector, v) rotMat = geo2.MatrixRotationAxis(normal, areaOfInfluence * SAFETYFACTOR) newV = geo2.Multiply(rotMat, ecuVector) headSurfacePoint.SetXYZ(*newV[:3]) return 1.0