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
package/README.md
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
# redhotmagma-visualization
|
|
2
2
|
|
|
3
|
-
##
|
|
4
|
-
1.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## development
|
|
8
|
-
1. new features:
|
|
9
|
-
- consider adding a demo to the dev app
|
|
10
|
-
- write tests (if possible, interacting with the canvas element is not supported yet)
|
|
11
|
-
1. CRs:
|
|
12
|
-
- test the affected functionalities in the dev app
|
|
13
|
-
- write tests and adjust existing ones if needed
|
|
3
|
+
## Setup for Development
|
|
4
|
+
1. Install NodeJs `> 8.x`
|
|
5
|
+
2. `npm install`
|
|
6
|
+
3. `npm start`
|
package/babel.config.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
module.exports = function(api) {
|
|
2
|
+
const presets = [
|
|
3
|
+
"@babel/preset-env",
|
|
4
|
+
"@babel/preset-typescript",
|
|
5
|
+
"@babel/preset-react" // Transpile React components to JavaScript
|
|
6
|
+
];
|
|
7
|
+
|
|
8
|
+
const plugins = [
|
|
9
|
+
"@babel/plugin-proposal-class-properties",
|
|
10
|
+
"@babel/plugin-syntax-dynamic-import",
|
|
11
|
+
|
|
12
|
+
[
|
|
13
|
+
"module-resolver",
|
|
14
|
+
{
|
|
15
|
+
root: ["./src"]
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
const ignore = [];
|
|
21
|
+
|
|
22
|
+
if (api.env("development")) {
|
|
23
|
+
plugins.push("react-hot-loader/babel"); // Enables React code to work with HMR.
|
|
24
|
+
api.cache(true);
|
|
25
|
+
} else if (api.env("production")) {
|
|
26
|
+
ignore.push(
|
|
27
|
+
"**/__tests__", // ignore the whole test directory
|
|
28
|
+
"**/*.test.js", // ignore test files only
|
|
29
|
+
"**/__mocks__"
|
|
30
|
+
);
|
|
31
|
+
api.cache(false);
|
|
32
|
+
} else {
|
|
33
|
+
api.cache(true);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
presets,
|
|
38
|
+
plugins,
|
|
39
|
+
ignore
|
|
40
|
+
};
|
|
41
|
+
};
|
package/package.json
CHANGED
|
@@ -1,21 +1,87 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "redhotmagma-visualization",
|
|
3
|
-
"version": "1.28.
|
|
3
|
+
"version": "1.28.2",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"private": false,
|
|
6
|
-
"main": "./index.js",
|
|
6
|
+
"main": "./lib/index.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"lib",
|
|
9
|
+
"src",
|
|
10
|
+
"babel.config.js",
|
|
11
|
+
"tsconfig.json",
|
|
12
|
+
"scripts",
|
|
13
|
+
"public/libs"
|
|
14
|
+
],
|
|
7
15
|
"dependencies": {
|
|
16
|
+
"@babel/cli": "^7.13.10",
|
|
17
|
+
"@babel/core": "^7.13.14",
|
|
18
|
+
"@babel/plugin-proposal-class-properties": "^7.13.0",
|
|
19
|
+
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
20
|
+
"@babel/plugin-transform-async-to-generator": "^7.13.0",
|
|
8
21
|
"@babel/polyfill": "^7.12.1",
|
|
22
|
+
"@babel/preset-env": "^7.13.12",
|
|
23
|
+
"@babel/preset-react": "^7.13.13",
|
|
24
|
+
"@babel/preset-typescript": "^7.13.0",
|
|
9
25
|
"@tweenjs/tween.js": "^17.6.0",
|
|
26
|
+
"babel-plugin-module-resolver": "^4.1.0",
|
|
10
27
|
"console-polyfill": "^0.3.0",
|
|
28
|
+
"cross-env": "^7.0.3",
|
|
11
29
|
"css-element-queries": "^1.2.3",
|
|
30
|
+
"lodash": "^4.17.21",
|
|
12
31
|
"prop-types": "^15.7.2",
|
|
13
|
-
"
|
|
14
|
-
"react-dom": "^16.14.0",
|
|
32
|
+
"rimraf": "^3.0.2",
|
|
15
33
|
"three": "^0.127.0",
|
|
16
34
|
"uuid": "^3.4.0"
|
|
17
35
|
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@material-ui/core": "^4.11.*",
|
|
38
|
+
"@types/jest": "^26.0.22",
|
|
39
|
+
"@types/lodash": "^4.14.168",
|
|
40
|
+
"babel-eslint": "^10.0.1",
|
|
41
|
+
"babel-jest": "^26.6.3",
|
|
42
|
+
"babel-loader": "^8.2.2",
|
|
43
|
+
"enzyme": "^3.11.0",
|
|
44
|
+
"enzyme-adapter-react-16": "^1.15.6",
|
|
45
|
+
"eslint": "^5.16.0",
|
|
46
|
+
"eslint-config-prettier": "^4.3.0",
|
|
47
|
+
"eslint-plugin-import": "^2.22.1",
|
|
48
|
+
"eslint-plugin-prettier": "^3.3.1",
|
|
49
|
+
"eslint-plugin-react": "^7.23.1",
|
|
50
|
+
"eslint-plugin-react-hooks": "^2.5.1",
|
|
51
|
+
"file-loader": "^6.2.0",
|
|
52
|
+
"jest": "^26.6.3",
|
|
53
|
+
"jest-enzyme": "^7.1.2",
|
|
54
|
+
"jsdom": "^16.5.2",
|
|
55
|
+
"prettier": "1.19.1",
|
|
56
|
+
"react": "^16.14.0",
|
|
57
|
+
"react-dom": "^16.14.0",
|
|
58
|
+
"react-hot-loader": "^4.13.0",
|
|
59
|
+
"react-test-renderer": "^16.14.0",
|
|
60
|
+
"sinon": "^10.0.0",
|
|
61
|
+
"ts-jest": "^26.5.4",
|
|
62
|
+
"typescript": "^4.2.3",
|
|
63
|
+
"url-loader": "^4.1.1",
|
|
64
|
+
"webpack": "^5.28.0",
|
|
65
|
+
"webpack-cli": "^4.6.0",
|
|
66
|
+
"webpack-dev-server": "^3.11.2"
|
|
67
|
+
},
|
|
18
68
|
"peerDependencies": {
|
|
19
|
-
"
|
|
69
|
+
"react": "*",
|
|
70
|
+
"react-dom": "*"
|
|
71
|
+
},
|
|
72
|
+
"scripts": {
|
|
73
|
+
"start": "webpack serve --port 3003 --host 0.0.0.0",
|
|
74
|
+
"package": "npm run package:clean && npm run package:compile && npm run package:copy && npm run package:after",
|
|
75
|
+
"package:clean": "rimraf ./lib",
|
|
76
|
+
"package:compile": "cross-env NODE_ENV=production babel ./src --out-dir ./lib --extensions .ts,.tsx,.js,.jsx",
|
|
77
|
+
"package:copy": "node ./scripts/cpPath.js ./src ./lib \"\\.(scss|eot|svg|ttf|woff|woff2|png|jpg)$\"",
|
|
78
|
+
"package:after": "node ./scripts/moveLibToPackageRoot.js",
|
|
79
|
+
"copy-public": "node ./scripts/cpPublic.js",
|
|
80
|
+
"install": "npm run package",
|
|
81
|
+
"postinstall": "npm run copy-public",
|
|
82
|
+
"test": "jest",
|
|
83
|
+
"lint": "eslint ./ --ext .js,.jsx,.ts",
|
|
84
|
+
"lint-ci": "eslint ./ --ext .js,.jsx,.ts -c .eslintrc.ci.json --quiet",
|
|
85
|
+
"lint-fix": "eslint ./ --ext .js,.jsx,.ts --fix"
|
|
20
86
|
}
|
|
21
|
-
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Draco 3D Data Compression
|
|
2
|
+
|
|
3
|
+
Draco is an open-source library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics.
|
|
4
|
+
|
|
5
|
+
[Website](https://google.github.io/draco/) | [GitHub](https://github.com/google/draco)
|
|
6
|
+
|
|
7
|
+
## Contents
|
|
8
|
+
|
|
9
|
+
This folder contains three utilities:
|
|
10
|
+
|
|
11
|
+
* `draco_decoder.js` — Emscripten-compiled decoder, compatible with any modern browser.
|
|
12
|
+
* `draco_decoder.wasm` — WebAssembly decoder, compatible with newer browsers and devices.
|
|
13
|
+
* `draco_wasm_wrapper.js` — JavaScript wrapper for the WASM decoder.
|
|
14
|
+
|
|
15
|
+
Each file is provided in two variations:
|
|
16
|
+
|
|
17
|
+
* **Default:** Latest stable builds, tracking the project's [master branch](https://github.com/google/draco).
|
|
18
|
+
* **glTF:** Builds targeted by the [glTF mesh compression extension](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression), tracking the [corresponding Draco branch](https://github.com/google/draco/tree/gltf_2.0_draco_extension).
|
|
19
|
+
|
|
20
|
+
Either variation may be used with `THREE.DRACOLoader`:
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
var dracoLoader = new THREE.DRACOLoader();
|
|
24
|
+
dracoLoader.setDecoderPath('path/to/decoders/');
|
|
25
|
+
dracoLoader.setDecoderConfig({type: 'js'}); // (Optional) Override detection of WASM support.
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Further [documentation on GitHub](https://github.com/google/draco/tree/master/javascript/example#static-loading-javascript-decoder).
|
|
29
|
+
|
|
30
|
+
## License
|
|
31
|
+
|
|
32
|
+
[Apache License 2.0](https://github.com/google/draco/blob/master/LICENSE)
|