]> git.draconx.ca Git - homepage.git/blob - content/projects/slotifier.md
Put some actual material on the site.
[homepage.git] / content / projects / slotifier.md
1 ---
2 title: Slotifier
3 copyright: 2019 Nick Bowler
4 license: gpl-3 or (at your option) any later version
5 ---
6
7 Slotifier is a simple program which takes an Excellon drill file input,
8 searches for overlapping drill hits, and generates a new drill file with
9 those hits converted to a single slot (G85 entry in the drill file).
10
11 This is useful when using a PCB tool which does not generate such slots
12 directly, but you require this format for fabrication.  Simply use overlapping
13 drill hits in the PCB tool to represent slots, then run slotifier on the drill
14 file before sending to the fab.
15
16 The types of slots that can be produced with this tool are limited: they must
17 be straight lines and must have the same thickness throughout.  Slotifier uses
18 a simple heuristic to convert holes to slots, and might behave unexpectedly if
19 drill hits overlap in complex ways, see below.
20
21 # Obtaining slotifier
22
23 [slotifier-gitweb]: //git.draconx.ca/gitweb/slotifier.git
24
25 There are presently no released versions of slotifier.  The development
26 sources [may be browsed online][slotifier-gitweb] or cloned directly using
27 git, e.g.,
28
29 <kbd>git clone https://git.draconx.ca/slotifier.git</kbd>
30
31 # Dependencies
32
33 [gerbv-homepage]: http://gerbv.geda-project.org/
34 [neartree-homepage]: http://neartree.sourceforge.net/
35 [gettext-homepage]: https://www.gnu.org/software/gettext/
36
37 Slotifier is written in C, so a working C compiler is required.
38
39 The [libgerbv library][gerbv-homepage] is used to process the Excellon drill
40 file format.  It must be a sufficiently recent version with support for G85
41 slots: the first version to support such slots is gerbv 2.7.
42
43 Furthermore, to compute the overlap relation, slotifier uses the [CNearTree
44 library][neartree-homepage].
45
46 Optionally, in order to support localized program messages the [GNU libintl
47 library][gettext-homepage] (included with the GNU C library) is required.
48
49 Building from the development sources may require additional build tools.
50
51 # Theory of operation
52
53 Slotifier works by locating groups of drill hits which are considered
54 mergeable.  Two holes are considered to _overlap_ if and only if the centre of
55 either hole is positioned within the other hole, and the transitive closure of
56 this overlap relation gives the _mergeable_ relation.  Thus, holes A and B
57 are mergeable if there is some sequence of overlapping holes, starting from
58 A, which leads to B.
59
60 The mergeable property is an equivalence relation on the holes, so the holes
61 can be partitioned into equivalence classes.  Every such class with more than
62 one hole in it is then converted into a slot as follows:
63
64 * Two holes are chosen from the class such that the straight-line distance
65   between their centres is maximized.  These two centres are used as the
66   endpoints of the slot.
67
68 * The tool with the greatest diameter from all the holes in the class is used
69   as the tool for the slot.
70
71 In either case, it is unspecified which option is chosen when there is more
72 than one maximum.
73
74 For best results, the designer should ensure that mergeable holes form an
75 approximate straight line and use the same tools.
76
77 # License
78
79 Slotifier is free software: you can redistribute it and/or modify it under
80 the terms of the GNU General Public License as published by the Free Software
81 Foundation, either version 3 of the License or (at your option) any later
82 version.