Skip to main content

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cadquery-server-0.1.5.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

cadquery_server-0.1.5-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file cadquery-server-0.1.5.tar.gz.

File metadata

  • Download URL: cadquery-server-0.1.5.tar.gz
  • Upload date:
  • Size: 2.6 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

Hashes for cadquery-server-0.1.5.tar.gz
Algorithm Hash digest
SHA256 79d29db6ae93758dad364f88b8864554f36c5c20ef0aa178e324f022050ff2f4
MD5 997b19499c38070a016232e33a1fceed
BLAKE2b-256 0d1495db597a72d20eee8b6ee61d8e0340cc97e9fb1af84f52bb4b0b24cf6547

See more details on using hashes here.

File details

Details for the file cadquery_server-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: cadquery_server-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 2.9 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

Hashes for cadquery_server-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ab142431c74fdf04c741d1717546b41ad75818c14eccb6c0ed1b90d4acca6c37
MD5 2899d404447fc74c99ca95a7b5818193
BLAKE2b-256 8888a9e32db2a0a5809c356fe0cf3a79aca1966b04ed2d8de7df78f69567e5b5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page