Skip to content

An ipywidget based interface to the Javascript three-cad-viewer

License

Notifications You must be signed in to change notification settings

Kesci/cad-viewer-widget

 
 

Repository files navigation

cad-viewer-widget

A Jupyter widget to view CAD objects

cad-viewer-widgets has its origin in Jupyter-CadQuery, which now has been split into 3 layers. This repo being the middle layer:

  1. three-cad-viewer This is the complete CAD viewer written in Javascript with threejs being the only dependency.

  2. cad-view-widget (this repository) A thin layer on top of cad-viewer-widget that wraps the CAD viewer into an ipywidget. The API documentation can be found here

  3. Jupyter-CadQuery A CadQuery viewer, collecting and tessellating CadQuery objects, using cad-view-widget to visualize the objects

Click on the "launch binder" icon to start cad-viewer-widget on binder:

Binder: Latest development version

Examples

Installation

To install use pip:

$ pip install cad_viewer_widget

For a development installation (requires Node.js and Yarn version 1),

$ git clone https://github.com/bernhard-42/cad-viewer-widget.git
$ cd cad-viewer-widget
$ pip install -e .
$ jupyter nbextension install --py --symlink --overwrite --sys-prefix cad_viewer_widget
$ jupyter nbextension enable --py --sys-prefix cad_viewer_widget

When actively developing your extension for JupyterLab, run the command:

$ jupyter labextension develop --overwrite cad_viewer_widget

Then you need to rebuild the JS when you make a code change:

$ cd js
$ yarn run build

You then need to refresh the JupyterLab page when your javascript changes.

About

An ipywidget based interface to the Javascript three-cad-viewer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 47.6%
  • Jupyter Notebook 28.5%
  • JavaScript 22.1%
  • Makefile 1.3%
  • CSS 0.5%