assemble_sign

Function assemble_sign 

Source
pub fn assemble_sign(lambda_det_sign: Sign, den_signs: &[Sign]) -> Sign
Expand description

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.