Files
vectorcraft/crates/trace/src
dotCooCoo b049e45b88 Image Trace: Auto Grouping looks up containing paths in a grid instead of testing every pair
Auto Grouping compared the box of every traced path with the box of every
path that can hold something, and with Overlapping it also compared each
grouped path with every path below it. On a 1400 x 1400 px noise image
traced with Limited 8, Overlapping (18,653 paths), parents() made
442,998,298 box tests and took 3.0 s in a release build.

parents() now keeps the holders and, for stacked traces, the paths below in
a grid of about one cell per path. A path's candidates are the holders in the
cell of its box center, smallest first, and the paths below it come from the
cells its box reaches. When a box reaches more cells or entries than there
are paths below it, the old scan is used. The cells grow larger when the
boxes would otherwise be listed in more than 32 cells each on average. The
same trace now takes 142,289 box tests and 0.08 s, and every parent is the
same as before. The 20,000-path limit is unchanged.

The tests compare parents() with the pairwise version on rings, faces and
noise traced Abutting and Overlapping, check that a dense trace takes at most
64 box tests per path while the pairwise version takes more, check that 300
nested discs take no more box tests than the pairwise version, and check
that boxes covering the whole image make the cells larger.
2026-10-24 17:29:33 +07:00
..