Add pins_enclosed function to pin_group

This commit is contained in:
Matt Guthaus 2018-10-29 10:28:57 -07:00
parent 0107e1c050
commit 851aeae8c4
1 changed files with 19 additions and 0 deletions

View File

@ -30,6 +30,25 @@ class pin_group:
def is_routed(self):
return self.routed
def pins_enclosed(self):
"""
Check if all of the pin shapes are enclosed.
Does not check if the DRC is correct, but just touching.
"""
for pin_list in self.pins:
pin_is_enclosed=False
for pin in pin_list:
if pin_is_enclosed:
break
for encosure in self.enclosures:
if pin.overlaps(enclosure):
pin_is_enclosed=True
break
else:
return False
return True
def remove_redundant_shapes(self, pin_list):
"""
Remove any pin layout that is contained within another.