First commit.

Signed-off-by: Chen Xiao <abigwc@gmail.com>
This commit is contained in:
Chen Xiao
2026-05-08 14:43:16 +08:00
commit 0b64e2de94
10989 changed files with 2253791 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import { polygonHachureLines } from './scan-line-hachure';
export class HachureFiller {
constructor(helper) {
this.helper = helper;
}
fillPolygons(polygonList, o) {
return this._fillPolygons(polygonList, o);
}
_fillPolygons(polygonList, o) {
const lines = polygonHachureLines(polygonList, o);
const ops = this.renderLines(lines, o);
return { type: 'fillSketch', ops };
}
renderLines(lines, o) {
const ops = [];
for (const line of lines) {
ops.push(...this.helper.doubleLineOps(line[0][0], line[0][1], line[1][0], line[1][1], o));
}
return ops;
}
}