Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - TypeError: 'bool' object is not subscriptable #273

Open
SterlingButters opened this issue Aug 12, 2024 · 0 comments
Open

[BUG] - TypeError: 'bool' object is not subscriptable #273

SterlingButters opened this issue Aug 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@SterlingButters
Copy link

SterlingButters commented Aug 12, 2024

Describe the bug

Using all default options except forceNoOverlap=True results in the traceback presented below

Error message

    111 geo = geouned.CadToCsg(
    112     options=my_options,
    113     settings=my_settings,
    114     tolerances=my_tolerances,
    115     numeric_format=my_numeric_format,
    116 )
    118 geo.load_step_file(
    119     filename,
    120     skip_solids=list(set(solid_ids_with_splines))
    121 )
--> 123 geo.start()
    125 geo.export_csg(
    126     title="Converted with GEOUNED",
    127     geometryName="csg",
   (...)
    136     cellSummaryFile=False,
    137 )

File C:\Program Files\Anaconda2022\envs\python3.11\Lib\site-packages\geouned\GEOUNED\core.py:436, in CadToCsg.start(self)
    433             logger.info(m.Definition)
    435     if self.options.forceNoOverlap:
--> 436         Conv.no_overlapping_cell(self.meta_list, self.Surfaces, self.options)     
    438 else:
    439     translate(
    440         self.meta_list,
    441         self.Surfaces,
   (...)
    445         self.tolerances,
    446     )

File C:\Program Files\Anaconda2022\envs\python3.11\Lib\site-packages\geouned\GEOUNED\conversion\cell_definition.py:880, in no_overlapping_cell(metaList, surfaces, options)
    878 if not s:
    879     continue
--> 880 comp = new_def.elements[i]
    881 comp.simplify(CT)
    882 comp.clean()

TypeError: 'bool' object is not subscriptable

Just looking at the source, it is pretty easy to see how this error manifest's but I don't know enough about the rest of the source to see exactly why.

Please complete the following information):

  • OS: Windows
  • GEOUNED version: 1.2.0
  • Python version: 3.11

Additional context

Of note (and possible related), I changed line 253 of boolean_solids.py to :

    if len(surfaceList) > 0 and type(surfaces[surfaceList[0]]) is GeounedSurface:
        for s in surfaceList:
            ss = surfaces[s]
            ss.__boundBox__ = Box.BoundBox
            ss.build_surface()

Because I was also getting a tuple IndexError

@SterlingButters SterlingButters added the bug Something isn't working label Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant