mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2025-01-11 03:45:08 +01:00
Fixed bug in constucting low/high fill areas
This commit is contained in:
parent
2bc9d8fb35
commit
0dd19d060a
@ -82,7 +82,7 @@ export default class {
|
||||
}
|
||||
|
||||
_createLines (settings) {
|
||||
console.log('constructing lines from geometry');
|
||||
console.log('constructing unique lines from geometry');
|
||||
|
||||
var lines = [];
|
||||
var lineLookup = {};
|
||||
@ -188,8 +188,6 @@ export default class {
|
||||
_intersectionsToShapes (layerIntersectionIndexes, layerIntersectionPoints, lines, settings) {
|
||||
console.log("generating slices");
|
||||
|
||||
var layerHeight = settings.config["layerHeight"];
|
||||
|
||||
var shapes = [];
|
||||
|
||||
for (var layer = 1; layer < layerIntersectionIndexes.length; layer ++) {
|
||||
@ -275,10 +273,10 @@ export default class {
|
||||
}
|
||||
|
||||
if (!closed) {
|
||||
var index = firstPoint;
|
||||
var index = firstPoints[0];
|
||||
|
||||
while (index !== -1) {
|
||||
if (index !== firstPoint) {
|
||||
if (firstPoints.indexOf(index) === -1) {
|
||||
var intersection = intersectionPoints[index];
|
||||
shape.unshift({X: intersection.x, Y: intersection.y});
|
||||
|
||||
@ -334,7 +332,11 @@ export default class {
|
||||
for (var i = 0; i < shapeParts.length; i ++) {
|
||||
var shapePart1 = shapeParts[i];
|
||||
|
||||
if (shapePart1.closed) {
|
||||
if (!shapePart1.closed) {
|
||||
slice.add(shapePart1);
|
||||
continue;
|
||||
}
|
||||
|
||||
var merge = false;
|
||||
|
||||
for (var j = 0; j < slice.parts.length; j ++) {
|
||||
@ -345,14 +347,11 @@ export default class {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!merge) {
|
||||
slice.add(shapePart1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
slice.add(shapePart1);
|
||||
}
|
||||
}
|
||||
|
||||
slices.push(slice);
|
||||
}
|
||||
@ -464,12 +463,13 @@ export default class {
|
||||
var lowFillArea = fillArea.difference(highFillArea);
|
||||
}
|
||||
else {
|
||||
var lowFillArea = new Paths([], true);
|
||||
var highFillArea = fillArea;
|
||||
}
|
||||
|
||||
var fill = new Paths([], false);
|
||||
|
||||
if (lowFillArea !== undefined && lowFillArea.length > 0) {
|
||||
if (lowFillArea.length > 0 && lowFillArea.length > 0) {
|
||||
var bounds = lowFillArea.bounds();
|
||||
var lowFillTemplate = this._getFillTemplate(bounds, fillGridSize, true, true);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user