diff --git a/Cargo.lock b/Cargo.lock index 5f7f95616..0ade86b5f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -56,7 +56,7 @@ checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618" [[package]] name = "acadrust" version = "0.3.4" -source = "git+https://github.com/HakanSeven12/acadrust?branch=main#db110124facbab3fbb4d947871638d73dc8b8a3a" +source = "git+https://github.com/HakanSeven12/acadrust?branch=main#ddd6888b261cb104fcf3acd6e62dc197f5d4e769" dependencies = [ "ahash", "anyhow", diff --git a/src/scene/tess_util.rs b/src/scene/tess_util.rs index c4bd703e4..b2a2154f5 100644 --- a/src/scene/tess_util.rs +++ b/src/scene/tess_util.rs @@ -31,6 +31,15 @@ pub type FallbackGeometry = ( /// semantics are preserved on real files. (Wrap-through-2π is a known /// edge case in that convention; do not "fix" it without a wider audit /// of how upstream writers emit CW boundary arcs.) +/// +/// VERIFIED against real AutoCAD output (KSR-039 DWG, CW arc edges with +/// line neighbours): the stored angles of a `ccw = false` arc edge are +/// MIRRORED — the true point is `center + r·(cos(TAU-θ), sin(TAU-θ))`. +/// Sampling the mirrored parameter directly (this function's flip) gives +/// exact endpoint continuity with the adjacent edges (Δ = 0.000000), +/// while interpreting them as true angles lands tens of units away. Any +/// code that *produces* CW boundary arcs (mirror transforms, explode) +/// must therefore store mirrored angles, not geometric ones. pub fn arc_signed_span(start: f64, end: f64, ccw: bool) -> (f64, f64) { const TAU: f64 = std::f64::consts::TAU; let (sa, ea) = if ccw { (start, end) } else { (TAU - start, TAU - end) };