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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
//! Pure-Rust exact mesh-arrangement CSG kernel — predicate foundation.
//!
//! This layer provides exact, platform-deterministic geometric predicates over
//! a mix of EXPLICIT input points and IMPLICIT intersection points (LPI =
//! line∩plane, TPI = three planes) carried symbolically and never materialised
//! to a float decision.
//!
//! Determinism: signs are integer parity over deterministic arithmetic. The
//! explicit path goes through `geometry-predicates` (FMA-free, const error
//! bounds). The EXACT (BigRational) tier is correct by construction and is the
//! oracle for the faster interval/fixed-width tiers, each verified `≡` exact.
/// Three-valued exact sign.
/// Which axis to drop when projecting a 3D predicate to 2D (orient2d).
/// A point that is either an explicit input coordinate or an implicit
/// intersection point carried symbolically over the original input coords.
/// Line–plane implicit point: line through `p,q` ∩ plane through `r,s,t`.
/// Three-plane implicit point: `planes[i]` is a triangle (3 points) defining a plane.
/// Combine the sign of the homogenised determinant `Λ′` with the
/// per-configuration denominator flip.
///
/// When an implicit point `(λ/d)` enters a determinant row, clearing the
/// denominator multiplies the determinant by `d` (degree = the denominator's
/// multiplicity in that configuration). The geometric sign therefore equals
/// `sign(Λ′)` flipped once per NEGATIVE odd-multiplicity denominator.
/// `den_signs` lists ONLY the odd-multiplicity denominator signs — squared
/// denominators (e.g. the TPI `III` orient3d case, `D′=(d1d2d3d4)²`) cannot
/// change the sign and MUST NOT be included. Getting this wrong silently
/// inverts inside/outside for ~half of real cuts (the per-config rule, not a
/// blanket XOR over all negatives — see the spec's REFUTATION-FIX).
///
/// A `Zero` denominator means a degenerate / at-infinity construction (e.g. the
/// LPI line is parallel to the plane, `d=0`): the predicate is undefined, so we
/// return `Zero`. Valid implicit points (built only for genuinely-crossing
/// edges) never have a zero denominator.