CadQuery GUI editor based on PyQT
CadQuery GUI editor based on PyQT supports Linux, Windows and Mac.
Use conda to install:
conda install -c cadquery -c conda-forge cq-editor=masterand then simply type
cq-editorto run it. This installs the latest version built directly from the HEAD of this repository.
Alternatively clone this git repository and set up the following conda environment:
conda env create -f cqgui_env.yml -n cqgui conda activate cqgui python run.py
On some linux distributions (e.g.
Ubuntu 18.04) it might be necessary to install additonal packages:
sudo apt install libglu1-mesa libgl1-mesa-dri mesa-common-dev libglu1-mesa-devOn Fedora 29 the packages can be installed as follows:
dnf install -y mesa-libGLU mesa-libGL mesa-libGLU-devel
Development builds are now available that should work stand-alone without Anaconda. Click on the newest build with a green checkmark here, wait for the Artifacts section at the bottom of the page to load, and then click on the appropriate download for your operating system. Extract the archive file and run the shell (*nix) or batch (Windows) script in the root CQ-editor directory. The CQ-editor window should launch.
A stable version of these builds will be provided in the future, but are not available currently.
By default, CQ-editor will display a 3D representation of all
Workplaneobjects in a script with a default color and alpha (transparency). To have more control over what is shown, and what the color and alpha settings are, the
show_objectmethod can be used.
show_objecttells CQ-editor to explicity display an object, and accepts the
optionsparameter. The
optionsparameter is a dictionary of rendering options named
alphaand
color.
alphais scaled between 0.0 and 1.0, with 0.0 being completely opaque and 1.0 being completely transparent. The color is set using R (red), G (green) and B (blue) values, and each one is scaled from 0 to 255. Either option or both can be omitted.
show_object(result, options={"alpha":0.5, "color": (64, 164, 223)})
Note that
show_objectworks for
Shapeand
TopoDS_Shapeobjects too. In order to display objects from the embedded Python console use
show.