Skip to content

Commit

Permalink
Merge pull request #210 from donovan6000/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
donovan6000 authored Jan 9, 2017
2 parents a311f2b + 07de978 commit 352a1ca
Show file tree
Hide file tree
Showing 7 changed files with 856 additions and 845 deletions.
5 changes: 5 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Changelog:

V1.17 January 9, 2017

* Fixed issue where positioning would be messed up when slicing multiple models
* Fixed Windows installer

V1.16 December 27, 2016

* Disables print cancellation dialog if corresponding setting is enabled in OctoPrint >= V1.3.1
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# M33 Fio
© 2015-2016 Exploit Kings. All rights reserved.
© 2015-2017 Exploit Kings. All rights reserved.

### Description
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.

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).
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).

### Features
* Adds a model viewer tab to OctoPrint's interface where any uploaded model can be viewed
Expand Down
Binary file modified installers/Windows/install.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion octoprint_m33fio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Plugin details
__author__ = "donovan6000 <[email protected]>"
__license__ = "GNU General Public License http://www.gnu.org/licenses/gpl.txt"
__copyright__ = "Copyright (C) 2015-2016 Exploit Kings. All rights reserved."
__copyright__ = "Copyright (C) 2015-2017 Exploit Kings. All rights reserved."


# Imports
Expand Down
26 changes: 16 additions & 10 deletions octoprint_m33fio/static/js/m33fio.js
Original file line number Diff line number Diff line change
Expand Up @@ -2985,20 +2985,22 @@ $(function() {
// Clear scene exported
modelEditor.sceneExported = false;

// Initialize variables
var centerX = ((modelEditor.bedOrigin === "lowerleft" ? bedLowMaxX - bedLowMinX : 0) + (-(extruderCenterX - (bedLowMaxX + bedLowMinX) / 2) + bedLowMinX) * 2) / 2;
var centerZ = ((modelEditor.bedOrigin === "lowerleft" ? bedLowMaxY - bedLowMinY : 0) + (extruderCenterY - (bedLowMaxY + bedLowMinY) / 2 + bedLowMinY) * 2) / 2;
// Initialize merged geometry
var mergedGeometry = new THREE.Geometry();

// Create maximums and minimums for the scene
var maximums = new THREE.Vector2(Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY);
var minimums = new THREE.Vector2(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY);

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

// Get current model
var model = modelEditor.models[i];

// Sum model's center together
centerX -= model.mesh.position.x;
centerZ += model.mesh.position.z;
// Update max and min coordinates for the scene
maximums.max(new THREE.Vector2(-model.mesh.position.x, model.mesh.position.z));
minimums.min(new THREE.Vector2(-model.mesh.position.x, model.mesh.position.z));

// Save model's current matrix and geometry
model.mesh.updateMatrix();
Expand Down Expand Up @@ -3034,9 +3036,13 @@ $(function() {
model.mesh.applyMatrix(matrix);
}

// Get average center for models
centerX /= (modelEditor.models.length - 1);
centerZ /= (modelEditor.models.length - 1);
// Set center to average center for models
var centerX = (maximums.x + minimums.x) / 2;
var centerZ = (maximums.y + minimums.y) / 2;

// Offset center based on bed dimensions
centerX += ((modelEditor.bedOrigin === "lowerleft" ? bedLowMaxX - bedLowMinX : 0) + (-(extruderCenterX - (bedLowMaxX + bedLowMinX) / 2) + bedLowMinX) * 2) / 2;
centerZ += ((modelEditor.bedOrigin === "lowerleft" ? bedLowMaxY - bedLowMinY : 0) + (extruderCenterY - (bedLowMaxY + bedLowMinY) / 2 + bedLowMinY) * 2) / 2;

// Save model's center
self.modelCenter = [centerX ? centerX : Number.MIN_VALUE, centerZ ? centerZ : Number.MIN_VALUE];
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
plugin_name = "OctoPrint-M33Fio"

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

# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module
Expand Down
Loading

0 comments on commit 352a1ca

Please sign in to comment.