1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//! Recovering which input face each boolean output face came from.
//!
//! An exact 2D overlay never invents an edge: every edge of the result
//! lies on an edge of one input or the other. So a boolean output face is
//! always a FRAGMENT of an input face, and can say which -- no bookkeeping
//! through the overlay required, because the geometry itself carries the
//! answer.
//!
//! This module recovers that mapping after the fact, with exact
//! predicates. A side wall of the result is a fragment of the input wall
//! whose supporting line it lies on; the caps are fragments of the input
//! caps. Where no input edge supports an output edge -- which should not
//! happen for an exact overlay, but is not proven here -- the face is
//! reported anonymous rather than guessed at.
use ;
use Point2;
use ;
use orient2d;
/// One ring of an operand cross-section, with the operand it belongs to.
pub
/// Whether `point` lies exactly on the line through `a` and `b`.
///
/// Uses the filtered-then-exact `orient2d` cascade, so a point that is
/// nearly-but-not-quite collinear is correctly rejected rather than
/// absorbed by a tolerance band. That distinction is the whole reason this
/// recovery can be trusted: a wrong answer here would attach a fragment to
/// the wrong input face and carry the wrong material through.
/// Name the input wall that supports the output edge `start -> end`.
///
/// Both endpoints must lie on the input edge's supporting line. Testing
/// both is what rejects an edge that merely crosses the line at a point.
///
/// Returns `None` when no input edge supports it, which the caller must
/// treat as unnamed rather than substituting a default.
pub