Definitioncore
No-fit polygon
Also called NFP.
For two polygons, the locus of a reference point of one as it slides around the other while touching, so a placement overlaps exactly when that point is inside.
The no-fit polygon (NFP) of two polygons and tells, for each translation of , whether overlaps . Fix and a reference point on . Slide around so that the two always touch and never overlap: the reference point traces the boundary of the NFP. Placements with the reference point inside the NFP overlap, those outside are apart, and those on the boundary touch. As a set, the NFP is the Minkowski sum , the same object that motion planning calls the configuration space obstacle of a translating robot. Solvers of the nesting problem compute an NFP for each pair of part shapes and each allowed rotation. After that, the test of a whole placement against a fixed part is a point in polygon test, and rules such as bottom-left fill search for points outside a union of NFPs. The NFP is the main geometric tool of the nesting problem. The text above, like the stub, says that a placement overlaps "exactly when the point is inside". This is true for the open interiors of most pairs, but it fails on the degenerate parts described below.
Definition
Let and be polygons in the plane, each a compact set equal to the closure of its interior (it may have holes). Write for translated by , and . The reference point of is the origin of its coordinates, so the reference point of is .
No-fit polygon. The no-fit polygon of with respect to is
The three relations. For every :
- if and only if . Indeed for some , is the same as .
- The interiors meet, , if and only if , by the same computation with the interiors. This set is open, since it is a union of translates of the open set , and its closure is .
- touches , meaning the sets meet but the interiors do not, if and only if is in but not in .
A placement of is feasible with respect to when the interiors do not meet, that is, when is apart from or touches it. So the feasible translations are the complement of the open set in item 2.
Is "inside" the same as "overlap"? The open set of item 2 is always contained in . For two convex polygons the two sets are equal, so "the interiors overlap if and only if is strictly inside the NFP" is true. For nonconvex polygons the open set can be smaller. The difference is a set of segments and points inside the NFP where fits exactly into a slot or a cavity of : there touches on two opposite sides, every nearby translation overlaps, and so is an interior point of the NFP that is still feasible. Codes that test "strictly inside the NFP" lose these exact fits. Codes that test "inside or on the boundary" lose all touching placements. The orbital method of Burke et al. (2007) treats exact fits as a special case of its output.
Inner-fit polygon. For a container , such as a sheet or a strip, the inner-fit polygon is
the Minkowski difference of and , which is the erosion of mathematical morphology. For a rectangular sheet and a part whose bounding box is in its own coordinates, , empty if the part is too large.
Feasible region. With parts already placed (each as a fixed polygon), the feasible reference points of form
This is the set that placement rules search, for example for its lowest, then leftmost point in bottom-left fill.
Rotations. The NFP is defined for translations only. A part that may turn through a finite set of angles, often , , and degrees, gets one NFP per pair of orientations. Free rotation makes the set of placements three-dimensional, and the NFP does not apply directly.
Convex parts. If and are convex with and edges, the NFP is a convex polygon with at most edges. Its edges are the edges of and of sorted by direction, so it is computed by one merge in time, see Minkowski sum of convex polygons. For nonconvex parts the NFP can have holes, many more edges, and the degenerate parts above. The Minkowski sum page gives the size bounds. Three ways to compute it are in use, all described in the tutorial of Bennell and Oliveira (2008):
- Orbital. Slide along and trace the reference point. Each step finds the touching pair of edges, the direction of sliding, and how far can go before it hits another edge. The holes need extra start points. Burke et al. (2007) treat the holes, the exact fits and the narrow channels.
- Decomposition. Cut and into convex pieces (see convex decomposition), take the NFP of each pair of pieces by the convex merge, and take the union. Agarwal, Flato and Halperin (2002) compare decompositions for this use.
- Edge sequences. Bennell, Dowsland and Dowsland (2001) sort the edges of and by direction as in the convex case, and repair the result where the polygons are not convex, without a decomposition.
All three make sign decisions on the orientation of edge pairs, so rounding errors can break them. Exact rational coordinates avoid this.
Examples and non-examples
The examples were checked by an exact rational test of the three relations on a grid of translations (spacing and ), with the overlap of convex pieces decided by separating axes.
- A square and a triangle. , and is the triangle with vertices , and , with the reference point at its right angle. Then has vertices , and , and
of area . It has edges, not , because the two short edges of are parallel to edges of the square and merge with them. At , on the slanted edge, the hypotenuse of touches the corner of . At , inside, the parts overlap. At , outside, they are apart.
- A hole in the NFP. Let be the square with a square cavity cut out of it and a slot of width , , that joins the cavity to the top. Let be a square with the reference point at its lower left corner. Then with the open square removed. The hole is the set of positions where sits inside the cavity without touching it. is too wide to pass through the slot, so the hole cannot be reached from outside by sliding, and an orbital method that starts from the outside never finds it. The hole is where solvers of the nesting problem put small parts inside the cut-outs of large ones.
- An exact fit. Make the cavity of the previous example , which is exactly as wide as , and close the slot. The positions for put in the cavity, touching both side walls. They are feasible. But moving by in makes overlap a wall, so the segment lies in the interior of the NFP. The NFP has no hole here, only a slit of feasible points inside it. This is the non-example to "overlap if and only if strictly inside".
- Inner fit. A rectangle on a sheet has . The point puts the rectangle in the upper right corner.
- Not symmetric. . In the first example, is the pentagon reflected through the origin, not the same pentagon. The reference points also matter: moving the reference point of by translates by .
Related definitions
- Minkowski sum. The NFP is . The Minkowski sum page gives the algorithms and the size bounds, and this page adds the reference point, the touching case and the inner-fit polygon.
- Configuration space. In motion planning, the obstacle for a robot that only translates is the same set . Motion planning asks for a path through the free space. The nesting problem asks for a good point in it.
- Mathematical morphology. The inner-fit polygon is an erosion of the container by , and the NFP is a dilation of by .
- Nesting problem. The problem that the NFP serves. Its feasibility constraints are "the reference point of each part is in its IFP and outside the open NFP of every other part".
- Bottom-left fill. Places each part at the lowest, then leftmost, feasible point of the region above.
- Polygon with holes. NFPs of nonconvex parts can have holes, so a code needs this representation for its output.
References
- Julia A. Bennell and José F. Oliveira, The geometry of nesting problems, a tutorial, European Journal of Operational Research 184(2), 2008, 397 to 415, the section on the no-fit polygon (definition, the orbital, decomposition and Minkowski sum ways to compute it, and its degenerate cases) and the inner-fit polygon
- Julia A. Bennell, Kathryn A. Dowsland and William B. Dowsland, The irregular cutting-stock problem, a new procedure for deriving the no-fit polygon, Computers and Operations Research 28(3), 2001, 271 to 287, the no-fit polygon of nonconvex polygons from Minkowski sums of edge sequences, without a decomposition into convex pieces
- Edmund K. Burke, Robert S. R. Hellier, Graham Kendall and Glenn Whitwell, Complete and robust no-fit polygon generation for the irregular stock cutting problem, European Journal of Operational Research 179(1), 2007, the orbital method, with the cases of holes, of exact fits and of sliding into a narrow channel
- Kathryn A. Dowsland, Subodh Vaid and William B. Dowsland, An algorithm for polygon placement using a bottom-left strategy, European Journal of Operational Research 141(2), 2002, 371 to 381, feasible positions as points outside every no-fit polygon and inside the inner-fit polygon, holes included
- Pankaj K. Agarwal, Eyal Flato and Dan Halperin, Polygon decomposition for efficient construction of Minkowski sums, Computational Geometry 21(1-2), 2002, 39 to 61, Minkowski sums of nonconvex polygons by convex decomposition, pairwise convex sums and their union, with an experimental comparison of decompositions
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 | W4 complete |
|
Tag V3W9FP Edit this page History Report an error Markdown