question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to see "cadquery.Assembly" object in viewer

See original GitHub issue

I’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:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
bernhard-42commented, Oct 8, 2021

@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) but bb = c_bb(shape, bb) in _combined_bb

1reaction
bernhard-42commented, Jul 24, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Programmatically add objects to Assembly (also unions)
As a newbie I can't figure out how to add objects (polygons, ... Additionally, I would like to know how to programmatically add...
Read more >
CadQuery Assemblies · Issue #11 · dcowden ... - GitHub
You can divide your objects into separate files as objects, ... I just get an "Unnamed" entry in the tree view that I...
Read more >
Assemblies - CadQuery Documentation - Read the Docs
BoxSelector or a user-defined selector class), it is possible to pass cadquery.Shape objects to the cadquery.Assembly.constrain() method directly.
Read more >
CadQuery Examples
The examples on this page can help you learn how to build objects with CadQuery. They are organized from simple ... See Installing...
Read more >
CadQuery Class Summary
Defines a coordinate system in space, in which 2D coordinates can be used. Assembly ([obj, loc, name, color, metadata]). Nested assembly of Workplane...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found