mirror of https://codeberg.org/topola/topola.git
feat(autorouter/multilayer_preconfigurer): At first autoroute ratlines on their layers
This commit is contained in:
parent
81e27f0f60
commit
23f9eb3e35
|
|
@ -39,7 +39,7 @@ impl MultilayerPreconfigurer {
|
||||||
.ratlines
|
.ratlines
|
||||||
.iter()
|
.iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.map(|(i, ratline)| (*ratline, i % 2))
|
.map(|(_i, ratline)| (*ratline, ratline.ref_(autorouter).preferred_layer()))
|
||||||
.collect(),
|
.collect(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -106,31 +106,41 @@ impl<'a, M: AccessMesadata> RatlineRef<'a, M> {
|
||||||
.unwrap()
|
.unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn cut_primitives(&self) -> Box<dyn Iterator<Item = PrimitiveIndex> + '_> {
|
pub fn layer(&self) -> Option<usize> {
|
||||||
let endpoint_dots = self.endpoint_dots();
|
let endpoint_dots = self.endpoint_dots();
|
||||||
|
|
||||||
if endpoint_dots
|
(endpoint_dots
|
||||||
.0
|
.0
|
||||||
.primitive_ref(self.autorouter.board().layout().drawing())
|
.primitive_ref(self.autorouter.board().layout().drawing())
|
||||||
.layer()
|
.layer()
|
||||||
== endpoint_dots
|
== endpoint_dots
|
||||||
.1
|
.1
|
||||||
.primitive_ref(self.autorouter.board().layout().drawing())
|
.primitive_ref(self.autorouter.board().layout().drawing())
|
||||||
.layer()
|
.layer())
|
||||||
{
|
.then_some(
|
||||||
let layer = endpoint_dots
|
endpoint_dots
|
||||||
.0
|
.0
|
||||||
.primitive_ref(self.autorouter.board().layout().drawing())
|
.primitive_ref(self.autorouter.board().layout().drawing())
|
||||||
.layer();
|
.layer(),
|
||||||
|
)
|
||||||
Box::new(self.autorouter.board().layout().drawing().cut(
|
|
||||||
self.line_segment(),
|
|
||||||
0.0,
|
|
||||||
layer,
|
|
||||||
))
|
|
||||||
} else {
|
|
||||||
Box::new(std::iter::empty())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn preferred_layer(&self) -> usize {
|
||||||
|
self.layer().unwrap_or(self.uid.principal_layer)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn cut_primitives(&self) -> Box<dyn Iterator<Item = PrimitiveIndex> + '_> {
|
||||||
|
let Some(layer) = self.layer() else {
|
||||||
|
return Box::new(std::iter::empty());
|
||||||
|
};
|
||||||
|
|
||||||
|
Box::new(
|
||||||
|
self.autorouter
|
||||||
|
.board()
|
||||||
|
.layout()
|
||||||
|
.drawing()
|
||||||
|
.cut(self.line_segment(), 0.0, layer),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn cut_other_net_primitives(&self) -> impl Iterator<Item = PrimitiveIndex> + '_ {
|
pub fn cut_other_net_primitives(&self) -> impl Iterator<Item = PrimitiveIndex> + '_ {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue