From 137026301cf4845615bc394c01409993ae7c17c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Cicho=C5=84?= Date: Fri, 8 Mar 2024 06:00:17 +0100 Subject: [PATCH] dsn: make import skip rather than panic on unsupported shapes This should help debug the infringements happening when trying to load prerouted_lm317_breakout. --- src/dsn/design.rs | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/dsn/design.rs b/src/dsn/design.rs index 5e56ccc..46f9580 100644 --- a/src/dsn/design.rs +++ b/src/dsn/design.rs @@ -85,23 +85,24 @@ impl DsnDesign { .unwrap(); // no layer support yet, pick the first one - let circle = match &padstack.shape_vec[0] { - Shape::Circle(circle) => circle, - Shape::Rect(_) => todo!(), - Shape::Path(_) => todo!(), - Shape::Polygon(_) => todo!(), - }; - let circle = Circle { - pos: (place.x as f64 / 100.0, -place.y as f64 / 100.0).into(), - r: circle.diameter as f64 / 200.0, - }; + match &padstack.shape_vec[0] { + Shape::Circle(circle) => { + let circle = Circle { + pos: (place.x as f64 / 100.0, -place.y as f64 / 100.0).into(), + r: circle.diameter as f64 / 200.0, + }; - layout - .add_fixed_dot(FixedDotWeight { - net: *net_id as i64, - circle, - }) - .unwrap(); + layout + .add_fixed_dot(FixedDotWeight { + net: *net_id as i64, + circle, + }) + .unwrap(); + } + Shape::Rect(_) => (), + Shape::Path(_) => (), + Shape::Polygon(_) => (), + }; } } }