fix(geometry): nest the same on Windows and Linux

Geometry, nesting and import code now call PortableMath instead of
System.Math for Sin, Cos, Tan, Atan, Atan2, Asin and Acos (Core, Engine,
IO, Data; 269 calls in 64 files). A test fails if those projects call the
runtime's trig again.

With the runtime's trig, Windows and Linux disagreed in the last bit at
non-quarter angles and the same job could nest differently: the
learned-angle nests (a cross fixture) placed 23 parts in Strip on Windows
and 28 on Linux. Now every Engine.Tests pin gives the same layout on both
(3600 passing on Linux and on DesktopPC), Linux layouts are unchanged, and
the learned-angle rows are re-pinned to the shared layouts, which pass the
overlap and work-area checks, and run on every platform again.

Fixes Project Memory 518f3b58.
This commit is contained in:
aj committed 2026-11-09 19:18:00 -05:00
1 parent 921d100aa0
commit 49603eddf9
68 files changed
+327 -273

No files matched your search

+2 -2
View File
@@ -179,7 +179,7 @@ namespace OpenNest.Geometry
if (t1 > -Tolerance.Epsilon)
{
var hitAngle = Angle.NormalizeRad(
System.Math.Atan2(vy + t1 * dirY - cy, vx + t1 * dirX - cx)
PortableMath.Atan2(vy + t1 * dirY - cy, vx + t1 * dirX - cx)
);
if (Angle.IsBetweenRad(hitAngle, startAngle, endAngle, reversed))
best = t1 > Tolerance.Epsilon ? t1 : 0;
@@ -188,7 +188,7 @@ namespace OpenNest.Geometry
if (t2 > -Tolerance.Epsilon && t2 < best)
{
var hitAngle = Angle.NormalizeRad(
System.Math.Atan2(vy + t2 * dirY - cy, vx + t2 * dirX - cx)
PortableMath.Atan2(vy + t2 * dirY - cy, vx + t2 * dirX - cx)
);
if (Angle.IsBetweenRad(hitAngle, startAngle, endAngle, reversed))
best = t2 > Tolerance.Epsilon ? t2 : 0;