@omrips/viewstl 2.0.0-rc.1 → 2.0.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,9 +4,34 @@
4
4
 
5
5
  Embed a viewer in your website, open local 3D files, inspect models and save the result. ViewSTL v2 uses its own renderer, with no Three.js runtime required. File parsing and geometry analysis run in workers, with memory limits and cancellation support.
6
6
 
7
- [Try the preview](https://preview.viewstl.com/) · [v2 usage and API notes](https://unpkg.com/@omrips/viewstl@2.0.0-rc.1/docs/v2-usage.md) · [Legacy plugin documentation](https://www.viewstl.com/plugin/)
7
+ [Try the preview](https://preview.viewstl.com/) · [v2 usage and API notes](https://unpkg.com/@omrips/viewstl@2.0.0-rc.3/docs/v2-usage.md) · [Legacy plugin documentation](https://www.viewstl.com/plugin/)
8
8
 
9
- > **Preview release: 2.0.0-rc.1.** v2 is a new implementation, with documented differences from v1. Existing versions remain available at their original paths. Read the migration notes before updating an existing integration.
9
+ > **Preview release: 2.0.0-rc.3.** v2 is a new implementation, with documented differences from v1. Existing versions remain available at their original paths. Read the migration notes before updating an existing integration.
10
+
11
+ ## Quick start
12
+
13
+ Install with `npm install @omrips/viewstl@2.0.0-rc.3`, then copy the complete `node_modules/@omrips/viewstl/build/v2/` folder to `/viewstl-v2/` on your website.
14
+
15
+ Paste these three lines into your page's `<body>`:
16
+
17
+ ```html
18
+ <div id="viewer" style="height:500px"></div>
19
+ <script src="/viewstl-v2/viewstl.min.js"></script>
20
+ <script>new StlViewer(document.getElementById('viewer'), { models: [{ filename: 'model.stl' }] });</script>
21
+ ```
22
+
23
+ Replace `model.stl` with your model's path and open the page over HTTP(S). That's it. You can also drag local files onto the viewer.
24
+
25
+ ## Quick start (Node.js)
26
+
27
+ For server-side model analysis, install `npm install @omrips/viewstl@2.0.0-rc.3` and run:
28
+
29
+ ```js
30
+ import { analyzeFile } from '@omrips/viewstl/node';
31
+ const report = await analyzeFile('part.stl', { units: 'mm' });
32
+ ```
33
+
34
+ Requires Node.js 20+. Workers and CAD assets load directly from the installed package. The result is a JSON-compatible report with dimensions, surface area, validated volume and mesh checks. STL, OBJ, 3MF, STEP and IGES are supported. See [server API and limits](https://unpkg.com/@omrips/viewstl@2.0.0-rc.3/docs/v2-usage.md#nodejs-model-analysis) for buffers, batch processing, cancellation and unit handling.
10
35
 
11
36
  ## What v2 can do
12
37
 
@@ -16,6 +41,7 @@ Embed a viewer in your website, open local 3D files, inspect models and save the
16
41
  - **Save locally:** PNG images and mesh exports in binary STL, OBJ, 3MF, STEP and IGES.
17
42
  - **Save and restore scenes:** VSB packages the scene and meshes; VSJ stores scene settings and references to model files.
18
43
  - **Check meshes for 3D printing:** topology checks, detailed intersection and volume analysis, issue highlights and optional FDM estimates.
44
+ - **Analyze on a server:** a Node.js API reuses the same parsers and mesh checks in background workers, with bounded concurrency and cancellation.
19
45
  - **Embed in your own interface:** use the `StlViewer` API, or bind your own markup to the optional `mountViewstlApp` controller.
20
46
 
21
47
  ## Usage
@@ -64,12 +90,12 @@ Replace `/models/part.stl` with a model URL you serve. To open a local file inst
64
90
 
65
91
  ### npm and bundlers
66
92
 
67
- > **Release candidate:** `2.0.0-rc.1` is the first npm release of ViewSTL v2.00. Candidates use the `next` dist-tag; pin the version below for a repeatable installation.
93
+ > **Release candidate:** `2.0.0-rc.3` adds the Node.js model-analysis API to ViewSTL v2.00. Candidates use the `next` dist-tag; pin the version below for a repeatable installation.
68
94
 
69
95
  Install the package in your application:
70
96
 
71
97
  ```sh
72
- npm install @omrips/viewstl@2.0.0-rc.1
98
+ npm install @omrips/viewstl@2.0.0-rc.3
73
99
  ```
74
100
 
75
101
  Copy the **complete `node_modules/@omrips/viewstl/build/v2/` directory** to your application's static assets. For an application that serves `public/` at its root, use `public/viewstl-v2/`. Keep the worker, `chunks/`, `cad/` and notices together; repeat this copy when updating the package.
@@ -94,7 +120,7 @@ const viewer = new StlViewer(document.getElementById('viewer'), {
94
120
 
95
121
  Set `worker_url` to the URL where your application serves the copied worker, and replace `/models/part.stl` with your model URL. The bundler handles the viewer import; the static directory supplies its worker and optional parser assets. Creating a viewer requires a browser DOM and WebGL 2.
96
122
 
97
- The distribution includes TypeScript declarations and a CommonJS entry point. The static-assets setup above is verified with Vite 8.3.4 and Webpack 5.112.0. See [usage and packaging](https://unpkg.com/@omrips/viewstl@2.0.0-rc.1/docs/v2-usage.md) for worker factories, callbacks and more examples.
123
+ The distribution includes TypeScript declarations and a CommonJS entry point. The static-assets setup above is verified with Vite 8.3.4 and Webpack 5.112.0. See [usage and packaging](https://unpkg.com/@omrips/viewstl@2.0.0-rc.3/docs/v2-usage.md) for worker factories, callbacks and more examples.
98
124
 
99
125
  ## Formats and saving
100
126
 
@@ -111,13 +137,15 @@ The distribution includes TypeScript declarations and a CommonJS entry point. Th
111
137
 
112
138
  STL, OBJ, 3MF, STEP and IGES export model geometry. **VSB and VSJ save the scene**, including its models, transforms and viewing settings. VSJ requires access to its referenced model files; VSB carries its mesh data inside the archive.
113
139
 
114
- STEP/IGES exports describe the loaded triangle mesh. They do not reconstruct original CAD solids, curves, feature history or assemblies. OBJ import does not load external materials or textures, and 3MF support does not cover every extension. See the [format and export details](https://unpkg.com/@omrips/viewstl@2.0.0-rc.1/docs/v2-usage.md#rendering-and-file-processing).
140
+ STEP/IGES exports describe the loaded triangle mesh. They do not reconstruct original CAD solids, curves, feature history or assemblies. OBJ import does not load external materials or textures, and 3MF support does not cover every extension. See the [format and export details](https://unpkg.com/@omrips/viewstl@2.0.0-rc.3/docs/v2-usage.md#rendering-and-file-processing).
115
141
 
116
142
  ## Local files and URL imports
117
143
 
118
- Local file contents are processed on the user's device. Rendering, mesh checks, model exports and scene saving do not require an upload or a conversion service. Archive and CAD support load additional assets only when needed.
144
+ In the browser, local file contents are processed on the user's device. Rendering, mesh checks, model exports and scene saving do not require an upload or a conversion service. Archive and CAD support load additional assets only when needed.
145
+
146
+ The optional Node.js API processes files on the machine running Node. If your application accepts uploads for server analysis, those files leave the user's device. The package itself provides no upload endpoint and does not send model data anywhere.
119
147
 
120
- Direct URL imports require the remote server to allow browser access through CORS. A host application can configure its own streaming relay for other public URLs. **The relay is a separate server service**, not part of the plugin's JavaScript bundle. The preview website uses such a relay; URL imports pass through that server. See [URL import configuration](https://unpkg.com/@omrips/viewstl@2.0.0-rc.1/docs/v2-usage.md#optional-streaming-url-imports).
148
+ Direct URL imports require the remote server to allow browser access through CORS. A host application can configure its own streaming relay for other public URLs. **The relay is a separate server service**, not part of the plugin's JavaScript bundle. The preview website uses such a relay; URL imports pass through that server. See [URL import configuration](https://unpkg.com/@omrips/viewstl@2.0.0-rc.3/docs/v2-usage.md#optional-streaming-url-imports).
121
149
 
122
150
  ## Existing users and previous versions
123
151
 
@@ -128,11 +156,11 @@ Direct URL imports require the remote server to allow browser access through COR
128
156
  | Source | Existing files in `src/` | `src/v2/` |
129
157
  | Browser script | `build/stl_viewer.min.js` | `build/v2/viewstl.min.js` |
130
158
  | Renderer | Three.js | Native WebGL 2 |
131
- | Documentation | [viewstl.com/plugin](https://www.viewstl.com/plugin/) | [Package usage and API notes](https://unpkg.com/@omrips/viewstl@2.0.0-rc.1/docs/v2-usage.md) |
159
+ | Documentation | [viewstl.com/plugin](https://www.viewstl.com/plugin/) | [Package usage and API notes](https://unpkg.com/@omrips/viewstl@2.0.0-rc.3/docs/v2-usage.md) |
132
160
 
133
- The familiar `StlViewer` constructor and many public methods are retained. Integrations that access Three.js camera, scene, renderer or model internals need migration. v2 requires WebGL 2 and does not include the legacy WebGL 1 or Canvas fallback. See [API differences and migration notes](https://unpkg.com/@omrips/viewstl@2.0.0-rc.1/docs/v2-usage.md#existing-api-and-intentional-differences).
161
+ The familiar `StlViewer` constructor and many public methods are retained. Integrations that access Three.js camera, scene, renderer or model internals need migration. v2 requires WebGL 2 and does not include the legacy WebGL 1 or Canvas fallback. See [API differences and migration notes](https://unpkg.com/@omrips/viewstl@2.0.0-rc.3/docs/v2-usage.md#existing-api-and-intentional-differences).
134
162
 
135
- Existing tags and release history are retained. The [legacy archive notes](https://unpkg.com/@omrips/viewstl@2.0.0-rc.1/legacy/README.md) also describe the separate local v1.14 snapshot and its provenance.
163
+ Existing tags and release history are retained. The [legacy archive notes](https://unpkg.com/@omrips/viewstl@2.0.0-rc.3/legacy/README.md) also describe the separate local v1.14 snapshot and its provenance.
136
164
 
137
165
  The documentation link remains **https://www.viewstl.com/plugin/**. It currently documents the legacy plugin; v2 guidance is included in this package while the website documentation is prepared.
138
166
 
@@ -141,7 +169,7 @@ The documentation link remains **https://www.viewstl.com/plugin/**. It currently
141
169
  - A browser with WebGL 2 and module-worker support; WebAssembly is required for STEP/IGES import.
142
170
  - Model capacity depends on geometry complexity and available browser/GPU memory. Configured limits reject files that exceed the budget.
143
171
  - Print checks describe the loaded mesh. FDM results are estimates, and checks do not guarantee a successful print. Models are checked separately; assembly overlaps are not evaluated.
144
- - The preview has automated and desktop Chromium/Edge coverage. Firefox, Safari and physical mobile-device validation remain pending. See [verification and known limits](https://unpkg.com/@omrips/viewstl@2.0.0-rc.1/docs/v2-verification.md).
172
+ - The preview has automated and desktop Chromium/Edge coverage. Firefox, Safari and physical mobile-device validation remain pending. See [verification and known limits](https://unpkg.com/@omrips/viewstl@2.0.0-rc.3/docs/v2-verification.md).
145
173
 
146
174
  ## Development
147
175
 
@@ -160,4 +188,4 @@ Open `http://127.0.0.1:8772/examples/v2/` for the local demo. The build writes t
160
188
 
161
189
  ## License
162
190
 
163
- ViewSTL is available under the [MIT license](https://unpkg.com/@omrips/viewstl@2.0.0-rc.1/LICENSE). Optional archive and CAD dependencies have their own licenses and notices; see [third-party notices](https://unpkg.com/@omrips/viewstl@2.0.0-rc.1/THIRD-PARTY-NOTICES.txt).
191
+ ViewSTL is available under the [MIT license](https://unpkg.com/@omrips/viewstl@2.0.0-rc.3/LICENSE). Optional archive and CAD dependencies have their own licenses and notices; see [third-party notices](https://unpkg.com/@omrips/viewstl@2.0.0-rc.3/THIRD-PARTY-NOTICES.txt).
@@ -9,3 +9,7 @@ The existing `../stl_viewer.min.js` and its companion files remain the
9
9
  legacy distribution. A v2 build must never overwrite those files.
10
10
 
11
11
  See [the compatibility requirements](../../docs/v2-compatibility.md).
12
+
13
+ `node/` contains the separate server analysis entry points and worker, exported
14
+ as `@omrips/viewstl/node`. These resolve `cad/` inside the npm package; Node users
15
+ do not need to copy assets to a website.