zincjs 1.0.13 → 1.0.15
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/build/zinc.frontend.js +1 -1
- package/build/zinc.js +43 -35
- package/build/zinc.js.map +1 -1
- package/package.json +3 -3
- package/src/assets/disc.png +0 -0
- package/src/assets/mapMarker.svg +11 -0
- package/src/controls.js +1594 -0
- package/src/geometryCSG.js +148 -0
- package/src/glyphsetCSG.js +84 -0
- package/src/loaders/GLTFToZincJSLoader.js +85 -0
- package/src/loaders/JSONLoader.js +697 -0
- package/src/loaders/OBJLoader.js +911 -0
- package/src/loaders/STLLoader.js +399 -0
- package/src/loaders/primitivesLoader.js +46 -0
- package/src/minimap.js +82 -0
- package/src/primitives/augmentShader.js +22 -0
- package/src/primitives/geometry.js +109 -0
- package/src/primitives/glyph.js +150 -0
- package/src/primitives/glyphset.js +657 -0
- package/src/primitives/label.js +51 -0
- package/src/primitives/lines.js +35 -0
- package/src/primitives/marker.js +88 -0
- package/src/primitives/pointset.js +53 -0
- package/src/primitives/texturePrimitive.js +16 -0
- package/src/primitives/textureSlides.js +118 -0
- package/src/primitives/zincObject.js +573 -0
- package/src/region.js +554 -0
- package/src/renderer.js +612 -0
- package/src/scene.js +963 -0
- package/src/sceneExporter.js +32 -0
- package/src/sceneLoader.js +842 -0
- package/src/texture/texture.js +57 -0
- package/src/texture/textureArray.js +85 -0
- package/src/three/GLTFExporter.js +2448 -0
- package/src/three/Geometry.js +2084 -0
- package/src/three/Loader.js +344 -0
- package/src/three/Points.js +223 -0
- package/src/three/line/Line.js +293 -0
- package/src/three/line/LineSegments.js +65 -0
- package/src/three-js-csg.js +564 -0
- package/src/utilities.js +321 -0
- package/src/videoHandler.js +92 -0
- package/src/workers/geometryCSG.worker.js +73 -0
- package/src/workers/geometryCSGInternal.js +58 -0
- package/src/zinc.js +38 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const GLTFExporter = require('./three/GLTFExporter').GLTFExporter;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Provides an object which uses for exporting the scene
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
* @author Alan Wu
|
|
8
|
+
* @return {Zinc.Lines}
|
|
9
|
+
*/
|
|
10
|
+
const SceneExporter = function (sceneIn) {
|
|
11
|
+
const scene = sceneIn;
|
|
12
|
+
|
|
13
|
+
this.exportGLTF = (binary) => {
|
|
14
|
+
const rootRegion = scene.getRootRegion();
|
|
15
|
+
const zincObjects = rootRegion.getAllObjects(true);
|
|
16
|
+
const animations = [];
|
|
17
|
+
zincObjects.forEach(zincObject => {
|
|
18
|
+
if (zincObject.animationClip) {
|
|
19
|
+
animations.push({clip: zincObject.animationClip[0], mesh: zincObject.morph});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const exporter = new GLTFExporter();
|
|
23
|
+
const options = { binary, animations };
|
|
24
|
+
return new Promise((resolve, reject) => {
|
|
25
|
+
exporter.parse( scene.getThreeJSScene(), function ( gltf ) {
|
|
26
|
+
resolve(gltf);
|
|
27
|
+
}, options );
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
exports.SceneExporter = SceneExporter;
|