build-dxf 0.0.8 → 0.0.9
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/package.json +34 -2
- package/src/index.d.ts +5 -0
- package/src/index.js +11 -3
- package/src/plugins/ModelDataPlugin/index.d.ts +10 -2
- package/src/plugins/ModelDataPlugin/index.js +61 -747
- package/src/plugins/RenderPlugin/index.d.ts +206 -32
- package/src/plugins/RenderPlugin/index.js +18372 -208
package/package.json
CHANGED
|
@@ -1,12 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "build-dxf",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "线段构建双线墙壁的dxf版本",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
9
|
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": {
|
|
13
|
+
"types": "./src/index.d.ts",
|
|
14
|
+
"default": "./src/index.js"
|
|
15
|
+
},
|
|
16
|
+
"require": {
|
|
17
|
+
"types": "./src/index.d.ts",
|
|
18
|
+
"default": "./src/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"./ModelDataPlugin": {
|
|
22
|
+
"import": {
|
|
23
|
+
"types": "./src/plugins/ModelDataPlugin/index.d.ts",
|
|
24
|
+
"default": "./src/plugins/ModelDataPlugin/index.js"
|
|
25
|
+
},
|
|
26
|
+
"require": {
|
|
27
|
+
"types": "./src/plugins/ModelDataPlugin/index.d.ts",
|
|
28
|
+
"default": "./src/plugins/ModelDataPlugin/index.js"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"./RenderPlugin": {
|
|
32
|
+
"import": {
|
|
33
|
+
"types": "./src/plugins/RenderPlugin/index.d.ts",
|
|
34
|
+
"default": "./src/plugins/RenderPlugin/index.js"
|
|
35
|
+
},
|
|
36
|
+
"require": {
|
|
37
|
+
"types": "./src/plugins/RenderPlugin/index.d.ts",
|
|
38
|
+
"default": "./src/plugins/RenderPlugin/index.js"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
10
42
|
"dependencies": {
|
|
11
43
|
"clipper-lib": "^6.4.2",
|
|
12
44
|
"dxf-writer": "^1.18.4",
|
|
@@ -15,4 +47,4 @@
|
|
|
15
47
|
},
|
|
16
48
|
"author": "夏过初秋",
|
|
17
49
|
"license": "ISC"
|
|
18
|
-
}
|
|
50
|
+
}
|
package/src/index.d.ts
CHANGED
|
@@ -133,6 +133,11 @@ declare class ComponentManager<TEventMap extends {} = {}> extends EventDispatche
|
|
|
133
133
|
* @param type
|
|
134
134
|
*/
|
|
135
135
|
findComponentByType<T extends typeof Component>(type: T): InstanceType<T> | null;
|
|
136
|
+
/**
|
|
137
|
+
*
|
|
138
|
+
* @param type
|
|
139
|
+
*/
|
|
140
|
+
findComponentByName(name: string): Component<{}> | null;
|
|
136
141
|
}
|
|
137
142
|
|
|
138
143
|
/**
|
package/src/index.js
CHANGED
|
@@ -41,7 +41,7 @@ class ComponentManager extends EventDispatcher {
|
|
|
41
41
|
* @param component
|
|
42
42
|
*/
|
|
43
43
|
addComponent(component) {
|
|
44
|
-
if (component
|
|
44
|
+
if (component) {
|
|
45
45
|
this.components.push(component);
|
|
46
46
|
this.dispatchEvent({
|
|
47
47
|
type: "addComponent",
|
|
@@ -99,6 +99,14 @@ class ComponentManager extends EventDispatcher {
|
|
|
99
99
|
const component = this.findComponent((c) => c instanceof type);
|
|
100
100
|
return component ? component : null;
|
|
101
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
*
|
|
104
|
+
* @param type
|
|
105
|
+
*/
|
|
106
|
+
findComponentByName(name) {
|
|
107
|
+
const component = this.findComponent((c) => c.constructor.name === name);
|
|
108
|
+
return component ? component : null;
|
|
109
|
+
}
|
|
102
110
|
}
|
|
103
111
|
class Point {
|
|
104
112
|
x;
|
|
@@ -1535,8 +1543,8 @@ class LineAnalysis extends Component {
|
|
|
1535
1543
|
* @param parent
|
|
1536
1544
|
*/
|
|
1537
1545
|
onAddFromParent(parent) {
|
|
1538
|
-
this.Dxf = parent.
|
|
1539
|
-
this.Variable = this.parent?.
|
|
1546
|
+
this.Dxf = parent.findComponentByName("Dxf");
|
|
1547
|
+
this.Variable = this.parent?.findComponentByName("Variable");
|
|
1540
1548
|
this.Dxf.addEventListener("setDta", this.lineAnalysis.bind(this));
|
|
1541
1549
|
this.Dxf.addEventListener("lineOffset", this.duplicatePointFiltering.bind(this));
|
|
1542
1550
|
}
|
|
@@ -134,6 +134,11 @@ declare class ComponentManager<TEventMap extends {} = {}> extends EventDispatche
|
|
|
134
134
|
* @param type
|
|
135
135
|
*/
|
|
136
136
|
findComponentByType<T extends typeof Component>(type: T): InstanceType<T> | null;
|
|
137
|
+
/**
|
|
138
|
+
*
|
|
139
|
+
* @param type
|
|
140
|
+
*/
|
|
141
|
+
findComponentByName(name: string): Component<{}> | null;
|
|
137
142
|
}
|
|
138
143
|
|
|
139
144
|
declare namespace components {
|
|
@@ -166,7 +171,7 @@ declare class DetailsPoint extends Component<{
|
|
|
166
171
|
* 设置值
|
|
167
172
|
* @param data
|
|
168
173
|
*/
|
|
169
|
-
set(data: any): void
|
|
174
|
+
set(data: any): Promise<void>;
|
|
170
175
|
/**
|
|
171
176
|
* 设置射线辅助
|
|
172
177
|
*/
|
|
@@ -378,7 +383,7 @@ declare class LineSegment<T = Record<string, any>> {
|
|
|
378
383
|
clone(): LineSegment<Record<string, any>>;
|
|
379
384
|
}
|
|
380
385
|
|
|
381
|
-
export declare function
|
|
386
|
+
export declare function ModelDataPlugin(dxfSystem: DxfSystem): void;
|
|
382
387
|
|
|
383
388
|
declare interface OriginalDataItem {
|
|
384
389
|
start: {
|
|
@@ -583,6 +588,9 @@ declare class WhiteModel extends Component<{
|
|
|
583
588
|
originalWhiteMode: THREE.Group<THREE.Object3DEventMap>;
|
|
584
589
|
onAddFromParent(parent: ComponentManager): void;
|
|
585
590
|
updateModel(): void;
|
|
591
|
+
toOBJ(): Promise<string>;
|
|
592
|
+
toBlob(): Promise<Blob | undefined>;
|
|
593
|
+
download(filename: string): Promise<void>;
|
|
586
594
|
}
|
|
587
595
|
|
|
588
596
|
export { }
|