ansys / pyedb

pyedb is a Python library to use the EDB client library.
https://edb.docs.pyansys.com/
MIT License
7 stars 4 forks source link

BUG: bounding_box property failing while bbox works #674

Closed svandenb-dev closed 1 day ago

svandenb-dev commented 1 month ago

Before submitting the issue

Description of the bug

bounding_box property returns an error. See code below, bounding_box is also available and if bbox is replaced by this one it fails,

Steps To Reproduce

from pyedb.dotnet.edb import Edb from pyedb.generic.general_methods import generate_unique_folder_name import pyedb.misc.downloads as downloads

temp_folder = generate_unique_folder_name() targetfile = downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) edbapp = Edb(edbpath=targetfile, edbversion="2024.1", remove_existing_aedt=True)

poly_with_voids = [pp for pp in edbapp.modeler.polygons if pp.has_voids] for poly in poly_with_voids: for void in poly.voids: test = list(idx.intersection(void.bbox)) if test: void.expand(1e-3)

Which Operating System are you using?

Windows

Which Python version are you using?

3.10

Installed packages

NA

gkorompi commented 1 month ago

Hey @svandenb-dev idx is not defined. What does it stand for?

svandenb-dev commented 1 day ago

@gkorompi I assume you took the code from unit test ? idx is the Rtree index (Spactial indexed class) to speed up the via search. https://en.wikipedia.org/wiki/R-tree fyi

svandenb-dev commented 1 day ago

I will check why bounding_box is failing

svandenb-dev commented 1 day ago

@gkorompi this bug is now fixed. void.bbox works and now regarding the refactoring it is : void.polygon_data.bounding_box