diff --git a/README.md b/README.md index 6abc401..680268b 100644 --- a/README.md +++ b/README.md @@ -1 +1,44 @@ -# Yet Another CAD Viewer \ No newline at end of file +# Yet Another CAD Viewer + +This is a CAD viewer capable of displaying [OCP](https://github.com/CadQuery/OCP) +models ([CadQuery](https://github.com/CadQuery/cadquery)/[Build123d](https://github.com/gumyr/build123d)/...) +in a web browser. + +## Features + +- Cross-platform: works on any modern web browser. +- All [GLTF 2.0](https://www.khronos.org/gltf/) features (textures, PBR materials, animations...). +- All [model-viewer](https://modelviewer.dev/) features (smooth controls, augmented reality...). +- Load multiple models at once, load external models and even images as quads. +- View and interact with topological entities: faces, edges, vertices and locations. +- Control clipping planes and transparency of each model. +- Select any entity and measure bounding box size and distances. +- Fully-featured [static deployment](#static-deployment): just upload the viewer and models to your server. +- [Live lazy updates](#live-updates) while editing the CAD model (using the [yacv_server](yacv_server)). + +## Usage & demo + +The latest build is available at https://yeicor-3d.github.io/yet-another-cad-viewer/. + +### Live updates + +To see the live updates you will need to run the [yacv_server](yacv_server) and +open [the viewer](https://yeicor-3d.github.io/yet-another-cad-viewer/) with +the `preloadModels=ws://:32323/` query parameter (by default it already tries localhost). + +Note that [yacv_server](yacv_server) also hosts the frontend at `http://localhost:32323/` if you have no access to the +internet. + +### Static deployment + +To deploy the viewer and models as a static website you can simply copy the latest build directory to your server. +To load models use the `preloadModels=...` query parameter in the URL. +It can be set multiple times to load multiple models. + +Note that you can simply reuse the [main deployment](https://yeicor-3d.github.io/yet-another-cad-viewer/) and host only +your own models (linking them from the viewer with the `preloadModels` query parameter). + +To see a working example of a static deployment you can check out +the [demo](https://yeicor-3d.github.io/yet-another-cad-viewer/?preloadModels=base.glb&preloadModels=fox.glb&preloadModels=img.jpg.glb&preloadModels=location.glb). + +![Demo](assets/screenshot.png) diff --git a/assets/screenshot.png b/assets/screenshot.png new file mode 100644 index 0000000..4fc20cd Binary files /dev/null and b/assets/screenshot.png differ diff --git a/frontend/misc/settings.ts b/frontend/misc/settings.ts index f505129..55660a7 100644 --- a/frontend/misc/settings.ts +++ b/frontend/misc/settings.ts @@ -14,7 +14,7 @@ export const settings = { ], displayLoadingEveryMs: 1000, /* How often to display partially loaded models */ monitorEveryMs: 100, - monitorOpenTimeoutMs: 10000, + monitorOpenTimeoutMs: 100, // ModelViewer settings autoplay: true, arModes: 'webxr scene-viewer quick-look',