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:
|
||||
flowRate: 1.0
|
||||
speed: 50.0
|
||||
overlap: 0.0
|
||||
gridSize: 5.0
|
||||
brim:
|
||||
flowRate: 1.0
|
||||
|
@ -8,8 +8,7 @@ export default function generateInfills(slices, settings) {
|
||||
fill: { gridSize: fillGridSize },
|
||||
bottom: { thickness: bottomThickness },
|
||||
top: { thickness: topThickness },
|
||||
nozzleDiameter,
|
||||
fill: { overlap: infillOverlap }
|
||||
nozzleDiameter
|
||||
} = settings;
|
||||
|
||||
fillGridSize /= PRECISION;
|
||||
@ -47,13 +46,7 @@ export default function generateInfills(slices, settings) {
|
||||
let lowFillArea;
|
||||
let highFillArea;
|
||||
if (surroundingLayer) {
|
||||
highFillArea = fillArea.difference(surroundingLayer);
|
||||
|
||||
if (infillOverlap > 0) {
|
||||
highFillArea = highFillArea.offset(infillOverlap);
|
||||
}
|
||||
|
||||
highFillArea = highFillArea.intersect(fillArea);
|
||||
highFillArea = fillArea.difference(surroundingLayer).intersect(fillArea);
|
||||
lowFillArea = fillArea.difference(highFillArea);
|
||||
} else {
|
||||
highFillArea = fillArea;
|
||||
|
@ -32,7 +32,8 @@ export default function generateInnerLines(slices, settings) {
|
||||
if (outerLine.paths.length > 0) {
|
||||
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 innerLine = outerLine.offset(-offset, offsetOptions);
|
||||
|
@ -107,7 +107,7 @@ export default class {
|
||||
const lineLength = this._nozzlePosition.distanceTo(newNozzlePosition);
|
||||
|
||||
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({
|
||||
[MOVE]: 1,
|
||||
@ -164,7 +164,7 @@ export default class {
|
||||
|
||||
const speed = retractionSpeed * 60;
|
||||
|
||||
if (this._extruder > retractionMinDistance && retractionEnabled) {
|
||||
if (this._extruder > retractionMinDistance) {
|
||||
this._addGCode({
|
||||
[MOVE]: 0,
|
||||
[EXTRUDER]: (this._extruder - retractionAmount).toFixed(3),
|
||||
|
@ -13,6 +13,15 @@ export default function optimizePaths(slices, settings) {
|
||||
}
|
||||
|
||||
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) {
|
||||
let closestDistance = Infinity;
|
||||
@ -20,16 +29,14 @@ export default function optimizePaths(slices, settings) {
|
||||
|
||||
for (let i = 0; i < slice.parts.length; i ++) {
|
||||
const part = slice.parts[i];
|
||||
const bounds = boundingBoxes.get(part);
|
||||
|
||||
const shape = part.shape.closed ? part.outerLine : part.shape;
|
||||
const bounds = shape.shapeBounds();
|
||||
const topDistance = bounds.top - start.y;
|
||||
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 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);
|
||||
const distance = Math.max(topDistance, bottomDistance, leftDistance, rightDistance);
|
||||
|
||||
if (distance < closestDistance) {
|
||||
closestDistance = distance;
|
||||
|
Loading…
Reference in New Issue
Block a user