From 8ee04c52b06abac057d8171b8f3a8bc460f6e307 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 5 Feb 2022 18:48:40 +0100 Subject: [PATCH] Update Laufbau Signed-off-by: yoyosource --- .../states/ShrinkingOuterPointsState.java | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/states/ShrinkingOuterPointsState.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/states/ShrinkingOuterPointsState.java index dd754e0e..8ee9ed0a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/states/ShrinkingOuterPointsState.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/states/ShrinkingOuterPointsState.java @@ -57,14 +57,34 @@ public class ShrinkingOuterPointsState implements LaufbauState { index++; Point p1 = new Point(point.getX() - 1, point.getY(), point.getZ()); - Point p2 = new Point(point.getX() + 1, point.getY(), point.getZ()); - Point p3 = new Point(point.getX(), point.getY() - 1, point.getZ()); - Point p4 = new Point(point.getX(), point.getY() + 1, point.getZ()); - Point p5 = new Point(point.getX(), point.getY(), point.getZ() - 1); - Point p6 = new Point(point.getX(), point.getY(), point.getZ() + 1); - - if (!(!innerPoints.contains(p1) && !innerPoints.contains(p2) && !innerPoints.contains(p3) && !innerPoints.contains(p4) && !innerPoints.contains(p5) && !innerPoints.contains(p6))) { + if (innerPoints.contains(p1)) { shrunkOuterPoints.add(point); + return; + } + Point p2 = new Point(point.getX() + 1, point.getY(), point.getZ()); + if (innerPoints.contains(p2)) { + shrunkOuterPoints.add(point); + return; + } + Point p3 = new Point(point.getX(), point.getY() - 1, point.getZ()); + if (innerPoints.contains(p3)) { + shrunkOuterPoints.add(point); + return; + } + Point p4 = new Point(point.getX(), point.getY() + 1, point.getZ()); + if (innerPoints.contains(p4)) { + shrunkOuterPoints.add(point); + return; + } + Point p5 = new Point(point.getX(), point.getY(), point.getZ() - 1); + if (innerPoints.contains(p5)) { + shrunkOuterPoints.add(point); + return; + } + Point p6 = new Point(point.getX(), point.getY(), point.getZ() + 1); + if (innerPoints.contains(p6)) { + shrunkOuterPoints.add(point); + return; } } }