@omrips/viewstl 2.0.0-rc.2 → 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 +28 -14
- package/build/v2/README.md +4 -0
- package/build/v2/node/analysis-worker.js +3833 -0
- package/build/v2/node/index.cjs +382 -0
- package/build/v2/node/index.d.cts +122 -0
- package/build/v2/node/index.d.ts +122 -0
- package/build/v2/node/index.js +352 -0
- package/build/v2/stl_viewer.min.js +1 -1
- package/build/v2/viewstl.cjs +1 -1
- package/build/v2/viewstl.js +1 -1
- package/build/v2/viewstl.min.js +1 -1
- package/docs/v2-compatibility.md +1 -1
- package/docs/v2-usage.md +108 -3
- package/docs/v2-verification.md +34 -0
- package/package.json +15 -1
package/README.md
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
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.
|
|
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.
|
|
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
10
|
|
|
11
11
|
## Quick start
|
|
12
12
|
|
|
13
|
-
Install with `npm install @omrips/viewstl@2.0.0-rc.
|
|
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
14
|
|
|
15
15
|
Paste these three lines into your page's `<body>`:
|
|
16
16
|
|
|
@@ -22,6 +22,17 @@ Paste these three lines into your page's `<body>`:
|
|
|
22
22
|
|
|
23
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
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.
|
|
35
|
+
|
|
25
36
|
## What v2 can do
|
|
26
37
|
|
|
27
38
|
- **Open models:** binary and ASCII STL, OBJ, 3MF, STEP/STP and IGES/IGS.
|
|
@@ -30,6 +41,7 @@ Replace `model.stl` with your model's path and open the page over HTTP(S). That'
|
|
|
30
41
|
- **Save locally:** PNG images and mesh exports in binary STL, OBJ, 3MF, STEP and IGES.
|
|
31
42
|
- **Save and restore scenes:** VSB packages the scene and meshes; VSJ stores scene settings and references to model files.
|
|
32
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.
|
|
33
45
|
- **Embed in your own interface:** use the `StlViewer` API, or bind your own markup to the optional `mountViewstlApp` controller.
|
|
34
46
|
|
|
35
47
|
## Usage
|
|
@@ -78,12 +90,12 @@ Replace `/models/part.stl` with a model URL you serve. To open a local file inst
|
|
|
78
90
|
|
|
79
91
|
### npm and bundlers
|
|
80
92
|
|
|
81
|
-
> **Release candidate:** `2.0.0-rc.
|
|
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.
|
|
82
94
|
|
|
83
95
|
Install the package in your application:
|
|
84
96
|
|
|
85
97
|
```sh
|
|
86
|
-
npm install @omrips/viewstl@2.0.0-rc.
|
|
98
|
+
npm install @omrips/viewstl@2.0.0-rc.3
|
|
87
99
|
```
|
|
88
100
|
|
|
89
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.
|
|
@@ -108,7 +120,7 @@ const viewer = new StlViewer(document.getElementById('viewer'), {
|
|
|
108
120
|
|
|
109
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.
|
|
110
122
|
|
|
111
|
-
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.
|
|
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.
|
|
112
124
|
|
|
113
125
|
## Formats and saving
|
|
114
126
|
|
|
@@ -125,13 +137,15 @@ The distribution includes TypeScript declarations and a CommonJS entry point. Th
|
|
|
125
137
|
|
|
126
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.
|
|
127
139
|
|
|
128
|
-
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.
|
|
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).
|
|
129
141
|
|
|
130
142
|
## Local files and URL imports
|
|
131
143
|
|
|
132
|
-
|
|
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.
|
|
133
147
|
|
|
134
|
-
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.
|
|
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).
|
|
135
149
|
|
|
136
150
|
## Existing users and previous versions
|
|
137
151
|
|
|
@@ -142,11 +156,11 @@ Direct URL imports require the remote server to allow browser access through COR
|
|
|
142
156
|
| Source | Existing files in `src/` | `src/v2/` |
|
|
143
157
|
| Browser script | `build/stl_viewer.min.js` | `build/v2/viewstl.min.js` |
|
|
144
158
|
| Renderer | Three.js | Native WebGL 2 |
|
|
145
|
-
| Documentation | [viewstl.com/plugin](https://www.viewstl.com/plugin/) | [Package usage and API notes](https://unpkg.com/@omrips/viewstl@2.0.0-rc.
|
|
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) |
|
|
146
160
|
|
|
147
|
-
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.
|
|
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).
|
|
148
162
|
|
|
149
|
-
Existing tags and release history are retained. The [legacy archive notes](https://unpkg.com/@omrips/viewstl@2.0.0-rc.
|
|
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.
|
|
150
164
|
|
|
151
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.
|
|
152
166
|
|
|
@@ -155,7 +169,7 @@ The documentation link remains **https://www.viewstl.com/plugin/**. It currently
|
|
|
155
169
|
- A browser with WebGL 2 and module-worker support; WebAssembly is required for STEP/IGES import.
|
|
156
170
|
- Model capacity depends on geometry complexity and available browser/GPU memory. Configured limits reject files that exceed the budget.
|
|
157
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.
|
|
158
|
-
- 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.
|
|
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).
|
|
159
173
|
|
|
160
174
|
## Development
|
|
161
175
|
|
|
@@ -174,4 +188,4 @@ Open `http://127.0.0.1:8772/examples/v2/` for the local demo. The build writes t
|
|
|
174
188
|
|
|
175
189
|
## License
|
|
176
190
|
|
|
177
|
-
ViewSTL is available under the [MIT license](https://unpkg.com/@omrips/viewstl@2.0.0-rc.
|
|
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).
|
package/build/v2/README.md
CHANGED
|
@@ -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.
|