Commit c4e52dc
committed
gh-50 Optimize spatial predicates with FillHandler segment access
Change FillHandler trait to receive segment reference, enabling handlers
to access segment data during sweep for point coincidence detection.
Key changes:
- FillHandler<C> now passes &Segment<C> to handle() method
- Add PointCoincidenceChecker helper struct with optimizations:
- Uses IntPoint (8 bytes) vs (i32,i32,bool,bool) (16 bytes) = 2x memory reduction
- Collects into separate subj/clip Vecs, sorts with sort_by_two_keys
- Dedup removes ~50% duplicate endpoints from adjacent segments
- Binary search from shorter array into longer for O(min(S,C) * log(max(S,C)))
- Skips interior segments (SUBJ_BOTH/CLIP_BOTH fill) that can't contribute
- IntersectsHandler and TouchesHandler now collect points during sweep
- Remove standalone has_point_coincidence function from relate.rs
- Add integration tests for doughnut+diamond hole boundary scenarios1 parent 430a64e commit c4e52dc
File tree
4 files changed
+424
-105
lines changed- iOverlay/src
- build
- core
4 files changed
+424
-105
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
0 commit comments