mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-11-22 21:47:59 +01:00
Merge branch 'develop'
This commit is contained in:
commit
eb6747a49c
@ -35,7 +35,6 @@ innerLine:
|
|||||||
fill:
|
fill:
|
||||||
flowRate: 1.0
|
flowRate: 1.0
|
||||||
speed: 50.0
|
speed: 50.0
|
||||||
overlap: 0.0
|
|
||||||
gridSize: 5.0
|
gridSize: 5.0
|
||||||
brim:
|
brim:
|
||||||
flowRate: 1.0
|
flowRate: 1.0
|
||||||
|
@ -8,8 +8,7 @@ export default function generateInfills(slices, settings) {
|
|||||||
fill: { gridSize: fillGridSize },
|
fill: { gridSize: fillGridSize },
|
||||||
bottom: { thickness: bottomThickness },
|
bottom: { thickness: bottomThickness },
|
||||||
top: { thickness: topThickness },
|
top: { thickness: topThickness },
|
||||||
nozzleDiameter,
|
nozzleDiameter
|
||||||
fill: { overlap: infillOverlap }
|
|
||||||
} = settings;
|
} = settings;
|
||||||
|
|
||||||
fillGridSize /= PRECISION;
|
fillGridSize /= PRECISION;
|
||||||
@ -47,13 +46,7 @@ export default function generateInfills(slices, settings) {
|
|||||||
let lowFillArea;
|
let lowFillArea;
|
||||||
let highFillArea;
|
let highFillArea;
|
||||||
if (surroundingLayer) {
|
if (surroundingLayer) {
|
||||||
highFillArea = fillArea.difference(surroundingLayer);
|
highFillArea = fillArea.difference(surroundingLayer).intersect(fillArea);
|
||||||
|
|
||||||
if (infillOverlap > 0) {
|
|
||||||
highFillArea = highFillArea.offset(infillOverlap);
|
|
||||||
}
|
|
||||||
|
|
||||||
highFillArea = highFillArea.intersect(fillArea);
|
|
||||||
lowFillArea = fillArea.difference(highFillArea);
|
lowFillArea = fillArea.difference(highFillArea);
|
||||||
} else {
|
} else {
|
||||||
highFillArea = fillArea;
|
highFillArea = fillArea;
|
||||||
|
@ -32,7 +32,8 @@ export default function generateInnerLines(slices, settings) {
|
|||||||
if (outerLine.paths.length > 0) {
|
if (outerLine.paths.length > 0) {
|
||||||
part.outerLine.join(outerLine);
|
part.outerLine.join(outerLine);
|
||||||
|
|
||||||
for (let shell = 1; shell <= shells; shell += 1) {
|
// start with 1 because outerLine is the 1st (0) shell
|
||||||
|
for (let shell = 1; shell < shells; shell += 1) {
|
||||||
const offset = shell * nozzleDiameter;
|
const offset = shell * nozzleDiameter;
|
||||||
|
|
||||||
const innerLine = outerLine.offset(-offset, offsetOptions);
|
const innerLine = outerLine.offset(-offset, offsetOptions);
|
||||||
|
@ -107,7 +107,7 @@ export default class {
|
|||||||
const lineLength = this._nozzlePosition.distanceTo(newNozzlePosition);
|
const lineLength = this._nozzlePosition.distanceTo(newNozzlePosition);
|
||||||
|
|
||||||
const filamentSurfaceArea = Math.pow((filamentThickness / 2), 2) * Math.PI;
|
const filamentSurfaceArea = Math.pow((filamentThickness / 2), 2) * Math.PI;
|
||||||
this._extruder += lineLength * nozzleDiameter * layerHeight / filamentSurfaceArea * flowRate;
|
this._extruder += lineLength * ((nozzleDiameter * layerHeight) / filamentSurfaceArea) * flowRate;
|
||||||
|
|
||||||
this._addGCode({
|
this._addGCode({
|
||||||
[MOVE]: 1,
|
[MOVE]: 1,
|
||||||
@ -164,7 +164,7 @@ export default class {
|
|||||||
|
|
||||||
const speed = retractionSpeed * 60;
|
const speed = retractionSpeed * 60;
|
||||||
|
|
||||||
if (this._extruder > retractionMinDistance && retractionEnabled) {
|
if (this._extruder > retractionMinDistance) {
|
||||||
this._addGCode({
|
this._addGCode({
|
||||||
[MOVE]: 0,
|
[MOVE]: 0,
|
||||||
[EXTRUDER]: (this._extruder - retractionAmount).toFixed(3),
|
[EXTRUDER]: (this._extruder - retractionAmount).toFixed(3),
|
||||||
|
@ -13,6 +13,15 @@ export default function optimizePaths(slices, settings) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const parts = [];
|
const parts = [];
|
||||||
|
const boundingBoxes = new WeakMap();
|
||||||
|
for (let i = 0; i < slice.parts.length; i ++) {
|
||||||
|
const part = slice.parts[i];
|
||||||
|
|
||||||
|
const shape = part.shape.closed ? part.outerLine : part.shape;
|
||||||
|
const bounds = shape.shapeBounds();
|
||||||
|
|
||||||
|
boundingBoxes.set(part, bounds);
|
||||||
|
}
|
||||||
|
|
||||||
while (slice.parts.length > 0) {
|
while (slice.parts.length > 0) {
|
||||||
let closestDistance = Infinity;
|
let closestDistance = Infinity;
|
||||||
@ -20,16 +29,14 @@ export default function optimizePaths(slices, settings) {
|
|||||||
|
|
||||||
for (let i = 0; i < slice.parts.length; i ++) {
|
for (let i = 0; i < slice.parts.length; i ++) {
|
||||||
const part = slice.parts[i];
|
const part = slice.parts[i];
|
||||||
|
const bounds = boundingBoxes.get(part);
|
||||||
|
|
||||||
const shape = part.shape.closed ? part.outerLine : part.shape;
|
const topDistance = bounds.top - start.y;
|
||||||
const bounds = shape.shapeBounds();
|
const bottomDistance = start.y - bounds.bottom;
|
||||||
|
const leftDistance = bounds.left - start.x;
|
||||||
|
const rightDistance = start.x - bounds.right;
|
||||||
|
|
||||||
const top = bounds.top - start.y;
|
const distance = Math.max(topDistance, bottomDistance, leftDistance, rightDistance);
|
||||||
const bottom = start.y - bounds.bottom;
|
|
||||||
const left = bounds.left - start.x;
|
|
||||||
const right = start.x - bounds.right;
|
|
||||||
|
|
||||||
const distance = Math.max(top, bottom, left, right);
|
|
||||||
|
|
||||||
if (distance < closestDistance) {
|
if (distance < closestDistance) {
|
||||||
closestDistance = distance;
|
closestDistance = distance;
|
||||||
|
Loading…
Reference in New Issue
Block a user