Problemcore
Pocket machining
Also called pocketing.
Remove all material inside a planar region, possibly with islands, down to a depth with an end mill, by a toolpath that covers the region.
Pocket machining asks for a toolpath that removes all the material inside a closed planar region, the pocket, down to a fixed depth, with a rotating end mill that must stay inside the region. The region can have islands, parts that must stay standing. Most of the material of a typical machined part is removed this way, level by level, so pocketing is the most common operation of milling. This is a problem of mechanical manufacturing: placement and routing here mean where a cutter goes and how it moves, not the placement and routing of a circuit. This page is about the problem, what any path can and cannot do, and how hard the best path is to find. The methods are on the pages of the contour-parallel, direction-parallel and Voronoi paths.
In plain words
Think of cutting a shallow tray out of a block of wood with a router. The tray has a shape drawn on the top of the block, perhaps with a few posts in the middle that must stay. The router bit is round. You must move it around inside the shape so that it takes out all the wood, without cutting into the walls or the posts.
Three things make this hard. The bit is round, so it cannot get into a sharp inside corner, and a little wood always stays there. The path must cover every part of the tray it can, with no strips left between passes. And the path should be short and smooth, with few times where the bit has to lift and move to another place, because lifts and sharp turns cost time.
Definition
Input. A pocket , a closed bounded region of the plane, usually a polygon with holes or a region bounded by segments and circular arcs. The holes are the islands. A tool radius , and the depth of the pocket, which plays no role in the planar problem.
Tool and cut. The tool is a disk of radius . A path is a curve of tool center positions, possibly in several pieces, with a retraction between pieces. The path is valid if the tool stays in the pocket: for every , which holds if and only if lies in the inward offset . The tool removes the Minkowski sum .
Goal. A valid path that removes the whole machinable region , the morphological opening of by the disk. No valid path removes more, because every tool position lies in . Among such paths, minimize a cost: the length, the machining time, the number of retractions, or a mix that also counts sharp turns and the load on the tool.
Variants
- Islands or not. A pocket without islands is simply connected. Islands make the offsets split and merge, and they make several hard problems NP-hard.
- Roughing and finishing. Roughing removes the bulk with a large tool and a large step-over and leaves a thin layer. Finishing passes along the walls and the floor remove that layer.
- Rest machining. A smaller tool clears only the material that the last tool could not reach, which is for radii .
- Open pockets. Part of the boundary is open to the air, so the tool may leave the region there, and the entry moves are easy.
- Engagement limits. High-speed machining bounds the angle over which the tool is in contact with the material, so the path must avoid full-width cuts and sharp turns. Trochoidal and spiral paths serve this.
- Many levels. A 2.5D part is cut level by level, with one pocket problem per level.
- Coverage in other fields. The same problem with a mower or a cleaning robot is coverage path planning. The same problem with a nozzle is the infill of a layer in additive manufacturing, see infill pattern.
Examples
A right triangle. Take the triangle with vertices , and and a tool with . The inward offset is the triangle , , , with area 24 and perimeter 24. The machinable region has area
and the triangle has area 54, so stays in the three corners whatever path is used.
A rectangle. In a rectangle, each corner keeps the region between the corner and the arc of the tool, of area , so stays in total.
A narrow neck. If the pocket is two wide rooms joined by a corridor narrower than , then falls into two parts. The tool cannot pass from one room to the other inside the pocket, so a path needs a retraction, and the corridor stays uncut. A smaller tool is needed for it.
Known algorithms
- Contour-parallel toolpath. Nested inward offsets of the boundary, from the wall to the middle. With step-over at most it removes the whole machinable region, and the tool cuts in one direction.
- Direction-parallel toolpath. Parallel straight passes joined in a zigzag, plus a pass along the boundary. With step-over at most it removes the whole machinable region.
- Voronoi pocket machining. All the offsets of a pocket with islands and arcs from one Voronoi diagram of the boundary, with the splits and the order of the loops.
- Spiral paths. Offsets joined into one spiral, or the connected Fermat spirals of additive manufacturing, to avoid retractions and sharp turns.
- Approximation algorithms. Arkin, Fekete and Mitchell give constant-factor approximations for the length of a milling path, and Arkin, Held and Smith bound the retractions of a zigzag path.
| Algorithm | Time | Space | Properties | Code |
|---|---|---|---|---|
| Constant engagement toolpath | O(m (n + k)) worst | O(m) extra | deterministiciterative | 1 language |
| Contour-parallel toolpath | O(K n^2) worst | O(n) extra | deterministicexactiterative | 1 language |
| Direction-parallel toolpath | O(K n log n + I n^3) worst | O(n + I) extra | deterministicexactiterative | 1 language |
| Voronoi pocket machining | O(n^2 + K n log n) worst | O(n) extra | deterministicexactiterative | 1 language |
Bounds
Uncut corners. For a convex polygon with interior angles and at most its inradius, the area that no path can remove is
At a corner with angle , the region between the two walls and the tool, with the tool touching both walls, has area , and the exterior angles of a convex polygon add up to . For the triangle above, the cotangents of the half angles are 1, 3 and 2, which gives . For a rectangle it gives .
Length. A path of length removes at most of area, because the Minkowski sum of a curve of length with a disk of radius has at most that area. So every path that removes the machinable region has length
For the triangle above this gives . The contour-parallel path with step-over 1 has length , because its strips overlap.
Hardness. Minimizing the length of a milling path, where the cutter must stay in the region, is NP-hard for regions with holes (Arkin, Fekete and Mitchell, 2000). Minimizing the number of retractions of a zigzag path is NP-hard for pockets with holes (Arkin, Held and Smith, 2000). For a fixed pocket, the order of the pieces of a path and the moves between them form a traveling salesman problem.
Reductions
- To offsetting. The set of valid tool positions is the inward offset , and the machinable region is the opening . So every pocketing method starts with a polygon offset, see solid offsetting for the 3D form.
- To coverage. With the offset known, pocketing is the coverage of by a path whose -neighbourhood covers . Robot coverage path planning solves the same problem.
- To the medial axis. The clearance of each point of and the places where offsets split are read from the medial axis, which reduces the order of the loops to a tree walk.
Applications
- Milling of 2.5D parts. Housings, plates, molds and dies are cut as a stack of pockets, one per level.
- Roughing of free-form parts. Before finishing, a free-form part is roughed out by pockets at many heights.
- Engraving and printed circuit board milling. Clearing the area between traces on a board is a pocket problem with many islands.
- Additive manufacturing. The infill of each layer of a print is a pocket problem for a nozzle, with the same coverage and path questions.
References
- Martin Held, On the Computational Geometry of Pocket Machining, Lecture Notes in Computer Science 500, Springer, 1991, the introduction and the chapters that define pockets, islands and the two kinds of pocketing paths
- Esther M. Arkin, Sándor P. Fekete and Joseph S. B. Mitchell, Approximation algorithms for lawn mowing and milling, Computational Geometry 17(1-2), 25-50, 2000, the milling problem, where the cutter must stay inside the region, its NP-hardness for regions with holes, and its approximation algorithms
- Esther M. Arkin, Martin Held and Christopher L. Smith, Optimization problems related to zigzag pocket machining, Algorithmica 26(2), 197-236, 2000, the NP-hardness of minimizing retractions for zigzag paths in pockets with holes
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag 9QJVC1 Edit this page History Report an error Markdown