Skip to main content

Jupyter renderer for the OpenSCAD & SolidPython constructive solid geometry systems

Project description

ViewSCAD: CAD in Jupyter

ViewSCAD is a module that renders within a Jupyter notebook 3D objects described in the OpenSCAD language, or described using the SolidPython module. It provides a workflow for CAD design completely within the Jupyter notebook.

Installation

ViewSCAD utilizes the openscad executable to render objects, and as such, OpenSCAD must be installed on your system.

ViewSCAD installs simply with pip:

pip install viewscad

ViewSCAD uses the pythreejs notebook extension to render the 3D graphics. If you intend to use jupyter notebook, you should be all set. However, if you intend to use jupyter lab, additional steps are necessary to get pythreejs working in the lab. Firstly, you must install node.js and npm. Then you must install the lab extensions:

jupyter labextension install @jupyter-widgets/jupyterlab-manager

Setup and Usage

See the OpenSCAD and SolidPython pages for how to use these languages to represent geometric objects.

The following shows how to use ViewSCAD to render a SolidPython object in Jupyter: solidpython example

ViewSCAD attempts to locate your openscad executable, based on your platform, but failing that, you can set the OPENSCAD_EXEC environment variable to point at your openscad command-line executable, or pass it in the constructor of the renderer:

renderer = viewscad.Renderer(openscad_exec='path_of_my_openscad')

You can also render OpenSCAD code: openscad example

The renderer can also create an .STL file directly by simply adding an outfile keyword:

r.render(c, outfile='my_thing.stl')

Intropection

By double-clicking on a rendered object, you can select faces, edges, and vertices, and learn their indices. This allows you to use several useful utilities, like Renderer.rotate_face_down() put orient the object with a particular face downward, or Renderer.place_on(), which lets you place one object upon another: introspection example

Acknowledgements

Thanks to Evan Jones for help creating the PyPI package.

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

viewscad-0.2.0.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

viewscad-0.2.0-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file viewscad-0.2.0.tar.gz.

File metadata

  • Download URL: viewscad-0.2.0.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for viewscad-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7a3309c48ed9e48e4c3db44b6f0e38c2f6022b8521a4555a7aeddac87ca3bebb
MD5 f72eb84010395df5df4b19f23fdf3e98
BLAKE2b-256 24b3ddc85d1c210a8dc44df1db4619ea816ac5ee9bbd3fb4c0a715a96b9f1f8e

See more details on using hashes here.

File details

Details for the file viewscad-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: viewscad-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for viewscad-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00b72aeda1d35c398f7b3a2dc82b78ac19cd38064cb179fb465499d2faaf698a
MD5 a2833381ee267157e833eb8762e9cec1
BLAKE2b-256 f892571fd0e02fe9bd8594c24ec196f3d30280facf0e556c897de34b58a16499

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