redhotmagma-visualization 1.28.0-beta.2 → 1.28.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/README.md +4 -11
- package/babel.config.js +41 -0
- package/package.json +72 -6
- package/public/libs/draco/README.md +32 -0
- package/public/libs/draco/draco_decoder.js +52 -0
- package/public/libs/draco/draco_decoder.wasm +0 -0
- package/public/libs/draco/draco_encoder.js +33 -0
- package/public/libs/draco/draco_wasm_wrapper.js +104 -0
- package/public/libs/draco/gltf/draco_decoder.js +48 -0
- package/public/libs/draco/gltf/draco_decoder.wasm +0 -0
- package/public/libs/draco/gltf/draco_encoder.js +33 -0
- package/public/libs/draco/gltf/draco_wasm_wrapper.js +104 -0
- package/scripts/cpPath.js +151 -0
- package/scripts/cpPublic.js +39 -0
- package/scripts/moveLibToPackageRoot.js +44 -0
- package/scripts/utils/fileSystem.js +69 -0
- package/scripts/utils/process.js +19 -0
- package/src/CommonUtils/Observable.js +0 -1
- package/src/CommonUtils/pointerEvent.js +1 -2
- package/src/DevApp.js +1 -2
- package/src/FallbackVisualization.js +5 -1
- package/src/PrintingEffects/DomingEffect.js +0 -1
- package/src/PrintingEffects/EmbroideryEffect.js +2 -3
- package/src/React/ReactBase.js +1 -1
- package/src/Three/Controls/OrbitControls.js +0 -2
- package/src/Three/Loaders/ColladaLoader.js +294 -111
- package/src/Three/Loaders/MTLLoader.js +0 -2
- package/src/Three/Loaders/OBJLoader.js +0 -2
- package/src/Three/Three2D.js +6 -7
- package/src/Three/Three3D.js +1 -9
- package/src/Three/ThreeBase.js +1 -10
- package/src/Utils/DesignArea/getDesignAreaCanvasSize.js +0 -1
- package/src/Utils/TextureBuilder/createTextureBuilder.js +0 -2
- package/src/Utils/imagePreloader.js +0 -1
- package/src/Utils/initTextureCanvas.js +0 -3
- package/src/Utils/isMobileDevice.js +0 -2
- package/src/Utils/optimizeTextureImage.js +0 -1
- package/src/VisualizationContainer.js +1 -3
- package/src/VisualizationInterface.js +1 -10
- package/tsconfig.json +22 -0
- package/AlignTargetProvider.js +0 -129
- package/CommonUtils/Deferred.js +0 -135
- package/CommonUtils/Observable.js +0 -126
- package/CommonUtils/PropertyObserver.js +0 -61
- package/CommonUtils/SyncCurrentFunction.js +0 -59
- package/CommonUtils/SyncObservableEvent.js +0 -19
- package/CommonUtils/pointerEvent.js +0 -415
- package/Constants.js +0 -23
- package/DevApp.js +0 -1049
- package/ExposedModules.js +0 -26
- package/FallbackVisualization.js +0 -26
- package/PrintingEffects/ColorEmbossingEffect.js +0 -58
- package/PrintingEffects/DomingEffect.js +0 -150
- package/PrintingEffects/EmbossingEffect.js +0 -65
- package/PrintingEffects/EmbroideryEffect.js +0 -541
- package/PrintingEffects/EngravingEffect.js +0 -65
- package/PrintingEffects/PrintingEffects.js +0 -117
- package/PrintingEffects/PrintingEffectsUtils.js +0 -53
- package/PrintingEffects/resources/embroidery_multiply.jpg +0 -0
- package/PrintingEffects/resources/embroidery_screen.jpg +0 -0
- package/React/ReactBase.js +0 -111
- package/Three/Controls/OrbitControls.js +0 -745
- package/Three/Exporters/glTFExporter.js +0 -48
- package/Three/Loaders/ColladaLoader.js +0 -2916
- package/Three/Loaders/MTLLoader.js +0 -449
- package/Three/Loaders/OBJLoader.js +0 -548
- package/Three/Three2D.js +0 -1778
- package/Three/Three2DLayers.js +0 -504
- package/Three/Three3D.js +0 -1412
- package/Three/Three3DScene.js +0 -1432
- package/Three/ThreeBase.js +0 -722
- package/Utils/DesignArea/getDesignAreaCanvasSize.js +0 -32
- package/Utils/TextureBuilder/createTextureBuilder.js +0 -334
- package/Utils/TextureBuilder/textureBuilderFunctions.js +0 -87
- package/Utils/alignToElement.js +0 -58
- package/Utils/createAlphaMapFromAlphaChannel.js +0 -50
- package/Utils/createCache.js +0 -46
- package/Utils/createCanvas.js +0 -29
- package/Utils/createImageRepository.js +0 -124
- package/Utils/disposeMaterial.js +0 -41
- package/Utils/getImageSize.js +0 -15
- package/Utils/imagePreloader.js +0 -76
- package/Utils/initTextureCanvas.js +0 -49
- package/Utils/isMobileDevice.js +0 -19
- package/Utils/optimizeTextureImage.js +0 -73
- package/Utils/rememberCameraViewOffset.js +0 -21
- package/Utils/removeObject.js +0 -22
- package/Utils/restrictCameraMovement.js +0 -45
- package/Utils/setOrthographicCameraSize.js +0 -16
- package/Utils/updateFitSizeToElement.js +0 -39
- package/VisualizationContainer.js +0 -279
- package/VisualizationInterface.js +0 -293
- package/VisualizationProvider.js +0 -38
- package/__mocks__/exportedSample.svg +0 -45
- package/index.js +0 -16
- package/visualizationAdapterCreator.js +0 -76
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.exportGLTF = exportGLTF;
|
|
7
|
-
|
|
8
|
-
var _GLTFExporter = require("three/examples/jsm/exporters/GLTFExporter");
|
|
9
|
-
|
|
10
|
-
function exportGLTF(input) {
|
|
11
|
-
var filename = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "scene";
|
|
12
|
-
var gltfExporter = new _GLTFExporter.GLTFExporter();
|
|
13
|
-
var options = {
|
|
14
|
-
binary: true,
|
|
15
|
-
includeCustomExtensions: true
|
|
16
|
-
};
|
|
17
|
-
gltfExporter.parse(input, function (result) {
|
|
18
|
-
if (result instanceof ArrayBuffer) {
|
|
19
|
-
saveArrayBuffer(result, filename + ".glb");
|
|
20
|
-
} else {
|
|
21
|
-
var output = JSON.stringify(result, null, 2);
|
|
22
|
-
saveString(output, filename + ".gltf");
|
|
23
|
-
}
|
|
24
|
-
}, options);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function save(blob, filename) {
|
|
28
|
-
var link = document.createElement("a");
|
|
29
|
-
link.style.display = "none";
|
|
30
|
-
document.body.appendChild(link); // Firefox workaround, see #6594
|
|
31
|
-
|
|
32
|
-
link.href = URL.createObjectURL(blob);
|
|
33
|
-
link.download = filename;
|
|
34
|
-
link.click();
|
|
35
|
-
document.body.removeChild(link); // URL.revokeObjectURL( url ); breaks Firefox...
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function saveString(text, filename) {
|
|
39
|
-
save(new Blob([text], {
|
|
40
|
-
type: "text/plain"
|
|
41
|
-
}), filename);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function saveArrayBuffer(buffer, filename) {
|
|
45
|
-
save(new Blob([buffer], {
|
|
46
|
-
type: "application/octet-stream"
|
|
47
|
-
}), filename);
|
|
48
|
-
}
|