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

CQGI debug() colors #80

Open
roipoussiere opened this issue Aug 13, 2019 · 6 comments
Open

CQGI debug() colors #80

roipoussiere opened this issue Aug 13, 2019 · 6 comments

Comments

@roipoussiere
Copy link

@roipoussiere roipoussiere commented Aug 13, 2019

As a beginner, I would like to understand what is in the object stack and what I select. As far as I understand, the debug() is here for that purpose.

When executing the CQGI script example, provided in the documentation:

base_cube = cq.Workplane('XY').rect(1.0,1.0).extrude(1.0)
top_of_cube_plane = base_cube.faces(">Z").workplane()
debug(top_of_cube_plane, { 'color': 'yellow', } )
debug(top_of_cube_plane.center, { 'color' : 'blue' } )

circle=top_of_cube_plane.circle(0.5)
debug(circle, { 'color': 'red' } )

show_object( circle.extrude(1.0) )

I get this error:

TypeError: () takes one positional argument but 2 were given

Is CQGI not yet fully implemented in CadQuery Editor, or I missed something?

@jmwright
Copy link
Member

@jmwright jmwright commented Aug 13, 2019

@adam-urbanczyk can say for sure, but it may be related to this issue.

Essentially the options for show_object, and I assume debug, haven't been implemented yet. Just drop the options from the debug call and the error should go away (it did for me).

@roipoussiere
Copy link
Author

@roipoussiere roipoussiere commented Aug 13, 2019

Essentially the options for show_object, and I assume debug, haven't been implemented yet.

Ok, no problem.

Just drop the options from the debug call and the error should go away (it did for me).

I though that debug was used to color some parts of an object in order to understand what we are selecting. What the point of debug() without any argument, then?

@jmwright
Copy link
Member

@jmwright jmwright commented Aug 13, 2019

What the point of debug() without any argument, then?

I think the CQGI implementation is just lagging a little after the transition to CQ 2.0. I haven't seen many people use the debug functionality, even though it can be pretty useful. That may be why this hasn't been brought up yet.

In CadQuery's FreeCAD workbench (CQ 1.0) I rendered debug objects in red with some transparency by default, so the option wasn't used much. I'm not sure if @adam-urbanczyk has something like that planned for CQ-editor or not.

@adam-urbanczyk
Copy link
Member

@adam-urbanczyk adam-urbanczyk commented Aug 18, 2019

@roipoussiere CQ-editor does not implement the CQGI interface. Currently debug just displays the argument in the application log.

BTW: there is a dedicated graphical stack inspector in CQ-editor if you are interested in seeing what is on your stack.

@adam-urbanczyk
Copy link
Member

@adam-urbanczyk adam-urbanczyk commented Mar 26, 2020

After merging #127 it is possible to specify color like so

show_object(obj,name='a',options=dict(color='red'))
@roipoussiere
Copy link
Author

@roipoussiere roipoussiere commented May 1, 2020

@adam-urbanczyk really nice! Documentation should be updated as well but I don't know why I'm not currently able to access to the wiki...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.