This commit is contained in:
casperlamboo 2016-04-21 22:50:02 +02:00
parent 386a53849f
commit 00c94f5d67
5 changed files with 13 additions and 18 deletions

View File

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

View File

@ -5,7 +5,7 @@
"lib": "src" "lib": "src"
}, },
"dependencies": { "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", "casperlamboo/EventDispatcher": "github:casperlamboo/EventDispatcher@master",
"three.js": "github:mrdoob/three.js@r72" "three.js": "github:mrdoob/three.js@r72"
}, },

View File

@ -6,8 +6,6 @@ const scale = 100;
export default function generateInfills(slices, settings) { export default function generateInfills(slices, settings) {
console.log("generating infills"); console.log("generating infills");
// need to scale up everything because of clipper rounding errors
let { let {
layerHeight, layerHeight,
fillGridSize, 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.clone().scaleUp(scale).offset(-nozzleRadius);
var outerLine = part.shape.scaleUp(scale).offset(-nozzleRadius, offsetOptions); var outerLine = part.shape.scaleUp(scale).offset(-nozzleRadius, offsetOptions);
if (outerLine.length > 0) {
if (outerLine.paths.length > 0) {
part.outerLine.join(outerLine); part.outerLine.join(outerLine);
for (var shell = 1; shell < shells; shell += 1) { for (var shell = 1; shell < shells; shell += 1) {
@ -35,8 +36,8 @@ export default function generateInnerLines(slices, settings) {
var innerLine = outerLine.offset(-offset, offsetOptions); var innerLine = outerLine.offset(-offset, offsetOptions);
if (innerLine.length > 0) { if (innerLine.paths.length > 0) {
part.innerLines.paths.push(innerLine); part.innerLines.push(innerLine);
} }
else { else {
break; break;

View File

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