From 506104a6a769eddac20e6c891696629342776803 Mon Sep 17 00:00:00 2001 From: Mikolaj Wielgus Date: Tue, 7 Oct 2025 14:24:13 +0200 Subject: [PATCH] fix(autorouter/anterouter): Make fanouts axis-aligned with their ratline endpoints --- src/autorouter/anterouter.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/autorouter/anterouter.rs b/src/autorouter/anterouter.rs index d962a18..5866e97 100644 --- a/src/autorouter/anterouter.rs +++ b/src/autorouter/anterouter.rs @@ -326,11 +326,18 @@ impl Anterouter { .drawing() .primitive(source_dot) .maybe_net(); + let center = autorouter + .board() + .layout() + .drawing() + .primitive(source_dot) + .shape() + .center(); let bbox_to_anchor = Point::from(cardinal_direction) * 1.4; let bbox_anchor = point! { - x: bbox.center()[0] + (bbox.upper()[0] - bbox.lower()[0]) / 2.0 * bbox_to_anchor.x(), - y: bbox.center()[1] + (bbox.upper()[1] - bbox.lower()[1]) / 2.0 * bbox_to_anchor.y(), + x: center.x() + (bbox.upper()[0] - bbox.lower()[0]) / 2.0 * bbox_to_anchor.x(), + y: center.y() + (bbox.upper()[1] - bbox.lower()[1]) / 2.0 * bbox_to_anchor.y(), }; //let via_bbox_to_anchor = [-pin_bbox_to_anchor[0], -pin_bbox_to_anchor[1]];