Repository navigation
Skip the elements on the boundary of the NFP when computing its feasible elements and points - #155
Merged
Merged
Conversation
…ble elements and points compute_feasible_elements_and_points computes the intersections of the elements of the convex NFPs which are not strictly inside the union of the other ones. Many of these elements are on the boundary of the NFP, e.g. the collinear edges of the convex NFPs of the parts along a straight side of a shape, and each of them intersects many others. None of their points is strictly inside the NFP, so none of them is feasible, and their intersections with the other elements are not needed either: these intersections are not strictly inside the NFP, and the overlapping parts in opposite directions have convex NFPs on both sides, so they only reach the boundary of the NFP at their ends. These elements are now removed before computing the intersections.
fontanf
force-pushed
the
nfp-skip-elements-on-boundary
branch
from
November 8, 2026 16:50
01c29b7 to
be45478
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
compute_feasible_elements_and_pointscomputes the intersections of the elements of the convex NFPs which are not strictly inside the union of the other convex NFPs. Many of these elements are on the boundary of the NFP, for example the collinear edges of the convex NFPs of all the parts along a straight side of a shape, and each of them intersects many others.None of their points is strictly inside the NFP, so none of them is feasible. Their intersections with the other elements are not needed either:
These elements are now removed before computing the intersections: an element is removed if its start and its end are on an element of the same type of the boundary of the NFP containing its middle.
Measurements
On the 62 no-fit polygons computed by the periodic packings of packingsolver on alma_02 (alma2025 dataset),
no_fit_polygongoes from 23.6 s to 20.9 s in total, with the same outputs (number of components and of elements of the NFP, number of feasible elements and points). On the self-NFP of a 64-vertex item type, 3,478 of the 10,197 remaining elements are removed, the number of intersecting pairs goes from 856,030 to 155,502, andno_fit_polygongoes from 1.59 s to 0.88 s.All 714 tests pass.