This commit is contained in:
casperlamboo 2016-04-21 22:50:02 +02:00 committed by Simon Voordouw
parent f1475e8b97
commit 3f43477ef6
5 changed files with 13 additions and 18 deletions

View File

@ -16,14 +16,14 @@ System.config({
},
map: {
"Doodle3D/clipper-js": "github:Doodle3D/clipper-js@0.0.2",
"Doodle3D/clipper-js": "github:Doodle3D/clipper-js@master",
"babel": "npm:babel-core@5.8.38",
"babel-runtime": "npm:babel-runtime@5.8.38",
"casperlamboo/EventDispatcher": "github:casperlamboo/EventDispatcher@master",
"core-js": "npm:core-js@0.9.18",
"json": "github:systemjs/plugin-json@0.1.0",
"three.js": "github:mrdoob/three.js@r72",
"github:Doodle3D/clipper-js@0.0.2": {
"github:Doodle3D/clipper-js@master": {
"clipper-lib": "npm:clipper-lib@1.0.0"
},
"github:jspm/nodelibs-assert@0.1.0": {

View File

@ -5,7 +5,7 @@
"lib": "src"
},
"dependencies": {
"Doodle3D/clipper-js": "github:Doodle3D/clipper-js@^0.0.2",
"Doodle3D/clipper-js": "github:Doodle3D/clipper-js@master",
"casperlamboo/EventDispatcher": "github:casperlamboo/EventDispatcher@master",
"three.js": "github:mrdoob/three.js@r72"
},

View File

@ -6,8 +6,6 @@ const scale = 100;
export default function generateInfills(slices, settings) {
console.log("generating infills");
// need to scale up everything because of clipper rounding errors
let {
layerHeight,
fillGridSize,

View File

@ -27,7 +27,8 @@ export default function generateInnerLines(slices, settings) {
// var outerLine = part.shape.clone().scaleUp(scale).offset(-nozzleRadius);
var outerLine = part.shape.scaleUp(scale).offset(-nozzleRadius, offsetOptions);
if (outerLine.length > 0) {
if (outerLine.paths.length > 0) {
part.outerLine.join(outerLine);
for (var shell = 1; shell < shells; shell += 1) {
@ -35,8 +36,8 @@ export default function generateInnerLines(slices, settings) {
var innerLine = outerLine.offset(-offset, offsetOptions);
if (innerLine.length > 0) {
part.innerLines.paths.push(innerLine);
if (innerLine.paths.length > 0) {
part.innerLines.push(innerLine);
}
else {
break;

View File

@ -104,23 +104,22 @@ export default class extends EventDispatcher {
this.progress.generatedGCode = true;
this._updateProgress(settings);
this.dispatchEvent({
type: 'finish',
gcode
});
this.dispatchEvent({ type: 'finish', gcode });
console.log(slices);
return gcode;
}
_updateProgress (settings) {
var supportEnabled = settings.config["supportEnabled"];
var supportEnabled = settings.config['supportEnabled'];
var progress = {};
var procent = 0;
var length = 0;
for (var i in this.progress) {
if (!(!supportEnabled && i === "generatedSupport")) {
if (!(!supportEnabled && i === 'generatedSupport')) {
progress[i] = this.progress[i];
if (progress[i]) {
procent += 1;
@ -131,9 +130,6 @@ export default class extends EventDispatcher {
progress.procent = procent / length;
this.dispatchEvent({
type: 'progress',
progress
});
this.dispatchEvent({ type: 'progress', progress });
}
}