def METHOD_NAME(self, basepath, islandpath):
    # find first intersecting segment
    first = None
    for i, segment in enumerate(islandpath):
        if basepath.isInside(segment.midPoint()):
            first = i
    if first is None:
        print("not intersecting paths")
        return None
    # generate intersected path
    newisland = Path("new")
    A = None
    for i in range(first, 2 * len(islandpath) + first):
        j = i % len(islandpath)
        segment = islandpath[j]
        if segment.length() < EPS:
            continue  # ignore zero length segments
        if not basepath.isInside(segment.midPoint()):
            if A is None:
                A = segment.A
        else:
            if A is not None:
                newisland.extend(self.findSubpath(basepath, A, segment.A))
                print("new", newisland)
                A = None
            newisland.append(segment)
    print("new2", newisland)
    return newisland