@file-viewer/renderer-3d 3.2.1 → 3.2.2
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/GEO3D.md +12 -3
- package/README.en.md +37 -3
- package/README.md +37 -3
- package/dist/geo3d-workers/manifest.json +2 -2
- package/dist/geo3dPointFactories.js +6 -6
- package/dist/geo3dRasterFactories.js +1 -1
- package/dist/geo3dRuntime.js +2 -1
- package/package.json +3 -3
package/GEO3D.md
CHANGED
|
@@ -35,7 +35,7 @@ glTF resources and textures remain relative to the dataset.
|
|
|
35
35
|
Giro3D is an optional peer, matching the IFC specialist entry:
|
|
36
36
|
|
|
37
37
|
```sh
|
|
38
|
-
npm install @file-viewer/renderer-3d @giro3d/giro3d@2.0.
|
|
38
|
+
npm install @file-viewer/renderer-3d @giro3d/giro3d@2.0.5
|
|
39
39
|
# Only required when 3TZ archives are enabled:
|
|
40
40
|
npm install jszip@3.10.2
|
|
41
41
|
|
|
@@ -51,7 +51,7 @@ npm install --save-dev @types/three@0.185.0
|
|
|
51
51
|
|
|
52
52
|
The NodeNext and Bundler consumer checks keep `strict: true` and
|
|
53
53
|
`skipLibCheck: false`, and exercise the real Giro3D classes and format-narrowed
|
|
54
|
-
hooks. Giro3D 2.0.
|
|
54
|
+
hooks. Giro3D 2.0.5 requires the Three 0.180 runtime; the renderer retains its own
|
|
55
55
|
Three 0.186 dependency. Three type host 0.186 adds a `dispose` event that conflicts
|
|
56
56
|
with Giro3D's published `LayerNodeEventMap` and `TileMeshEventMap` declarations.
|
|
57
57
|
That upstream combination is not supported by the strict optional-entry check.
|
|
@@ -271,7 +271,7 @@ cases run against both workspace output and physical installed tarballs.
|
|
|
271
271
|
|
|
272
272
|
### Pinned engine maintenance boundary
|
|
273
273
|
|
|
274
|
-
The ownership adapters deliberately depend on reviewed Giro3D 2.0.
|
|
274
|
+
The ownership adapters deliberately depend on reviewed Giro3D 2.0.5 source.
|
|
275
275
|
Besides source-local pool injection, the PointCloud subclass overrides the
|
|
276
276
|
engine's internal loading method to link node and viewer cancellation. Source
|
|
277
277
|
initialization uses protected readiness fields. These are not an assertion of
|
|
@@ -308,6 +308,15 @@ Remote COPC uses strict byte ranges: HTTP 206, exposed and matching
|
|
|
308
308
|
COPC uses `File.slice()`. Plain LAS/LAZ uses the derived Giro3D `LASSource` with a
|
|
309
309
|
bounded whole-file read controlled by `maxLasBytes`; it is not progressive.
|
|
310
310
|
|
|
311
|
+
COPC initialization still reads the hierarchy metadata before the first point
|
|
312
|
+
frame. Adjacent declared hierarchy pages share a request, with merged spans
|
|
313
|
+
limited to 512 KiB and at most eight group reads per source. Gaps are not
|
|
314
|
+
prefetched; an isolated larger page retains its original range. Point payloads
|
|
315
|
+
remain selected by the engine's LOD. This does not guarantee a fixed startup
|
|
316
|
+
time on high-latency data origins. Point clouds without a Color attribute can
|
|
317
|
+
select Intensity or Z through the public post-load hook and set the attribute
|
|
318
|
+
color-map bounds to the data range.
|
|
319
|
+
|
|
311
320
|
The point-cloud scene CRS must match the dataset CRS. An incompatible scene is
|
|
312
321
|
rejected before application hooks; no runtime point-cloud reprojection is
|
|
313
322
|
performed. Reproject the dataset beforehand when a different scene is required.
|
package/README.en.md
CHANGED
|
@@ -1,7 +1,41 @@
|
|
|
1
1
|
# @file-viewer/renderer-3d
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Standalone 3D model renderer for Flyfish File Viewer. It uses Three.js, OrbitControls, and lazy format-specific loaders for GLB / GLTF, OBJ, STL, PLY, FBX, DAE, 3DS, 3MF, AMF, USD, KMZ, PCD, VRML, XYZ, VTK, and related files. STEP / STP, IGES / IGS, and BREP use a local OCCT worker for real geometry decoding and rendering.
|
|
4
4
|
|
|
5
|
-
Usage
|
|
5
|
+
## Usage
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
```ts
|
|
8
|
+
import FileViewer from '@file-viewer/vue3'
|
|
9
|
+
import { modelRenderer } from '@file-viewer/renderer-3d'
|
|
10
|
+
|
|
11
|
+
const options = {
|
|
12
|
+
rendererMode: 'replace',
|
|
13
|
+
renderers: modelRenderer,
|
|
14
|
+
model: {
|
|
15
|
+
workerUrl: '/viewer-assets/wasm/model/occt-worker.js',
|
|
16
|
+
runtimeUrl: '/viewer-assets/wasm/model/occt-import-js.js',
|
|
17
|
+
wasmUrl: '/viewer-assets/wasm/model/occt-import-js.wasm',
|
|
18
|
+
workerTimeoutMs: 120_000,
|
|
19
|
+
},
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`modelRenderer` can be combined with CAD and other renderer packages, or consumed through `@file-viewer/preset-all`. Full packages and `@file-viewer/vite-plugin` prepare the default offline assets. A renderer-only integration must self-host the OCCT worker, runtime, WASM, and both license notices.
|
|
24
|
+
|
|
25
|
+
Specialist capabilities stay opt-in through separate subpath entries: `@file-viewer/renderer-3d/ifc` for IFC and `@file-viewer/renderer-3d/geo3d` for LAS / LAZ / COPC / GeoTIFF / COG / CityJSON / 3D Tiles / 3TZ. Neither sub-entry is imported by the ordinary model renderer or added implicitly to Full presets. See `IFC.md` and `GEO3D.md` for installation, self-hosted runtime assets, and configuration.
|
|
26
|
+
|
|
27
|
+
Default paths:
|
|
28
|
+
|
|
29
|
+
- `wasm/model/occt-worker.js`
|
|
30
|
+
- `wasm/model/occt-import-js.js`
|
|
31
|
+
- `wasm/model/occt-import-js.wasm`
|
|
32
|
+
|
|
33
|
+
For subpath deployments or a dedicated asset origin, provide final URLs through `options.model.workerUrl`, `runtimeUrl`, and `wasmUrl`. There is no runtime CDN fallback. A strict CSP must allow that origin in `worker-src`, `script-src`, and `connect-src`; some browsers also require `script-src 'wasm-unsafe-eval'`.
|
|
34
|
+
|
|
35
|
+
## Boundaries
|
|
36
|
+
|
|
37
|
+
- STEP / STP, IGES / IGS, and BREP are tessellated by `occt-import-js` / OpenCascade in a worker. Assembly hierarchy, instances, normals, and face colors are preserved when the Three.js scene is built.
|
|
38
|
+
- General models support WebGL orbit controls, fit-to-view, grid, axes, wireframe, and auto-rotate. External textures or binary resources referenced by `gltf`, `dae`, and `fbx` continue to resolve against the original file URL directory.
|
|
39
|
+
- Unified global zoom: the renderer registers the standard zoom provider, so the outer toolbar's zoom in, zoom out, reset, and fit actions control the camera. Wheel, trackpad, and pinch zoom also update the shared zoom state.
|
|
40
|
+
- IFC is available through the explicit `@file-viewer/renderer-3d/ifc` specialist entry. Streaming COPC / 3D Tiles are available through the explicit `@file-viewer/renderer-3d/geo3d` entry. 3DM still needs a dedicated `rhino3dm` renderer.
|
|
41
|
+
- `@file-viewer/core` does not bundle Three.js or a geometry kernel. Install this renderer, the matching preset, or a full package when model preview is required.
|
package/README.md
CHANGED
|
@@ -1,7 +1,41 @@
|
|
|
1
1
|
# @file-viewer/renderer-3d
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Flyfish File Viewer 的独立 3D 模型 renderer。它使用 Three.js、OrbitControls 和按格式异步加载的 loader,在浏览器内预览 GLB / GLTF、OBJ、STL、PLY、FBX、DAE、3DS、3MF、AMF、USD、KMZ、PCD、VRML、XYZ、VTK 等模型;STEP / STP、IGES / IGS 和 BREP 则通过本地 OCCT Worker 完成真实几何解析和渲染。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## 用法
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
```ts
|
|
8
|
+
import FileViewer from '@file-viewer/vue3'
|
|
9
|
+
import { modelRenderer } from '@file-viewer/renderer-3d'
|
|
10
|
+
|
|
11
|
+
const options = {
|
|
12
|
+
rendererMode: 'replace',
|
|
13
|
+
renderers: modelRenderer,
|
|
14
|
+
model: {
|
|
15
|
+
workerUrl: '/viewer-assets/wasm/model/occt-worker.js',
|
|
16
|
+
runtimeUrl: '/viewer-assets/wasm/model/occt-import-js.js',
|
|
17
|
+
wasmUrl: '/viewer-assets/wasm/model/occt-import-js.wasm',
|
|
18
|
+
workerTimeoutMs: 120_000,
|
|
19
|
+
},
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
也可以把 `modelRenderer` 与 CAD 等 renderer 组合,或直接使用已经聚合它的 `@file-viewer/preset-all`。full 包和 `@file-viewer/vite-plugin` 会准备默认离线资产;只安装 renderer 时,需要自行托管 OCCT Worker、runtime、WASM 和两个许可证文件。
|
|
24
|
+
|
|
25
|
+
专用能力继续通过显式子路径按需安装:IFC 使用 `@file-viewer/renderer-3d/ifc`,LAS / LAZ / COPC / GeoTIFF / COG / CityJSON / 3D Tiles / 3TZ 使用 `@file-viewer/renderer-3d/geo3d`。普通 3D 入口不会导入这两个子入口,Full preset 也不会隐式加入它们。安装、自托管运行时资源和配置分别见 `IFC.md` 与 `GEO3D.md`。
|
|
26
|
+
|
|
27
|
+
默认路径为:
|
|
28
|
+
|
|
29
|
+
- `wasm/model/occt-worker.js`
|
|
30
|
+
- `wasm/model/occt-import-js.js`
|
|
31
|
+
- `wasm/model/occt-import-js.wasm`
|
|
32
|
+
|
|
33
|
+
部署在子路径或独立资产域名时,通过 `options.model.workerUrl`、`runtimeUrl`、`wasmUrl` 传入最终 URL。不要使用运行时 CDN 回退。严格 CSP 需要在 `worker-src`、`script-src` 和 `connect-src` 中允许对应来源;部分浏览器还需要 `script-src 'wasm-unsafe-eval'`。
|
|
34
|
+
|
|
35
|
+
## 能力边界
|
|
36
|
+
|
|
37
|
+
- STEP / STP、IGES / IGS、BREP:在 Worker 中使用 `occt-import-js` / OpenCascade 三角化,保留装配层级、实例、法线和面颜色,再构建 Three.js 场景。
|
|
38
|
+
- 通用模型:支持 WebGL 轨道控制、适配视图、网格、坐标轴、线框和自动旋转。`gltf` / `dae` / `fbx` 的外部贴图或二进制资源继续以原始 `url` 目录为基准加载。
|
|
39
|
+
- 全局统一缩放:renderer 注册标准缩放 provider,因此外层工具栏的放大、缩小、比例重置和适配视图会直接控制相机;滚轮、触控板和捏合缩放也会同步更新全局比例状态。
|
|
40
|
+
- IFC 可通过显式的 `@file-viewer/renderer-3d/ifc` 专用入口启用;LAS / LAZ / COPC / GeoTIFF / COG / CityJSON / 3D Tiles / 3TZ 可通过 `@file-viewer/renderer-3d/geo3d` 启用。3DM 仍需专门的 `rhino3dm` renderer。
|
|
41
|
+
- `@file-viewer/core` 不内置 Three.js 或几何内核。需要模型预览时请显式安装本包、相应 preset,或 full 包。
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"PointCloudSource": "882f470513f76ce024fe2284d73e7c235530654655894c5efc8e67a81d087552",
|
|
9
9
|
"worker": "cd2fb4cf51d66175b21dcdc70229a6f256c83b923e5ed5cd6445a65cf8bf130b"
|
|
10
10
|
},
|
|
11
|
-
"adapterSha256": "
|
|
11
|
+
"adapterSha256": "b551f7c04ba68419c64703e11b692221e7654fa4202ebd5aee4307b23faa6689",
|
|
12
12
|
"workerSha256": "831459fc9f82443bd0f3d2c12a8d7b1a1f0308c55f09a53cc3759034a02fec0b",
|
|
13
13
|
"packages": [
|
|
14
14
|
{
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"geotiffPool": "6b8cdc6a98f9f443dbb5ddfb516a7ce01ae40ca776ba6a1e9cc2a9667a148ae3",
|
|
92
92
|
"geotiffWorker": "4453d3dca492eedca5e4d78d66e1153569f0af5d0d2bd178f7bab400b1d581e8"
|
|
93
93
|
},
|
|
94
|
-
"factorySha256": "
|
|
94
|
+
"factorySha256": "7f6b4b16aec23c90319b90c8e445dbae3635bed0d36d35f4ad90440a957bbad8",
|
|
95
95
|
"files": {
|
|
96
96
|
"geotiff-worker.js": "7857b60dc9a4e2b915eda04a7b5697a0322464ccedbd4568d5ce3f280b284f36",
|
|
97
97
|
"texture-worker.js": "5d6131d4f184845deb75284b7903e29b8d5394f73f9abe6d88406efee56200a5"
|