Fiber Push Cutter
July 2, 2026 ยท View on GitHub
This spec defines push-cutter evaluation for one fiber.
Purpose
At a fixed machine Z level, push a cutter along a finite XY fiber and compute intervals where the cutter contacts or violates target mesh triangles.
Dependencies
Inputs
type CamFiberDirection = "x" | "y";
type CamFiber = {
id: string;
direction: CamFiberDirection;
start: CamPoint3;
end: CamPoint3;
intervals: CamFiberInterval[];
};
type FiberPushInput = {
fiber: CamFiber;
cutter: CamCutter;
triangles: CamTriangle[];
index?: CamTriangleIndex;
};
Output
- The same fiber with merged blocked intervals.
- Contact metadata on interval bounds where available.
- Warnings for numeric contact failures.
Algorithm
- Validate fiber direction and constant Z.
- Build query bounds:
- X-fiber uses fixed Y/Z plus cutter radius/length envelope.
- Y-fiber uses fixed X/Z plus cutter radius/length envelope.
- Query triangle index:
- X-fiber uses
yzprojection. - Y-fiber uses
xzprojection.
- X-fiber uses
- For each candidate triangle:
- Compute vertex push contacts.
- Compute facet push contacts.
- Compute edge push contacts.
- Convert valid contacts into interval updates.
- Merge intervals that overlap within tolerance.
- Return interval-sorted fiber.
Vertex Push
- Compute vertex local height
h = vertex.z - fiber.z. - If
h < 0orh > cutter.cuttingLength, no contact. - Get effective cutter radius at
h. - Compute closest point from vertex XY to fiber line.
- If perpendicular distance is greater than effective radius, no contact.
- Compute entry/exit parameter along fiber using chord distance.
- Add interval with vertex contact metadata.
Facet Push
- Ignore horizontal facets because pushing in XY does not encounter a horizontal plane boundary.
- Solve for the cutter contact point on the triangle plane where profile support touches the plane while the cutter reference lies on the fiber.
- Contact must lie inside the triangle.
- Fiber parameter must be inside
[0, 1]. - Add zero-width or small interval around contact; interval merge later expands with related contacts.
Edge Push
Required cases:
- Horizontal edge: use cutter
radiusAtHeight(edge.z - fiber.z). - Shaft edge: use cylindrical shaft radius where edge height is above lower profile.
- General edge: selected cutter shape contact against a sloped edge.
For bull/cone/ball-cone, general edge may use bounded numeric solve. Failures are warnings, not fatal unless all contacts fail.
Interval Rules
- Parameter
t=0at fiber start andt=1at fiber end. - Clamp valid interval endpoints to
[0, 1]. - Discard intervals whose upper <= lower after tolerance.
- Merge overlapping intervals and retain outermost contact metadata.
Tests
- A fiber across a cube at mid-height returns one blocked interval.
- A fiber outside the cutter radius returns no intervals.
- Vertex-only contact creates a finite interval.
- Horizontal edge contact uses effective cutter radius.
- X and Y direction queries produce symmetric results on a symmetric fixture.