Skip to content

Commit eb6747a

Browse files
committed
Merge branch 'develop'
2 parents ee83f69 + b8b67e6 commit eb6747a

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

src/settings/default.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ innerLine:
3535
fill:
3636
flowRate: 1.0
3737
speed: 50.0
38-
overlap: 0.0
3938
gridSize: 5.0
4039
brim:
4140
flowRate: 1.0

src/sliceActions/generateInfills.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ export default function generateInfills(slices, settings) {
88
fill: { gridSize: fillGridSize },
99
bottom: { thickness: bottomThickness },
1010
top: { thickness: topThickness },
11-
nozzleDiameter,
12-
fill: { overlap: infillOverlap }
11+
nozzleDiameter
1312
} = settings;
1413

1514
fillGridSize /= PRECISION;
@@ -47,13 +46,7 @@ export default function generateInfills(slices, settings) {
4746
let lowFillArea;
4847
let highFillArea;
4948
if (surroundingLayer) {
50-
highFillArea = fillArea.difference(surroundingLayer);
51-
52-
if (infillOverlap > 0) {
53-
highFillArea = highFillArea.offset(infillOverlap);
54-
}
55-
56-
highFillArea = highFillArea.intersect(fillArea);
49+
highFillArea = fillArea.difference(surroundingLayer).intersect(fillArea);
5750
lowFillArea = fillArea.difference(highFillArea);
5851
} else {
5952
highFillArea = fillArea;

src/sliceActions/generateInnerLines.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ export default function generateInnerLines(slices, settings) {
3232
if (outerLine.paths.length > 0) {
3333
part.outerLine.join(outerLine);
3434

35-
for (let shell = 1; shell <= shells; shell += 1) {
35+
// start with 1 because outerLine is the 1st (0) shell
36+
for (let shell = 1; shell < shells; shell += 1) {
3637
const offset = shell * nozzleDiameter;
3738

3839
const innerLine = outerLine.offset(-offset, offsetOptions);

src/sliceActions/helpers/GCode.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export default class {
107107
const lineLength = this._nozzlePosition.distanceTo(newNozzlePosition);
108108

109109
const filamentSurfaceArea = Math.pow((filamentThickness / 2), 2) * Math.PI;
110-
this._extruder += lineLength * nozzleDiameter * layerHeight / filamentSurfaceArea * flowRate;
110+
this._extruder += lineLength * ((nozzleDiameter * layerHeight) / filamentSurfaceArea) * flowRate;
111111

112112
this._addGCode({
113113
[MOVE]: 1,
@@ -164,7 +164,7 @@ export default class {
164164

165165
const speed = retractionSpeed * 60;
166166

167-
if (this._extruder > retractionMinDistance && retractionEnabled) {
167+
if (this._extruder > retractionMinDistance) {
168168
this._addGCode({
169169
[MOVE]: 0,
170170
[EXTRUDER]: (this._extruder - retractionAmount).toFixed(3),

src/sliceActions/optimizePaths.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,30 @@ export default function optimizePaths(slices, settings) {
1313
}
1414

1515
const parts = [];
16+
const boundingBoxes = new WeakMap();
17+
for (let i = 0; i < slice.parts.length; i ++) {
18+
const part = slice.parts[i];
19+
20+
const shape = part.shape.closed ? part.outerLine : part.shape;
21+
const bounds = shape.shapeBounds();
22+
23+
boundingBoxes.set(part, bounds);
24+
}
1625

1726
while (slice.parts.length > 0) {
1827
let closestDistance = Infinity;
1928
let closestPart;
2029

2130
for (let i = 0; i < slice.parts.length; i ++) {
2231
const part = slice.parts[i];
32+
const bounds = boundingBoxes.get(part);
2333

24-
const shape = part.shape.closed ? part.outerLine : part.shape;
25-
const bounds = shape.shapeBounds();
26-
27-
const top = bounds.top - start.y;
28-
const bottom = start.y - bounds.bottom;
29-
const left = bounds.left - start.x;
30-
const right = start.x - bounds.right;
34+
const topDistance = bounds.top - start.y;
35+
const bottomDistance = start.y - bounds.bottom;
36+
const leftDistance = bounds.left - start.x;
37+
const rightDistance = start.x - bounds.right;
3138

32-
const distance = Math.max(top, bottom, left, right);
39+
const distance = Math.max(topDistance, bottomDistance, leftDistance, rightDistance);
3340

3441
if (distance < closestDistance) {
3542
closestDistance = distance;

0 commit comments

Comments
 (0)