def ensure_correct_order(points):
    """
    Ensures the points are in counter-clockwise order.
    If not, it reverses them.
    """
    # Calculate signed area
    n = len(points)
    area = (
        sum(
            (points[i][0] * points[(i + 1) % n][1])
            - (points[(i + 1) % n][0] * points[i][1])
            for i in range(n)
        )
        / 2.0
    )
    # Return the points in reverse order if area is negative
    return points[::-1] if area < 0 else points

    Ensures the points are in counter-clockwise order.
    If not, it reverses them.
    
infinigen/core/constraints/evaluator/indoor_util.py