CZT
2023-09-04 fae4bd828a6b81b95f53e285fcb4749fbd80c7bf
igds-core/src/main/java/com/ld/igds/grain/GrainUtil.java
@@ -293,4 +293,57 @@
        return list;
    }
    /**
     * 层行转换--顺时针
     *
     * @param temps
     * @param cable
     * @return
     */
    public List<Double> convertRight(List<Double> temps, String cable) {
        String[] attCable = cable.split("-");
        int cableZ = Integer.valueOf(attCable[0]);
        int cableY = Integer.valueOf(attCable[1]);
        int cableX = Integer.valueOf(attCable[2]);
        List<Double> list = new ArrayList<>();
        int index;
        for (int x = 1; x <= cableX; x++) {
            for(int z = cableZ; z >= 1; z--){
                for (int y = 1; y <= cableY; y++) {
                    index = z*y*x -1;
                    list.add(temps.get(index));
                }
            }
        }
        return list;
    }
    /**
     * 层行转换--逆时针
     *
     * @param temps
     * @param cable
     * @return
     */
    public List<Double> convertLeft(List<Double> temps, String cable) {
        String[] attCable = cable.split("-");
        int cableZ = Integer.valueOf(attCable[0]);
        int cableY = Integer.valueOf(attCable[1]);
        int cableX = Integer.valueOf(attCable[2]);
        List<Double> list = new ArrayList<>();
        int index;
        for (int x = 1; x <= cableX; x++) {
            for (int z = 1; z <= cableZ; z++) {
                for (int y = cableY; y >= cableY; y--) {
                    index = z*y*x -1;
                    list.add(temps.get(index));
                }
            }
        }
        return list;
    }
}