mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-12-24 03:53:49 +01:00
fix infills
This commit is contained in:
parent
fb691f175c
commit
6891e09b54
@ -45,13 +45,14 @@ export default function generateInfills(slices, settings) {
|
|||||||
|
|
||||||
var outerLine = part.outerLine;
|
var outerLine = part.outerLine;
|
||||||
|
|
||||||
if (outerLine.length > 0) {
|
if (outerLine.paths.length > 0) {
|
||||||
var inset = (part.innerLines.length > 0) ? part.innerLines[part.innerLines.length - 1] : outerLine;
|
var inset = (part.innerLines.length > 0) ? part.innerLines[part.innerLines.length - 1] : outerLine;
|
||||||
|
|
||||||
var fillArea = inset.offset(-nozzleRadius);
|
const fillArea = inset.offset(-nozzleRadius);
|
||||||
var lowFillArea = false;
|
let lowFillArea;
|
||||||
|
let highFillArea;
|
||||||
if (surroundingLayer) {
|
if (surroundingLayer) {
|
||||||
var highFillArea = fillArea.difference(surroundingLayer);
|
highFillArea = fillArea.difference(surroundingLayer);
|
||||||
|
|
||||||
if (infillOverlap > 0) {
|
if (infillOverlap > 0) {
|
||||||
highFillArea = highFillArea.offset(infillOverlap);
|
highFillArea = highFillArea.offset(infillOverlap);
|
||||||
@ -59,23 +60,21 @@ export default function generateInfills(slices, settings) {
|
|||||||
|
|
||||||
highFillArea = highFillArea.intersect(fillArea);
|
highFillArea = highFillArea.intersect(fillArea);
|
||||||
|
|
||||||
var lowFillArea = fillArea.difference(highFillArea);
|
lowFillArea = fillArea.difference(highFillArea);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var highFillArea = fillArea;
|
highFillArea = fillArea;
|
||||||
}
|
}
|
||||||
|
|
||||||
var fill = new Shape([], false);
|
if (lowFillArea && lowFillArea.paths.length > 0) {
|
||||||
|
var bounds = lowFillArea.shapeBounds();
|
||||||
if (lowFillArea && lowFillArea.length > 0) {
|
|
||||||
var bounds = lowFillArea.bounds();
|
|
||||||
var lowFillTemplate = getFillTemplate(bounds, fillGridSize, true, true);
|
var lowFillTemplate = getFillTemplate(bounds, fillGridSize, true, true);
|
||||||
|
|
||||||
part.fill.join(lowFillTemplate.intersect(lowFillArea));
|
part.fill.join(lowFillTemplate.intersect(lowFillArea));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (highFillArea.length > 0) {
|
if (highFillArea.paths.length > 0) {
|
||||||
var bounds = highFillArea.bounds();
|
var bounds = highFillArea.shapeBounds();
|
||||||
var even = (layer % 2 === 0);
|
var even = (layer % 2 === 0);
|
||||||
var highFillTemplate = getFillTemplate(bounds, hightemplateSize, even, !even);
|
var highFillTemplate = getFillTemplate(bounds, hightemplateSize, even, !even);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user