bernhard-42 / three-cad-viewer

A CAD viewer component based on three.js
MIT License
178 stars 29 forks source link

Bug: Hiding Part in group always toggles first element #10

Closed akoen closed 1 year ago

akoen commented 1 year ago

The same applies for toggling of edges.

Peek 2023-05-26 08-18

bernhard-42 commented 1 year ago

Only when all are named the same. This should be covered in the latest version.

bernhard-42 commented 1 year ago

What is your code here?

akoen commented 1 year ago

PartGroup([Part(cq.Solid(s.wrapped)) for s in solids]) where solids is an array of type cadquery.occ_impl.shapes.Solid.

Tested only with the three-cad-viewer pulled in git version of jupyter-cadquery, so if it's fixed in master this can be closed.

The reason I'm rewrapping the solids in a cq.Solid is because I've found that the isinstance calls in jupyter-cadquery can fail to distinguish between cadquery.Solid and cadquery.occ_impl.Solid, but I haven't investigated the issue enough yet to warrant make a bug report in jupyter-cadquery.

bernhard-42 commented 1 year ago

oh, you're in Jupyter Cadquery? This is the repo for the VS Code plugin.

Nevertheless, try:

PartGroup([Part(cq.Solid(s.wrapped), name=f"Part_{i}") for i, s in enumerate(solids)])
image
akoen commented 1 year ago

Ok thank you, I figured this was more relevant to the viewer than to jupyter-cadquery itself, but if it's fixed in the latest version then I'll close.

bernhard-42 commented 1 year ago

fyi, when I find time, I will migrate Jupyter CadQuery to use the core of OCP CAD viewer. Will be in the next release together with ipywidgets 8 and jupyterlab 4