simplified triangle lines. fixed grid offset

This commit is contained in:
Stewart Allen 2019-05-03 12:17:50 -04:00
commit 8b5a088862
3 changed files with 8 additions and 11 deletions

View file

@ -49,7 +49,7 @@ var gs_kiri_fdm = exports;
doSolidLayers = solidLayers && !vaseMode,
firstOffset = sdev.nozzleSize / 2,
shellOffset = sdev.nozzleSize * spro.sliceShellSpacing,
fillOffset = shellOffset * settings.synth.fillOffsetMult,
fillOffset = sdev.nozzleSize * settings.synth.fillOffsetMult,
fillSpacing = sdev.nozzleSize,
sliceFillAngle = spro.sliceFillAngle,
view = widget.mesh && widget.mesh.newGroup ? widget.mesh.newGroup() : null;

View file

@ -33,7 +33,7 @@ var gs_kiri_fill = exports;
*/
function fillHex(target, full) {
// compute segment lengths (vert/horiz and 45)
let spacing = target.offset() / 2;
let spacing = target.offset();
let vhlen = (1 - target.density()) * 4 + spacing;
let anxlen = ROUND(Math.cos(30 * DEG2RAD) * vhlen, 7);
let anylen = ROUND(Math.sin(30 * DEG2RAD) * vhlen, 7);
@ -126,7 +126,7 @@ var gs_kiri_fill = exports;
let span_x = bounds.max.x - bounds.min.x;
let span_y = bounds.max.y - bounds.min.y;
let density = target.density();
let offset = target.offset();
let offset = target.offset() / 2;
let tile = 1 + (1 - density) * 3;
let tile_x = tile + offset;
let tile_xc = span_x / tile_x;
@ -177,14 +177,11 @@ var gs_kiri_fill = exports;
}
for (let tx=0; tx<=tile_xc; tx++) {
let bx = tx * tile_x + bounds.min.x;
let xp = bx + tile_x - line_w/2 - offset/2;
target.newline();
for (let ty=0; ty<=tile_yc; ty++) {
let bx = tx * tile_x + bounds.min.x;
let by = ty * tile + bounds.min.y;
let xp = bx + tile_x - line_w/2 - offset/2;
target.emit(xp, by);
target.emit(xp, by + tile);
}
target.emit(xp, bounds.min.y);
target.emit(xp, bounds.max.y);
}
}

View file

@ -2506,7 +2506,7 @@ self.kiri.license = exports.LICENSE;
sliceFillType: UC.newSelectField("type", {modes:FDM}, "infill"),
sliceFillSparse: UC.newInput("percentage", {title:"for infill areas\n0.0 - 1.0", convert:UC.toFloat, bound:UC.bound(0.0,1.0), modes:FDM}),
sliceFillAngle: UC.newInput("solid angle", {title:"base angle in degrees", convert:UC.toFloat, modes:FDM}),
sliceFillOverlap: UC.newInput("shell overlap", {title:"overlap with shell\nas % of nozzle width\nhigher bonds better\n0.0 - 1.0", convert:UC.toFloat, bound:UC.bound(0.0,2.0), modes:FDM}),
sliceFillOverlap: UC.newInput("overlap", {title:"overlap with shell and fill\nas % of nozzle width\nhigher bonds better\n0.0 - 1.0", convert:UC.toFloat, bound:UC.bound(0.0,2.0), modes:FDM}),
// laser
laserOffset: UC.newInput("cut offset", {title:"millimeters\nadjust for beam width", convert:UC.toFloat, modes:LASER}),