Metadata-Version: 2.1
Name: cad_viewer_widget
Version: 2.0.2
Summary: A Jupyter widget to view cad objects
Project-URL: Repository, https://github.com/bernhard-42/cad-viewer-widget.git
Author-email: Bernhard Walter <b_waltrer@arcor.de>
License: Copyright (c) 2021 Bernhard Walter
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License-File: LICENSE
Classifier: Framework :: Jupyter
Classifier: Framework :: Jupyter :: JupyterLab
Classifier: Framework :: Jupyter :: JupyterLab :: 4
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.8
Requires-Dist: ipywidgets~=8.0
Requires-Dist: jupyterlab~=4.0
Requires-Dist: numpy
Requires-Dist: pyparsing
Description-Content-Type: text/markdown

# cad-viewer-widget

A Jupyter widget to view CAD objects

`cad-viewer-widgets` has its origin in [Jupyter-CadQuery](https://github.com/bernhard-42/jupyter-cadquery), which now
has been split into 3 layers. This repo being the middle layer:

1. **[three-cad-viewer](https://github.com/bernhard-42/three-cad-viewer)**
   This is the complete CAD viewer written in Javascript with _[threejs](https://github.com/mrdoob/three.js/)_ 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](https://github.com/jupyter-widgets/ipywidgets). The API documentation can be found [here](https://bernhard-42.github.io/cad-viewer-widget/cad_viewer_widget/index.html)

3. **[Jupyter-CadQuery](https://github.com/bernhard-42/jupyter-cadquery)** A [CadQuery](https://github.com/CadQuery/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](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/bernhard-42/cad-viewer-widget/master?urlpath=lab&filepath=notebooks)

## Examples

- [Tests and demos](notebooks/Tests-and-demos.ipynb): Demonstrating the features using the sample tesssellations in [./examples](./examples)
- [Classic OCC Bottle](notebooks/Classic-OCC-Bottle.ipynb): A real CAD example based on [python-occ](https://github.com/tpaviot/pythonocc-core)

## Installation

To install use pip:

    $ pip install cad_viewer_widget

For a development installation (requires [Node.js](https://nodejs.org) and [Yarn version 1](https://classic.yarnpkg.com/)),

    $ git clone https://github.com/bernhard-42/cad-viewer-widget.git
    $ cd cad-viewer-widget
    $ pip install -e . 
    $ jupyter labextension develop . --overwrite 

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.


## Build step

```python
hatch build
```

## Changes

**2023-08-14**
- Adapt to [ocp-tessellate](http://github.com/bernhard-42/ocp-tessellate.git)
- Support version 1.8.6 of [three-cad-viewer](http://github.com/bernhard-42/three-cad-viewer.git)
- Supports `jupyterlab>=4`, `ipywidgets>=8` and `notebook>7`
- Dropped support for `notebook < 7.0`
- Build process now uses pyproject.toml and hatch

**2023-01-03**
- Added pyparsing as dependency
- Pinned traitlets to ~5.8
- Upgraded bottle example to occt 7.6.2

