Skip to main content

Solid 3D Cad (SCAD) renderer and viewer for Jupyter

Project description

Jupyter SCAD: SCAD in Jupyter

Jupyter SCAD renders and interactively visualizes 3D objects described in SolidPython2 within a Jupyter notebook.

This program is focused on the use case of generating stl files with Python (aka SolidPython2) interactively within a Jupyter notebook.

Documentation

Documentation is hosted at https://jreiberkyle.github.io/jupyterscad/.

Quick Start

Jupyter SCAD can be installed with pip:

pip install jupyterscad

An OpenSCAD object can be defined using SolidPython2, visualized in a Jupyter notebook, and saved to an stl file with:

from jupyterscad import render
from solid2 import cube

render(cube([1.5,2,1],center=True), outfile='cube.stl')

render example

Alternatives

As an alternative to Jupyter SCAD, one could use a Jupyter notebook as an external editor, using SolidPython2 to update the SCAD file and OpenSCAD to visualize and render the SCAD file. The benefit to this approach is that one can visualize the preview. The drawback is that the two-program workflow can feel distracting. See more on using external editors for OpenSCAD here.

Or, one can use ViewSCAD, which was the motivation for this project. However the last time ViewSCAD was updated was 2019 (checked on 9/21/2023). It only supports SolidPython, not SolidPython2.

Transitioning from ViewSCAD

This package was inspired by ViewSCAD and therefore maintains a very similar interface.

To transition from ViewSCAD, replace

import viewscad

r = viewscad.Renderer()
r.render(obj)

with

import jupyterscad

jupyterscad.render(obj)

Visualization Backend

This package uses pythreejs for visualization.

Alternatives considered, ordered from closest fit to farthest:

  • pyvolume: provides mesh visualization and interaction but (as of 2023.09.24) the latest release is alpha and documentation is sparse.
  • matplotlib mplot3d: provides mesh visualization and interaction but is slow.
  • pyvista: provides stl loading and visualization but visualization does not work in docker image.

Acknowledgements

Thanks to nickc92 for creating ViewSCAD, which is the inspiration for this project.

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

jupyterscad-0.2.0.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

jupyterscad-0.2.0-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jupyterscad-0.2.0.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for jupyterscad-0.2.0.tar.gz
Algorithm Hash digest
SHA256 516d89d26d6c26b023dfabf7cdeb406ef4d87e2471bf2ff657c1f7b06b4df01d
MD5 94d961d4bb36574b6ecf1e7effe23d8e
BLAKE2b-256 ca94d19d5d9f43b5a3081bed117e0cfb7b5b8c2583d96a7b8f8c68cdec18e0e7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jupyterscad-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 20.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for jupyterscad-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9440857e8a9fe8fdc25efa3660615a5574f450b4c9e892744181a9e56288842
MD5 9426ea0eaf1db5ab9521342018ededac
BLAKE2b-256 9e7b8e264c103045f60fa8065601ee636dd1c1fc47e77ebd7f184bdc05657e42

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