Nick Bowler [Thu, 15 Apr 2021 01:00:27 +0000 (21:00 -0400)]
Fix inconsistent merging of asymmetric hole overlaps.
When computing the overlap relation between holes with different
sizes, the current search may not find all overlaps in the case
where a smaller hole is visited before a larger one, because
searching for holes within the radius of the smaller hole could
potentially not find the larger one.
The search procedure is altered slightly in order to solve this.
First, we begin the search by looking at holes in descending tool
diameter, to give a known upper bound at each stage.
Then we find potential overlaps by finding all holes within this
upper bound, and select the results that actually overlap.
Nick Bowler [Wed, 14 Apr 2021 23:14:54 +0000 (19:14 -0400)]
Properly return failure status from main.
Due to an oversight, several failure cases in main are not properly
causing slotifier to exit with a failure status. Fix that up, and
add a test case which tickles one of the affected error paths.
Nick Bowler [Wed, 14 Apr 2021 01:33:13 +0000 (21:33 -0400)]
Fix crash when input has no holes.
When the search tree has no elements, it seems the CNearTreeObjects
function does not give a CVector with zero elements but rather a
null pointer. This results in a null dereference when that is
passed to CVectorSize, instead of 0 as expected.
Add an explicit check for this case to avoid crashing.
Nick Bowler [Wed, 14 Apr 2021 00:32:16 +0000 (20:32 -0400)]
Fix radius/diameter confusion in overlap search.
Drill sizes are specified as hole diameter, but the nearest neighbour
search is performed by distance.
The overlap relation is documented as "when the centre of one hole is
inside the other hole" which implies that we should be searching on
hole radius. Presently the diameter is used, which is twice as far
as expected.
For holes that are the same size this is a minor technicality: such
holes that are apart by less than the hole diameter do "overlap" in
the drilled portion. But when a small hole is near a large hole they
can be obviously disjoint yet slotifier can erroneously merge them.
Adjust the search to half the diameter, plus some slop (5 tenths)
so that holes exactly on the boundary are counted as overlapping.
Nick Bowler [Mon, 15 Feb 2021 06:11:40 +0000 (01:11 -0500)]
Bundle scripts to help re-bootstrap the package.
We can include the main bootstrapping scripts easily enough in the
package. If the user has a (possibly updated) Gnulib available, it
is now possible to regenerate the build system just by running the
included bootstrap script.
Nick Bowler [Mon, 15 Feb 2021 05:07:24 +0000 (00:07 -0500)]
Bump dxcommon for DX_LINGUAS bug fixes.
Going through this packaging rigamarole has led us to discover
that mistakes were made. This linguas helper turns out to be pretty
broken and can substitute syntax errors into the makefile in some
cases.
Nick Bowler [Mon, 15 Feb 2021 05:45:59 +0000 (00:45 -0500)]
Use AC_CONFIG_HEADERS rather than AC_CONFIG_HEADER.
The former name has been supported since approximately forever ago and
the latter form is now formally deprecated (with a warning) in recent
versions of Autoconf.
Nick Bowler [Sat, 13 Feb 2021 18:33:37 +0000 (13:33 -0500)]
Don't use gnulib gettext module.
This gives deprecation warnings, suggesting the use of gettext-h
instead. I believe there is little reason not to switch, as
everything will work the same just that the NLS configure tests
will come from an installed GNU gettext when bootstrapping rather
than from gnulib.
Nick Bowler [Sat, 13 Feb 2021 18:28:03 +0000 (13:28 -0500)]
Ensure INSTALL is packaged.
When Automake is run in foreign mode, the standard INSTALL file is not
copied by automake --add-missing. As this file provides general usage
instructions for the GNU build system, it is useful to have included
in the package.
Just copy the file manually when bootstrapping to make that happen.
Nick Bowler [Sat, 13 Feb 2021 18:02:48 +0000 (13:02 -0500)]
Generate ChangeLog from git at packaging time.
Import the gitlog-to-changelog script from gnulib and add rules to
generate an up-to-date changelog from the git history, if available,
when running 'make dist'.
The ChangeLog is otherwise taken from srcdir as usual, so that
modified versions can be prepared from a release tarball without
requiring the full git history. In this scenario, the ChangeLog
would have to be manually edited.
In case the ChangeLog generation fails, a distcheck-hook is added to
hopefully catch issues before releasing tarballs with a broken
ChangeLog.