Merge branch 'master' into kiri-mesh-animate2
This commit is contained in:
commit
bbbcb7b5d1
3 changed files with 28 additions and 1 deletions
|
|
@ -784,9 +784,11 @@ FDM.prepare = async function(widgets, settings, update) {
|
||||||
function slicePrintPath(print, slice, startPoint, offset, output, opt = {}) {
|
function slicePrintPath(print, slice, startPoint, offset, output, opt = {}) {
|
||||||
const { settings } = print;
|
const { settings } = print;
|
||||||
const { device } = settings;
|
const { device } = settings;
|
||||||
|
const { bedWidth, bedDepth, bedRound } = device;
|
||||||
|
|
||||||
let preout = [],
|
let preout = [],
|
||||||
process = opt.params || settings.process,
|
process = opt.params || settings.process,
|
||||||
|
originCenter = process.outputOriginCenter || bedRound,
|
||||||
extruder = slice.extruder || 0,
|
extruder = slice.extruder || 0,
|
||||||
nozzleSize = process.sliceLineWidth || device.extruders[extruder].extNozzle,
|
nozzleSize = process.sliceLineWidth || device.extruders[extruder].extNozzle,
|
||||||
firstLayer = opt.first || false,
|
firstLayer = opt.first || false,
|
||||||
|
|
@ -810,6 +812,15 @@ function slicePrintPath(print, slice, startPoint, offset, output, opt = {}) {
|
||||||
antiBacklash = process.antiBacklash,
|
antiBacklash = process.antiBacklash,
|
||||||
wipeDist = process.outputRetractWipe || 0,
|
wipeDist = process.outputRetractWipe || 0,
|
||||||
isBelt = device.bedBelt,
|
isBelt = device.bedBelt,
|
||||||
|
bedOffset = originCenter ? {
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
z: 0
|
||||||
|
} : {
|
||||||
|
x: bedWidth/2,
|
||||||
|
y: isBelt ? 0 : bedDepth/2,
|
||||||
|
z: 0
|
||||||
|
},
|
||||||
beltFirst = process.outputBeltFirst || false,
|
beltFirst = process.outputBeltFirst || false,
|
||||||
startClone = startPoint.clone(),
|
startClone = startPoint.clone(),
|
||||||
seedPoint = opt.seedPoint || startPoint,
|
seedPoint = opt.seedPoint || startPoint,
|
||||||
|
|
@ -1376,11 +1387,24 @@ function slicePrintPath(print, slice, startPoint, offset, output, opt = {}) {
|
||||||
switch (process.sliceLayerStart) {
|
switch (process.sliceLayerStart) {
|
||||||
case "last":
|
case "last":
|
||||||
break;
|
break;
|
||||||
|
case "random":
|
||||||
|
let bounds = top.poly.bounds;
|
||||||
|
let center = bounds.center();
|
||||||
|
let radius = Math.max(bounds.width(), bounds.height());
|
||||||
|
let angle = Math.random()*Math.PI*2;
|
||||||
|
let x = center.x + Math.cos(angle)*radius;
|
||||||
|
let y = center.y + Math.sin(angle)*radius;
|
||||||
|
startPoint = newPoint(x,y,startPoint.z);
|
||||||
|
break;
|
||||||
case "center":
|
case "center":
|
||||||
startPoint = newPoint(0,0,startPoint.z);
|
startPoint = newPoint(0,0,startPoint.z);
|
||||||
break;
|
break;
|
||||||
case "origin":
|
case "origin":
|
||||||
startPoint = origin.clone();
|
startPoint = newPoint(-bedOffset.x, -bedOffset.y, startPoint.z);
|
||||||
|
break;
|
||||||
|
case "position":
|
||||||
|
startPoint = newPoint(-bedOffset.x+process.sliceLayerStartX, -bedOffset.y+process.sliceLayerStartY, startPoint.z);
|
||||||
|
console.log("startPoint", top);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -302,6 +302,8 @@ const conf = exports({
|
||||||
sliceShells: 3,
|
sliceShells: 3,
|
||||||
sliceShellOrder: "in-out",
|
sliceShellOrder: "in-out",
|
||||||
sliceLayerStart: "last",
|
sliceLayerStart: "last",
|
||||||
|
sliceLayerStartX: 0,
|
||||||
|
sliceLayerStartY: 0,
|
||||||
sliceLineWidth: 0,
|
sliceLineWidth: 0,
|
||||||
sliceFillGrow: 0,
|
sliceFillGrow: 0,
|
||||||
sliceFillAngle: 45,
|
sliceFillAngle: 45,
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ const LISTS = {
|
||||||
{ name: "last" },
|
{ name: "last" },
|
||||||
{ name: "center" },
|
{ name: "center" },
|
||||||
{ name: "origin" },
|
{ name: "origin" },
|
||||||
|
{ name: "random" },
|
||||||
],
|
],
|
||||||
infill: [
|
infill: [
|
||||||
{ name: "hex" },
|
{ name: "hex" },
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue