chili3d 0.6.6 → 0.6.7
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 +80 -7
- package/package.json +17 -3
package/README.md
CHANGED
|
@@ -8,16 +8,89 @@ npm install chili3d
|
|
|
8
8
|
|
|
9
9
|
## 使用
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { Application } from 'chili';
|
|
12
|
+
import { ThreeVisualFactory } from 'chili-three';
|
|
13
|
+
import { WasmShapeFactory } from 'chili-wasm';
|
|
14
|
+
import { DefaultDataExchange } from 'chili-builder';
|
|
15
|
+
import { IndexedDBStorage } from 'chili-storage';
|
|
12
16
|
|
|
13
17
|
// 创建应用程序实例
|
|
14
|
-
const app = new
|
|
18
|
+
const app = new Application({
|
|
19
|
+
visualFactory: new ThreeVisualFactory(),
|
|
20
|
+
shapeFactory: new WasmShapeFactory(),
|
|
21
|
+
storage: new IndexedDBStorage(),
|
|
22
|
+
dataExchange: new DefaultDataExchange(),
|
|
23
|
+
services: []
|
|
24
|
+
});
|
|
15
25
|
|
|
16
26
|
// 初始化应用程序
|
|
17
|
-
app.init();
|
|
27
|
+
await app.init();
|
|
18
28
|
|
|
19
|
-
##
|
|
29
|
+
## Vite配置
|
|
20
30
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
31
|
+
在Vue 3 + Vite项目中,需要添加以下配置来支持chili3d:
|
|
32
|
+
|
|
33
|
+
// vite.config.ts
|
|
34
|
+
import { defineConfig } from 'vite'
|
|
35
|
+
import vue from '@vitejs/plugin-vue'
|
|
36
|
+
|
|
37
|
+
export default defineConfig({
|
|
38
|
+
plugins: [
|
|
39
|
+
vue(),
|
|
40
|
+
],
|
|
41
|
+
resolve: {
|
|
42
|
+
alias: {
|
|
43
|
+
// 添加子包别名
|
|
44
|
+
'chili': 'chili3d/chili/src',
|
|
45
|
+
'chili-core': 'chili3d/chili-core/src',
|
|
46
|
+
'chili-controls': 'chili3d/chili-controls/src',
|
|
47
|
+
'chili-wasm': 'chili3d/chili-wasm/src',
|
|
48
|
+
'chili-three': 'chili3d/chili-three/src'
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
optimizeDeps: {
|
|
52
|
+
include: [
|
|
53
|
+
'chili3d/chili/src',
|
|
54
|
+
'chili3d/chili-core/src',
|
|
55
|
+
'chili3d/chili-controls/src',
|
|
56
|
+
'chili3d/chili-wasm/src',
|
|
57
|
+
'chili3d/chili-three/src'
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
assetsInclude: ['**/*.cur', '**/*.wasm', '**/*.jpg'],
|
|
61
|
+
esbuild: {
|
|
62
|
+
tsconfigRaw: {
|
|
63
|
+
compilerOptions: {
|
|
64
|
+
experimentalDecorators: true,
|
|
65
|
+
emitDecoratorMetadata: true,
|
|
66
|
+
moduleResolution: 'node',
|
|
67
|
+
skipLibCheck: true
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
server: {
|
|
72
|
+
fs: {
|
|
73
|
+
// 允许访问node_modules中的chili3d源码
|
|
74
|
+
allow: ['node_modules/chili3d']
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
## TypeScript配置
|
|
80
|
+
|
|
81
|
+
在tsconfig.json中添加:
|
|
82
|
+
|
|
83
|
+
{
|
|
84
|
+
"compilerOptions": {
|
|
85
|
+
"experimentalDecorators": true,
|
|
86
|
+
"emitDecoratorMetadata": true,
|
|
87
|
+
"skipLibCheck": true,
|
|
88
|
+
"paths": {
|
|
89
|
+
"chili/*": ["node_modules/chili3d/chili/src/*"],
|
|
90
|
+
"chili-core/*": ["node_modules/chili3d/chili-core/src/*"],
|
|
91
|
+
"chili-controls/*": ["node_modules/chili3d/chili-controls/src/*"],
|
|
92
|
+
"chili-wasm/*": ["node_modules/chili3d/chili-wasm/src/*"],
|
|
93
|
+
"chili-three/*": ["node_modules/chili3d/chili-three/src/*"]
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chili3d",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.7",
|
|
4
4
|
"description": "3D建模引擎",
|
|
5
5
|
"documentVersion": "0.7",
|
|
6
6
|
"author": "仙阁",
|
|
7
7
|
"private": false,
|
|
8
|
-
"main": "
|
|
9
|
-
"types": "
|
|
8
|
+
"main": "chili/src/index.ts",
|
|
9
|
+
"types": "chili/src/index.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"chili/",
|
|
12
|
+
"chili-builder/",
|
|
13
|
+
"chili-controls/",
|
|
14
|
+
"chili-core/",
|
|
15
|
+
"chili-geo/",
|
|
16
|
+
"chili-i18n/",
|
|
17
|
+
"chili-storage/",
|
|
18
|
+
"chili-three/",
|
|
19
|
+
"chili-ui/",
|
|
20
|
+
"chili-vis/",
|
|
21
|
+
"chili-wasm/",
|
|
22
|
+
"chili-web/"
|
|
23
|
+
],
|
|
10
24
|
"keywords": [
|
|
11
25
|
"3d",
|
|
12
26
|
"modeling",
|