Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/1630.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Component bounding box wrong formating
12 changes: 6 additions & 6 deletions src/pyedb/grpc/database/hierarchy/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ def location(self, value):
super(Component, self.__class__).location.__set__(self, _location)

@property
def bounding_box(self) -> list[float]:
def bounding_box(self) -> tuple[tuple[float, float], tuple[float, float]]:
"""Component's bounding box.

Returns
Expand All @@ -776,7 +776,7 @@ def bounding_box(self) -> list[float]:
bbox = self.component_instance.get_bbox().points
pt1 = bbox[0]
pt2 = bbox[2]
return [Value(pt1.x), Value(pt1.y), Value(pt2.x), Value(pt2.y)]
return (Value(pt1.x), Value(pt1.y)), (Value(pt2.x), Value(pt2.y))

@property
def rotation(self) -> float:
Expand Down Expand Up @@ -1199,10 +1199,10 @@ def create_clearance_on_component(self, extra_soldermask_clearance=1e-4) -> bool
bool
"""
bounding_box = self.bounding_box
opening = [bounding_box[0] - extra_soldermask_clearance]
opening.append(bounding_box[1] - extra_soldermask_clearance)
opening.append(bounding_box[2] + extra_soldermask_clearance)
opening.append(bounding_box[3] + extra_soldermask_clearance)
opening = [bounding_box[0][0] - extra_soldermask_clearance]
opening.append(bounding_box[0][1] - extra_soldermask_clearance)
opening.append(bounding_box[1][0] + extra_soldermask_clearance)
opening.append(bounding_box[1][1] + extra_soldermask_clearance)

comp_layer = self.layer
layer_names = list(self._pedb.stackup.layers.keys())
Expand Down
5 changes: 4 additions & 1 deletion src/pyedb/workflows/drc/drc.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,10 @@ def _build_spatial_index(self) -> None:
for i, via in enumerate(self.edb.padstacks.instances.values()):
self.idx_vias.insert(i, via.position)
for i, comp in enumerate(self.edb.components.instances.values()):
self.idx_components.insert(i, comp.bounding_box)
comp_bbox = comp.bounding_box
if isinstance(comp_bbox, tuple):
comp_bbox = [comp_bbox[0][0], comp_bbox[0][1], comp_bbox[1][0], comp_bbox[1][1]]
self.idx_components.insert(i, comp_bbox)

def check(self, rules: Rules) -> List[Dict[str, Any]]:
"""
Expand Down
Loading