def isIntersectingLoopsPaths(loops, paths, pointBegin, pointEnd):
 normalizedSegment = (pointEnd.dropAxis() - pointBegin.dropAxis())
 normalizedSegmentLength = abs(normalizedSegment)
 if (normalizedSegmentLength == 0.0):
  return False
 normalizedSegment /= normalizedSegmentLength
 segmentYMirror = complex(normalizedSegment.real, (- normalizedSegment.imag))
 pointBeginRotated = euclidean.getRoundZAxisByPlaneAngle(segmentYMirror, pointBegin)
 pointEndRotated = euclidean.getRoundZAxisByPlaneAngle(segmentYMirror, pointEnd)
 if euclidean.isLoopListIntersectingInsideXSegment(loops, pointBeginRotated.real, pointEndRotated.real, segmentYMirror, pointBeginRotated.imag):
  return True
 return euclidean.isXSegmentIntersectingPaths(paths, pointBeginRotated.real, pointEndRotated.real, segmentYMirror, pointBeginRotated.imag)

def isIntersectingLoopsPaths ( loops , paths , pointBegin , pointEnd ) : normalizedSegment = ( pointEnd . dropAxis ( ) - pointBegin . dropAxis ( ) ) normalizedSegmentLength = abs ( normalizedSegment ) if ( normalizedSegmentLength == 0.0 ) : return False normalizedSegment /= normalizedSegmentLength segmentYMirror = complex ( normalizedSegment . real , ( - normalizedSegment . imag ) ) pointBeginRotated = euclidean . getRoundZAxisByPlaneAngle ( segmentYMirror , pointBegin ) pointEndRotated = euclidean . getRoundZAxisByPlaneAngle ( segmentYMirror , pointEnd ) if euclidean . isLoopListIntersectingInsideXSegment ( loops , pointBeginRotated . real , pointEndRotated . real , segmentYMirror , pointBeginRotated . imag ) : return True return euclidean . isXSegmentIntersectingPaths ( paths , pointBeginRotated . real , pointEndRotated . real , segmentYMirror , pointBeginRotated . imag )
determine if the segment between the first and second point is intersecting the loop list .