A web server that executes a given CadQuery code and returns the generated model as a threejs object.
Project description
CadQuery server
A web server that executes a given CadQuery code and returns the generated model as a threejs object.
It has been created for the Cadquery VSCode extension, but could fit other needs.
Installation
pip install cq-server
Note that you must have CadQuery installed on your system (if not, you might be interested by the docker image).
Usage
Starting the server
Once installed, the cq-server
command should be available on your system:
CLI options:
-p
,--port
: server port (default: 5000)
Example:
cq-server -p 5000
Writing a CadQuery code
The Python script must contain the show()
method.
Example:
import cadquery as cq
model = cq.Workplane("XY").box(1, 2, 3)
show(model)
Note that the import cadquery as cq
part is optional (cadquery
is already imported at server start), but can be useful to enable syntax check and code completion in your IDE.
Please read the CadQuery documentation for more details about the CadQuery library.
Using the server
Once the server is started, a CadQuery Python code can be send in a POST
request payload.
Example:
curl -X POST --data-binary "@./examples/test.py" 127.0.0.1:5000
It should return the model as a threejs object.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cadquery-server-0.1.4.tar.gz
.
File metadata
- Download URL: cadquery-server-0.1.4.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.7 Linux/5.13.0-39-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e81b1ec94e3f3a197b1a43450083c4fe8ce3c94084d2acba31724d83f4e85e7 |
|
MD5 | afe656290843360f5de0ce2a9c63d51d |
|
BLAKE2b-256 | c2c2be538efd4f84a4f549d24ee32422ce49c4a3b6370648f1d609902e91810e |
File details
Details for the file cadquery_server-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: cadquery_server-0.1.4-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.7 Linux/5.13.0-39-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 373f0d591fd6ded64100a2f59a30ccc18072abbd729179cfb333fdb7811cc0bf |
|
MD5 | f0d9e30c25e283ba60b28225b9247359 |
|
BLAKE2b-256 | 6b3ff4122b154ea16aa46c79783e369873694fab31e9a4a899c68584da58a4fd |