Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed slicer X/Y aspect ratio bugs related to X/Y pixel density #270

Merged
merged 2 commits into from
Oct 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions host/resourcesnew/cwh/js/printables.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
zscale: 1,
nextSlice: 0,
nextStep: "PerformHeader",
imageManipulationCalculator: null,
affineTransformSettings: {
yflip: false,
xflip: false,
Expand All @@ -71,7 +72,8 @@
xtranslate: 0,
ytranslate: 0,
xshear: 0,
yshear: 0
yshear: 0,
affineTransformScriptCalculator: null
}
};
} else {
Expand Down Expand Up @@ -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;
Expand All @@ -183,6 +186,7 @@
affineTransformSettings.xflip = false;
affineTransformSettings.yflip = false;
affineTransformSettings.rotation = 0;
affineTransformSettings.affineTransformScriptCalculator = null;
this.saveCustomizer();
}

Expand Down
4 changes: 2 additions & 2 deletions host/resourcesnew/printables.html
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,12 @@ <h4>Duplication grid</h4>

</div>
<div class="list-group-item">
<i class="fa fa-2x fa-th-large pull-left"></i>
<i class="fa fa-2x fa-paint-brush pull-left"></i>
<h4>Image Manipulation Calculator</h4>

</div>
<div class="list-group-item">
<i class="fa fa-2x fa-th-large pull-left"></i>
<i class="fa fa-2x fa-map-o pull-left"></i>
<h4>AffineTransform Calculator</h4>

</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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!!!");
}
Expand Down Expand Up @@ -992,7 +992,7 @@ public double getWidthPixels() {
}

public double getHeightPixels() {
return stlFile.getHeight() * pixelsPerMMX;
return stlFile.getHeight() * pixelsPerMMY;
}

public int getZMinIndex() {
Expand Down