Batch Push Cutter
July 2, 2026 ยท View on GitHub
This spec defines chunked push-cutter processing for many same-direction fibers.
Purpose
Batch push-cutter evaluates many fibers against one target mesh and cutter while sharing spatial indexing and worker progress.
Dependencies
Inputs
type BatchPushInput = {
fibers: CamFiber[];
direction: "x" | "y";
cutter: CamCutter;
triangles: CamTriangle[];
index?: CamTriangleIndex;
chunkSize?: number;
onProgress?: (progress: CamProgress) => void;
progressYield?: () => Promise<void> | void;
};
Output
type BatchPushOutput = {
fibers: CamFiber[];
summary: {
fiberCount: number;
intervalCount: number;
candidateCount: number;
warningCount: number;
};
warnings: string[];
};
Algorithm
- Validate every fiber has the requested direction.
- Build or reuse triangle index:
- X-fiber batch prefers
yzprojection. - Y-fiber batch prefers
xzprojection.
- X-fiber batch prefers
- Choose chunk size.
- For every chunk:
- Run fiber push-cutter on each fiber.
- Preserve input order.
- Accumulate interval/candidate counts.
- Emit progress.
- Await
progressYield.
- Return fibers with sorted intervals.
Progress Phases
batch-push-preparebatch-push-indexbatch-push-fibersbatch-push-complete
Determinism
- Output fiber order matches input.
- Intervals sorted by lower parameter.
- Equal interval endpoints sorted by upper parameter then contact type.
Tests
- Batch result equals repeated single-fiber push result.
- X and Y batches use different projection modes.
- Progress advances across chunks.
- Empty fiber list returns empty output.
- Indexed and brute-force modes produce equivalent intervals on small fixtures.