dsn: make import skip rather than panic on unsupported shapes

This should help debug the infringements happening when trying to load prerouted_lm317_breakout.
This commit is contained in:
Tomasz Cichoń 2024-03-08 06:00:17 +01:00
parent 6bbbc368c6
commit 137026301c
1 changed files with 17 additions and 16 deletions

View File

@ -85,12 +85,8 @@ 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!(),
};
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,
@ -103,6 +99,11 @@ impl DsnDesign {
})
.unwrap();
}
Shape::Rect(_) => (),
Shape::Path(_) => (),
Shape::Polygon(_) => (),
};
}
}
}