fix gpu contour Y with inside only

This commit is contained in:
Stewart Allen 2025-12-22 10:07:10 -05:00
commit a4af3a9166
2 changed files with 19 additions and 4 deletions

View file

@ -182,10 +182,7 @@ export class Topo {
for (let i=0; i<numScanlines; i++) {
let lineStart = i * pointsPerLine;
let lineData = pathData.slice(lineStart, lineStart + pointsPerLine);
let points = contourY
? Array.from(lineData).map((v,j) => calcPoint(i * ymult + yoff, j * xmult + xoff, v, i * xStep, j * yStep))
: Array.from(lineData).map((v,j) => calcPoint(j * xmult + xoff, i * ymult + yoff, v, j * xStep, i * yStep))
;
let points = Array.from(lineData).map((v,j) => calcPoint(j * xmult + xoff, i * ymult + yoff, v, j * xStep, i * yStep));
let slice = newSlice(i);
let poly = newPolygon().setOpen();
let lines = [ ];
@ -228,6 +225,12 @@ export class Topo {
if (poly.length > 1) {
lines.push(poly);
}
if (contourY) {
for (let poly of lines)
for (let p of poly.points) {
p.swapXY();
}
}
// raise output points when inside tab boundaries
if (!inside && tabsOn && clipTab.length)
for (let poly of lines) {