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

Transparency alpha option for show object appears inverted #457

Open
CasperH2O opened this issue Oct 30, 2024 · 0 comments
Open

Transparency alpha option for show object appears inverted #457

CasperH2O opened this issue Oct 30, 2024 · 0 comments

Comments

@CasperH2O
Copy link

The show_object alpha property level appears to work "inverted" between CQ-Editor (0.3.0dev) and OCP CAD Viewer (2.5.3).

Best I can tell, if I compare with HTML/CSS standards, an alpha/opacity value of 1 should be not transparent, and 0 is fully transparent. See here for RGBA: https://www.w3schools.com/css/css_colors_rgb.asp

Currently, CQ-Editor shows fully transparent with a value 1.0, which is opposite from what I would expect.

Code snippet, comment out ocp_vscode when running in CQ-Editor:

import cadquery as cq
#from ocp_vscode import *

result1 = cq.Workplane("front").box(2.0, 2.0, 0.5)
result2 = cq.Workplane("bottom").box(2.0, 2.0, 0.5)

show_object(result1, name="Box Alpha 1.0", options={"alpha": 1.0})
show_object(result2, name="Box Alpha 0.1", options={"alpha": 0.0})

Result in CQ-Editor:

image

Result in OCP CAD Viewer:

image

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

No branches or pull requests

1 participant