refactor(layout/layout): Add method to retrieve fixed dot's via (not used yet)

This commit is contained in:
Mikolaj Wielgus 2025-10-19 20:51:44 +02:00
parent 3856319dc9
commit 10dc1a86aa
1 changed files with 13 additions and 2 deletions

View File

@ -389,12 +389,23 @@ impl<R: AccessRules> Layout<R> {
.compounds(GenericIndex::<()>::new(primitive.index()))
.find_map(|(_, compound)| {
if let CompoundWeight::Poly(_) = self.drawing().compound_weight(compound) {
Some(compound)
Some(GenericIndex::<PolyWeight>::new(compound.index()))
} else {
None
}
})
}
pub fn fixed_dot_via(&self, dot: FixedDotIndex) -> Option<GenericIndex<ViaWeight>> {
self.drawing()
.compounds(GenericIndex::<()>::new(dot.index()))
.find_map(|(_, compound)| {
if let CompoundWeight::Via(_) = self.drawing().compound_weight(compound) {
Some(GenericIndex::<ViaWeight>::new(compound.index()))
} else {
None
}
})
.map(|compound| GenericIndex::<PolyWeight>::new(compound.index()))
}
/// Checks if a node is not a primitive part of a compound, and if yes, returns its apex and center