Skip to content

Commit 352a1ca

Browse files
authored
Merge pull request #210 from donovan6000/devel
Devel
2 parents a311f2b + 07de978 commit 352a1ca

7 files changed

Lines changed: 856 additions & 845 deletions

File tree

Changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
Changelog:
22

3+
V1.17 January 9, 2017
4+
5+
* Fixed issue where positioning would be messed up when slicing multiple models
6+
* Fixed Windows installer
7+
38
V1.16 December 27, 2016
49

510
* Disables print cancellation dialog if corresponding setting is enabled in OctoPrint >= V1.3.1

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# M33 Fio
2-
© 2015-2016 Exploit Kings. All rights reserved.
2+
© 2015-2017 Exploit Kings. All rights reserved.
33

44
### Description
55
M33 Fio is a general purpose plugin for [OctoPrint](http://octoprint.org/) that extends its capabilities to include many useful feature like the ability to use a Micro 3D printer, modify a model before printing it, host a webcam stream, and much more.
66

7-
The latest version of M33 Fio is V1.16 released on December 27th, 2016, and an entire changelog for it can be found [here](https://raw.githubusercontent.com/donovan6000/M33-Fio/master/Changelog).
7+
The latest version of M33 Fio is V1.17 released on January 9th, 2017, and an entire changelog for it can be found [here](https://raw.githubusercontent.com/donovan6000/M33-Fio/master/Changelog).
88

99
### Features
1010
* Adds a model viewer tab to OctoPrint's interface where any uploaded model can be viewed

installers/Windows/install.zip

100 Bytes
Binary file not shown.

octoprint_m33fio/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Plugin details
66
__author__ = "donovan6000 <donovan6000@exploitkings.com>"
77
__license__ = "GNU General Public License http://www.gnu.org/licenses/gpl.txt"
8-
__copyright__ = "Copyright (C) 2015-2016 Exploit Kings. All rights reserved."
8+
__copyright__ = "Copyright (C) 2015-2017 Exploit Kings. All rights reserved."
99

1010

1111
# Imports

octoprint_m33fio/static/js/m33fio.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2985,20 +2985,22 @@ $(function() {
29852985
// Clear scene exported
29862986
modelEditor.sceneExported = false;
29872987

2988-
// Initialize variables
2989-
var centerX = ((modelEditor.bedOrigin === "lowerleft" ? bedLowMaxX - bedLowMinX : 0) + (-(extruderCenterX - (bedLowMaxX + bedLowMinX) / 2) + bedLowMinX) * 2) / 2;
2990-
var centerZ = ((modelEditor.bedOrigin === "lowerleft" ? bedLowMaxY - bedLowMinY : 0) + (extruderCenterY - (bedLowMaxY + bedLowMinY) / 2 + bedLowMinY) * 2) / 2;
2988+
// Initialize merged geometry
29912989
var mergedGeometry = new THREE.Geometry();
2990+
2991+
// Create maximums and minimums for the scene
2992+
var maximums = new THREE.Vector2(Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY);
2993+
var minimums = new THREE.Vector2(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY);
29922994

29932995
// Go through all models
29942996
for(var i = 1; i < modelEditor.models.length; i++) {
29952997

29962998
// Get current model
29972999
var model = modelEditor.models[i];
2998-
2999-
// Sum model's center together
3000-
centerX -= model.mesh.position.x;
3001-
centerZ += model.mesh.position.z;
3000+
3001+
// Update max and min coordinates for the scene
3002+
maximums.max(new THREE.Vector2(-model.mesh.position.x, model.mesh.position.z));
3003+
minimums.min(new THREE.Vector2(-model.mesh.position.x, model.mesh.position.z));
30023004

30033005
// Save model's current matrix and geometry
30043006
model.mesh.updateMatrix();
@@ -3034,9 +3036,13 @@ $(function() {
30343036
model.mesh.applyMatrix(matrix);
30353037
}
30363038

3037-
// Get average center for models
3038-
centerX /= (modelEditor.models.length - 1);
3039-
centerZ /= (modelEditor.models.length - 1);
3039+
// Set center to average center for models
3040+
var centerX = (maximums.x + minimums.x) / 2;
3041+
var centerZ = (maximums.y + minimums.y) / 2;
3042+
3043+
// Offset center based on bed dimensions
3044+
centerX += ((modelEditor.bedOrigin === "lowerleft" ? bedLowMaxX - bedLowMinX : 0) + (-(extruderCenterX - (bedLowMaxX + bedLowMinX) / 2) + bedLowMinX) * 2) / 2;
3045+
centerZ += ((modelEditor.bedOrigin === "lowerleft" ? bedLowMaxY - bedLowMinY : 0) + (extruderCenterY - (bedLowMaxY + bedLowMinY) / 2 + bedLowMinY) * 2) / 2;
30403046

30413047
// Save model's center
30423048
self.modelCenter = [centerX ? centerX : Number.MIN_VALUE, centerZ ? centerZ : Number.MIN_VALUE];

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
plugin_name = "OctoPrint-M33Fio"
1515

1616
# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
17-
plugin_version = "1.16"
17+
plugin_version = "1.17"
1818

1919
# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
2020
# module

0 commit comments

Comments
 (0)