From 14f3234b7b64c7fc85c7ebe53c5439b8152d8ce8 Mon Sep 17 00:00:00 2001 From: Mikolaj Wielgus Date: Sat, 16 Mar 2024 18:43:03 +0000 Subject: [PATCH] dsn: implement crude polygon importing sdl2-demo now stack-overflows when zooming-in too much, probably for a reason related to pathfinder. --- src/dsn/design.rs | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/dsn/design.rs b/src/dsn/design.rs index 96055ea..fc59834 100644 --- a/src/dsn/design.rs +++ b/src/dsn/design.rs @@ -113,7 +113,15 @@ impl DsnDesign { layer as u64, *net_id as i64, ), - Shape::Polygon(_) => (), + Shape::Polygon(polygon) => Self::add_path( + &mut layout, + (place.x - pin.x) as f64, + -(place.y - pin.y) as f64, + &polygon.coord_vec, + polygon.width as f64, + layer as u64, + *net_id as i64, + ), }; } } @@ -170,7 +178,18 @@ impl DsnDesign { net_id as i64, ) } - Shape::Polygon(_) => todo!(), + Shape::Polygon(polygon) => { + let layer = *layout.rules().layer_ids.get(&polygon.layer).unwrap(); + Self::add_path( + &mut layout, + 0.0, + 0.0, + &polygon.coord_vec, + polygon.width as f64, + layer as u64, + net_id as i64, + ) + } }; } }