def METHOD_NAME(normalVector, aMin=-360, aMax=360, cMin=-360, cMax=360, compound=False):
    """
    Generates Gcode rotation to align a vector (alignVector) with the positive Z axis.
    It first rotates around the Z axis (C rotation)
    to align the vector the positive Y axis. Then around the X axis
    (A rotation).
    The min and max arguments dictate the range of motion allowed rotation in
    the respective axis.
    Default assumes continuous rotation.
    Returns a list of path commands for the shortest valid solution
    If compound is False, axis moves will be broken out to individual commands
    The normalVector input from a typical face (f) can be obtained like this:
        u, v = f.ParameterRange[:2]
        n = f.normalAt(u,v)
        plm = obj.getGlobalPlacement()
        rot = plm.Rotation
        normalVector = rot.multVec(n
    """
    Path.Log.track(
        "\n=============\n normalVector: {}\n aMin: {}\n aMax: {}\n cMin: {}\n cMax: {}".format(
            normalVector, aMin, aMax, cMin, cMax
        )
    )
    # Calculate C rotation
    cResults = __getCRotation(normalVector, cMin, cMax)
    Path.Log.debug("C Rotation results {}".format(cResults))
    solutions = []
    for result in cResults:
        # calculate a new vector based on the result
        rot = FreeCAD.Rotation(FreeCAD.Vector(0, 0, 1), result)
        newvec = rot.multVec(normalVector)
        # Get the candidate A rotation for the new vector
        aResult = __getARotation(newvec, aMin, aMax)
        Path.Log.debug(
            "\n=====\nFor C Rotation: {}\n Calculated A {}\n".format(result, aResult)
        )
        if aResult is not None:
            solutions.append({"A": aResult, "C": result})
    if len(solutions) == 0:  # No valid solution found
        raise ValueError("No valid rotation solution found")
    # find pose with the shortest transit length
    best = solutions[0]
    curlen = math.fabs(best["A"]) + math.fabs(best["C"])
    for solution in solutions[1:]:
        testlen = math.fabs(solution["A"]) + math.fabs(solution["C"])
        if testlen < curlen:
            best = solution
            curlen = testlen
    Path.Log.debug("best result: {}".format(best))
    # format and return rotation commands
    commands = []
    if compound:
        commands.append(Path.Command("G0", best))
    else:
        for key, val in best.items():
            print(key, val)
            commands.append(Path.Command("G0", {key: val}))
    return commands