Issue with SpecklePy recomposing BRep objects?

On attempting to retrieve a BRep pushed from Grasshopper, via operations.receive(obj_id=id, remote_transport=transport), the following error occurs:

Traceback (most recent call last):
  File "/Users/danfink/conda/lib/python3.9/code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "/Users/danfink/Library/Caches/pypoetry/virtualenvs/rangekeeper-f3dfj9iv-py3.9/lib/python3.9/site-packages/specklepy/api/operations.py", line 84, in receive
    return serializer.read_json(obj_string=obj_string)
  File "/Users/danfink/Library/Caches/pypoetry/virtualenvs/rangekeeper-f3dfj9iv-py3.9/lib/python3.9/site-packages/specklepy/serialization/base_object_serializer.py", line 299, in read_json
    return self.recompose_base(obj=obj)
  File "/Users/danfink/Library/Caches/pypoetry/virtualenvs/rangekeeper-f3dfj9iv-py3.9/lib/python3.9/site-packages/specklepy/serialization/base_object_serializer.py", line 360, in recompose_base
    base.__setattr__(prop, self.handle_value(value))
  File "/Users/danfink/Library/Caches/pypoetry/virtualenvs/rangekeeper-f3dfj9iv-py3.9/lib/python3.9/site-packages/specklepy/objects/base.py", line 210, in __setattr__
    attr.__set__(self, value)
  File "/Users/danfink/Library/Caches/pypoetry/virtualenvs/rangekeeper-f3dfj9iv-py3.9/lib/python3.9/site-packages/specklepy/objects/geometry.py", line 764, in TrimsValue
    self.Trims = [
  File "/Users/danfink/Library/Caches/pypoetry/virtualenvs/rangekeeper-f3dfj9iv-py3.9/lib/python3.9/site-packages/specklepy/objects/geometry.py", line 765, in <listcomp>
    BrepTrim.from_list(value[i : i + 9]) for i in range(0, len(value), 9)
  File "/Users/danfink/Library/Caches/pypoetry/virtualenvs/rangekeeper-f3dfj9iv-py3.9/lib/python3.9/site-packages/specklepy/objects/geometry.py", line 591, in from_list
    StartIndex=args[1],
IndexError: list index out of range

I’m not sure why the i + 9 term occurs but it feels like a code smell?

BTW, this is successfully retrieved through the GH Receive component

1 Like

Hi Daniel, sorry for the slow reply! I know @izzylys has pushed quite some updates recently so hopefully this is no longer an issue :slight_smile:

Hey @daniel-fink :wave:,

As mentioned by @teocomi, @izzylys pushed some updates on Brep support recently. I’ve tried to replicate your error on my end but I received the brep object successfully. Let us know if this is the case for you.

:round_pushpin: Don’t forget to update specklepy :snake: using pip install specklepy --upgrade

1 Like