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

Fixes to inch/mm detection #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Next Next commit
Fixes to inch/mm detection
  • Loading branch information
MitchBradley committed Aug 7, 2017

Unverified

This user has not yet uploaded their public signing key.
commit e20ba61f65a657b4850b7353cd1f6b23e5b6f95c
11 changes: 2 additions & 9 deletions widget.js
Original file line number Diff line number Diff line change
@@ -2453,7 +2453,6 @@ cpdefine('inline:com-chilipeppr-widget-3dviewer', ['chilipeppr_ready', 'Three',

this.lastArgs = {cmd: null};
this.lastFeedrate = null;
this.isUnitsMm = true;

this.parseLine = function (text, info) {
var origtext = text;
@@ -3312,16 +3311,14 @@ cpdefine('inline:com-chilipeppr-widget-3dviewer', ['chilipeppr_ready', 'Three',
// However, we need to set a global property so the trinket decorations
// like toolhead, axes, grid, and extent labels are scaled correctly
// later on when they are drawn after the gcode is rendered
console.log("SETTING UNITS TO INCHES!!!");
cofg.isUnitsMm = false; // false means inches cuz default is mm
cofg.setUnits("inch");
},

G21: function () {
// G21: Set Units to Millimeters
// Example: G21
// Units from now on are in millimeters. (This is the RepRap default.)
console.log("SETTING UNITS TO MM!!!");
cofg.isUnitsMm = true; // true means mm
cofg.setUnits("mm");
},

// A bunch of no-op modes that do not affect the viewer
@@ -3418,10 +3415,6 @@ cpdefine('inline:com-chilipeppr-widget-3dviewer', ['chilipeppr_ready', 'Three',

parser.parse(gcode);

// set what units we're using in the gcode
//console.log('setting units from parser to 3dviewer. parser:', parser, "this:", this);
this.isUnitsMm = parser.isUnitsMm;

console.log("inside creatGcodeFromObject. this:", this);
console.log("Layer Count ", layers.length);