zincjs 2.4.1-beta.7 → 3.0.1
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 +27 -22
- package/build/zinc.js +2 -2
- package/build/zinc.js.map +1 -1
- package/package.json +6 -2
- package/src/controls.js +1332 -1241
- package/src/geometryCSG.js +111 -115
- package/src/glyphsetCSG.js +51 -55
- package/src/loaders/GLTFToZincJSLoader.js +31 -33
- package/src/loaders/JSONLoader.js +339 -449
- package/src/loaders/OBJLoader.js +654 -851
- package/src/loaders/STLLoader.js +271 -329
- package/src/loaders/niftiReader.js +90 -59
- package/src/loaders/primitivesLoader.js +55 -52
- package/src/minimap.js +63 -43
- package/src/primitives/geometry.js +40 -44
- package/src/primitives/glyph.js +16 -19
- package/src/primitives/glyphset.js +229 -185
- package/src/primitives/label.js +29 -31
- package/src/primitives/lines.js +20 -20
- package/src/primitives/lines2.js +33 -39
- package/src/primitives/lod.js +43 -43
- package/src/primitives/marker.js +31 -32
- package/src/primitives/markerCluster.js +32 -35
- package/src/primitives/pointset.js +86 -83
- package/src/primitives/texturePrimitive.js +9 -10
- package/src/primitives/textureSlides.js +84 -97
- package/src/primitives/textureVolume.js +46 -49
- package/src/primitives/tubeLines.js +108 -108
- package/src/primitives/zincObject.js +176 -184
- package/src/region.js +145 -155
- package/src/renderRequests.js +3 -3
- package/src/renderer.js +635 -620
- package/src/scene.js +479 -419
- package/src/sceneExporter.js +22 -17
- package/src/sceneLoader.js +542 -296
- package/src/shaders/rgbVolumeRender.js +11 -18
- package/src/shaders/textureArray.js +5 -12
- package/src/shaders/textureSlide.js +10 -17
- package/src/shaders/volumeRender.js +11 -18
- package/src/shaders/volumeRender_old.js +11 -18
- package/src/shaders/volumeTexture.js +7 -14
- package/src/textSprite.js +23 -19
- package/src/texture/texture.js +14 -15
- package/src/texture/textureArray.js +14 -16
- package/src/three/InstancedPoints.js +2 -9
- package/src/three/Loader.js +334 -315
- package/src/three/line/Line.js +165 -215
- package/src/three/line/LineSegments.js +40 -55
- package/src/three/line/LineSegments2.js +322 -366
- package/src/three/line/LineSegmentsGeometry.js +239 -280
- package/src/three-js-csg.js +260 -252
- package/src/tsl/glyphRenderMaterial.js +12 -3
- package/src/tsl/glyphTransform.js +51 -29
- package/src/tsl/textureSlides.js +23 -24
- package/src/utilities.js +309 -371
- package/src/videoHandler.js +76 -83
- package/src/workers/geometryCSG.worker.js +33 -36
- package/src/workers/geometryCSGInternal.js +39 -44
- package/src/zinc.js +4 -7
- package/vite.config.js +7 -7
package/README.md
CHANGED
|
@@ -10,19 +10,19 @@ Why ZincJS?
|
|
|
10
10
|
|
|
11
11
|
General-purpose 3D libraries can draw meshes, but they know nothing about Zinc models. ZincJS adds the pieces needed for biomedical scaffolds:
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
- **Direct pipeline from Zinc** – load scenes exported from PyZinc / the Argon scene exporter through a single metadata file, with no custom loader code.
|
|
14
|
+
- **Region hierarchy and named groups** – objects are organised in a Zinc-like region tree and identified by anatomical group names, which makes it straightforward to link a 3D structure to search, highlighting and ontology terms.
|
|
15
|
+
- **Time-varying models** – morph-target animation of geometry and field colours (for example a beating heart or gut motility), with scene-wide playback control.
|
|
16
|
+
- **Primitives for scaffolds and fields** – surfaces, lines, tube lines, point sets, glyph sets for vector/tensor fields, labels, markers with clustering and level-of-detail switching.
|
|
17
|
+
- **Imaging alongside models** – volume rendering and texture slices from NIfTI images in the same scene as the scaffold.
|
|
18
|
+
- **Application features** – multiple scenes per renderer, picking, smooth camera transitions, auto-tumble, stereo, minimap, video synchronisation and glTF import/export.
|
|
19
19
|
|
|
20
20
|
Applications built with ZincJS:
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
- [SPARC Portal](https://sparc.science/maps?type=wholebody)
|
|
23
|
+
- [ScaffoldVuer](https://mapcore-demo.org/current/scaffoldvuer)
|
|
24
|
+
- [Scaffold Maker](https://mapcore-demo.org/2019/colon/scaffold.html)
|
|
25
|
+
- [Fitzlet](https://sites.bioeng.auckland.ac.nz/mwu035/fitzlet/)
|
|
26
26
|
|
|
27
27
|
Installation
|
|
28
28
|
------------
|
|
@@ -67,15 +67,15 @@ Camera movement, playback, loading, changes made through the ZincJS APIs and cha
|
|
|
67
67
|
|
|
68
68
|
Useful links:
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
- [Examples](https://github.com/alan-wu/ZincJS-Examples/)
|
|
71
|
+
- [Tutorials](https://github.com/alan-wu/ZincJS-Tutorials/)
|
|
72
|
+
- [API documentation](https://abi-software.github.io/ZincJS/)
|
|
73
73
|
|
|
74
74
|
Exporting models to ZincJS
|
|
75
75
|
--------------------------
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
- **Mapping Tools users** – use the [Argon scene exporter](https://abi-mapping-tools.readthedocs.io/en/v1.2.1/mapclientplugins.argonsceneexporterstep/docs/index.html) step.
|
|
78
|
+
- **PyZinc users** – see [PyZinc2ZincJS](https://github.com/alan-wu/PyZinc2ZincJS/).
|
|
79
79
|
|
|
80
80
|
Both produce a metadata JSON file plus the files it references. Keep them in the same folder and pass the metadata file's URL to `scene.loadMetadataURL`.
|
|
81
81
|
|
|
@@ -87,8 +87,13 @@ Both produce a metadata JSON file plus the files it references. Keep them in the
|
|
|
87
87
|
3. Adjust the view, then run `gfx list win 1` and copy the eye point, interest point, up vector, near plane and far plane into a view file:
|
|
88
88
|
|
|
89
89
|
```json
|
|
90
|
-
{
|
|
91
|
-
|
|
90
|
+
{
|
|
91
|
+
"farPlane": 601.12,
|
|
92
|
+
"nearPlane": 14.81,
|
|
93
|
+
"upVector": [0.0, 1.0, 0.0],
|
|
94
|
+
"targetPosition": [9.7, 6.39, -5.0],
|
|
95
|
+
"eyePosition": [9.7, 6.39, 291.2]
|
|
96
|
+
}
|
|
92
97
|
```
|
|
93
98
|
|
|
94
99
|
4. The first exported file (`[filename_prefix]_1.json`) is the metadata file. Add an entry for the view file to it:
|
|
@@ -102,11 +107,11 @@ Both produce a metadata JSON file plus the files it references. Keep them in the
|
|
|
102
107
|
Controls
|
|
103
108
|
--------
|
|
104
109
|
|
|
105
|
-
| Action
|
|
106
|
-
|
|
107
|
-
| Rotate
|
|
108
|
-
| Zoom
|
|
109
|
-
| Pan
|
|
110
|
+
| Action | Mouse | Touch |
|
|
111
|
+
| ------ | --------------------------------- | ----------------- |
|
|
112
|
+
| Rotate | Left button drag | One-finger drag |
|
|
113
|
+
| Zoom | Middle button drag / scroll wheel | Two-finger pinch |
|
|
114
|
+
| Pan | Right button drag | Three-finger drag |
|
|
110
115
|
|
|
111
116
|
Building from source
|
|
112
117
|
--------------------
|