diff --git a/host/resourcesnew/cwh/js/printables.js b/host/resourcesnew/cwh/js/printables.js
index d3032ec11..fe3eb379e 100644
--- a/host/resourcesnew/cwh/js/printables.js
+++ b/host/resourcesnew/cwh/js/printables.js
@@ -62,6 +62,7 @@
zscale: 1,
nextSlice: 0,
nextStep: "PerformHeader",
+ imageManipulationCalculator: null,
affineTransformSettings: {
yflip: false,
xflip: false,
@@ -71,7 +72,8 @@
xtranslate: 0,
ytranslate: 0,
xshear: 0,
- yshear: 0
+ yshear: 0,
+ affineTransformScriptCalculator: null
}
};
} else {
@@ -172,7 +174,8 @@
controller.currentCustomizer.zscale = 1.0;
controller.currentCustomizer.nextSlice = 0;
controller.currentCustomizer.nextStep = "PerformHeader";
-
+ controller.currentCustomizer.imageManipulationCalculator = null;
+
var affineTransformSettings = controller.currentCustomizer.affineTransformSettings;
affineTransformSettings.xtranslate = 0;
affineTransformSettings.ytranslate = 0;
@@ -183,6 +186,7 @@
affineTransformSettings.xflip = false;
affineTransformSettings.yflip = false;
affineTransformSettings.rotation = 0;
+ affineTransformSettings.affineTransformScriptCalculator = null;
this.saveCustomizer();
}
diff --git a/host/resourcesnew/printables.html b/host/resourcesnew/printables.html
index 31fd6b989..30f0eb564 100644
--- a/host/resourcesnew/printables.html
+++ b/host/resourcesnew/printables.html
@@ -260,12 +260,12 @@
Duplication grid
-
+
Image Manipulation Calculator
-
+
AffineTransform Calculator
diff --git a/host/src/main/java/org/area515/resinprinter/services/PrinterService.java b/host/src/main/java/org/area515/resinprinter/services/PrinterService.java
index 7a4798995..2ef423baf 100644
--- a/host/src/main/java/org/area515/resinprinter/services/PrinterService.java
+++ b/host/src/main/java/org/area515/resinprinter/services/PrinterService.java
@@ -444,7 +444,7 @@ PrinterConfiguration createTemplatePrinter(String printername, String displayId,
TwoDimensionalSettings settings = new TwoDimensionalSettings();
settings.setFont(DEFAULT_FONT);
- settings.setPlatformCalculator("platformGraphics.fillRoundRect(centerX - (extrusionX / 2), centerY - (extrusionY / 2), extrusionX, extrusionY, 50, 50);");
+ settings.setPlatformCalculator("var extrusionX = printImage.getWidth();\nvar extrusionY = printImage.getHeight();\nplatformGraphics.fillRoundRect(centerX - (extrusionX / 2), centerY - (extrusionY / 2), extrusionX, extrusionY, 50, 50);");
settings.setExtrusionHeightMM(1.5);
settings.setPlatformHeightMM(1.5);
settings.setEdgeDetectionDisabled(false);
diff --git a/host/src/main/java/org/area515/resinprinter/slice/ZSlicer.java b/host/src/main/java/org/area515/resinprinter/slice/ZSlicer.java
index e6636b2ce..8126be638 100644
--- a/host/src/main/java/org/area515/resinprinter/slice/ZSlicer.java
+++ b/host/src/main/java/org/area515/resinprinter/slice/ZSlicer.java
@@ -478,9 +478,9 @@ public void debugPaintSlice(Graphics2D g) {
g.setColor(Color.magenta);
Point3d point = (Point3d)shape;
g.drawLine((int)(point.x / (precisionScaler) * pixelsPerMMX + imageOffsetX),
- (int)(point.y / (precisionScaler) * pixelsPerMMY + imageOffsetX),
+ (int)(point.y / (precisionScaler) * pixelsPerMMY + imageOffsetY),
(int)(point.x / (precisionScaler) * pixelsPerMMX + imageOffsetX),
- (int)(point.y / (precisionScaler) * pixelsPerMMY + imageOffsetX));
+ (int)(point.y / (precisionScaler) * pixelsPerMMY + imageOffsetY));
} else {
logger.debug("No intersection. WRONG!!!");
}
@@ -992,7 +992,7 @@ public double getWidthPixels() {
}
public double getHeightPixels() {
- return stlFile.getHeight() * pixelsPerMMX;
+ return stlFile.getHeight() * pixelsPerMMY;
}
public int getZMinIndex() {