improve infill density calculations
This commit is contained in:
parent
7e0cc58181
commit
a2502f6b70
2 changed files with 5 additions and 5 deletions
|
|
@ -38,7 +38,8 @@
|
||||||
function fillHex(target, full) {
|
function fillHex(target, full) {
|
||||||
// compute segment lengths (vert/horiz and 45)
|
// compute segment lengths (vert/horiz and 45)
|
||||||
let spacing = target.offset();
|
let spacing = target.offset();
|
||||||
let vhlen = (1 / target.density()) * (target.lineWidth() + spacing);
|
// let vhlen = (1 / target.density()) * (target.lineWidth() + spacing);
|
||||||
|
let vhlen = (1 / target.density()) * target.lineWidth() * 0.5;
|
||||||
let anxlen = ROUND(Math.cos(30 * DEG2RAD) * vhlen, 7);
|
let anxlen = ROUND(Math.cos(30 * DEG2RAD) * vhlen, 7);
|
||||||
let anylen = ROUND(Math.sin(30 * DEG2RAD) * vhlen, 7);
|
let anylen = ROUND(Math.sin(30 * DEG2RAD) * vhlen, 7);
|
||||||
let bounds = target.bounds();
|
let bounds = target.bounds();
|
||||||
|
|
@ -199,9 +200,8 @@
|
||||||
let height = target.zHeight();
|
let height = target.zHeight();
|
||||||
let span_x = bounds.max.x - bounds.min.x;
|
let span_x = bounds.max.x - bounds.min.x;
|
||||||
let span_y = bounds.max.y - bounds.min.y;
|
let span_y = bounds.max.y - bounds.min.y;
|
||||||
let density = target.density();
|
|
||||||
let offset = target.offset() / 2;
|
let offset = target.offset() / 2;
|
||||||
let tile = 1 + (1 - density) * 3;
|
let tile = (1 / target.density()) * target.lineWidth();
|
||||||
let tile_x = tile + offset;
|
let tile_x = tile + offset;
|
||||||
let tile_xc = span_x / tile_x;
|
let tile_xc = span_x / tile_x;
|
||||||
let tile_yc = span_y / tile;
|
let tile_yc = span_y / tile;
|
||||||
|
|
@ -288,7 +288,7 @@
|
||||||
let span_y = bounds.max.y - bounds.min.y;
|
let span_y = bounds.max.y - bounds.min.y;
|
||||||
let offset = target.offset();
|
let offset = target.offset();
|
||||||
let line_w = target.lineWidth() / 2;
|
let line_w = target.lineWidth() / 2;
|
||||||
let tile = 1 + (1 - target.density()) * 5;
|
let tile = (1 / target.density()) * (target.lineWidth() * 1.25);
|
||||||
let tile_x = tile + offset*2 + line_w;
|
let tile_x = tile + offset*2 + line_w;
|
||||||
let tile_xc = span_x / tile_x;
|
let tile_xc = span_x / tile_x;
|
||||||
let tile_yc = span_y / tile;
|
let tile_yc = span_y / tile;
|
||||||
|
|
|
||||||
|
|
@ -329,7 +329,7 @@
|
||||||
let spaceMult = slice.index === 0 ? process.firstLayerLineMult || 1 : 1;
|
let spaceMult = slice.index === 0 ? process.firstLayerLineMult || 1 : 1;
|
||||||
let isBottom = slice.index < process.sliceBottomLayers;
|
let isBottom = slice.index < process.sliceBottomLayers;
|
||||||
let isTop = slice.index > slices.length - process.sliceTopLayers - 1;
|
let isTop = slice.index > slices.length - process.sliceTopLayers - 1;
|
||||||
let isDense = range.sliceFillSparse > 0.98;
|
let isDense = range.sliceFillSparse > 0.995;
|
||||||
let isSolid = (isBottom || ((isTop || isDense) && !vaseMode)) && !isSynth;
|
let isSolid = (isBottom || ((isTop || isDense) && !vaseMode)) && !isSynth;
|
||||||
let solidWidth = isSolid ? range.sliceFillWidth || 1 : 0;
|
let solidWidth = isSolid ? range.sliceFillWidth || 1 : 0;
|
||||||
if (solidWidth) {
|
if (solidWidth) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue