Unable to see "cadquery.Assembly" object in viewer
See original GitHub issueI’m using the standalone viewer by running jcv -d
before running my Python files locally. I seem to be unable to show assembly objects. I see the following console output, but no exceptions are thrown:
. sending ...
AttributeError: 'NoneType' object has no attribute 'max_dist_from_center'
Here’s a minimal repro:
import cadquery as cq
import jupyter_cadquery.viewer.client as j_viewer_client
box = cq.Workplane().rect(20, 20).extrude(40)
assembly = cq.Assembly().add(box)
j_viewer_client.show(assembly)
I’ve stepped through the code, and it seems like the jcv server is returning the above error message. I found the message by inpecting the reply from the jcv server at this line: https://github.com/bernhard-42/jupyter-cadquery/blob/a1b524aa17de231728a44155da3eb8e3e02edeb0/jupyter_cadquery/viewer/client.py#L59
Am I doing something wrong in my minimal repro? Is there a problem in the jcv server? Or maybe there’s a problem in the client’s convert() method? https://github.com/bernhard-42/jupyter-cadquery/blob/a1b524aa17de231728a44155da3eb8e3e02edeb0/jupyter_cadquery/viewer/client.py#L83
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
@rohitramu @tgrosinger This is now fixed in version 2.2.1 of Jupyter CadQuery. btw. the right fix wasn’t
return c_bb(shape, bb)
butbb = c_bb(shape, bb)
in_combined_bb
The fix will be part of the next version (2.2.1). Need to find a little bit of time to prepare, test and publish.