dxfview 0.0.4-beta.16 → 0.0.4-beta.17
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/dist/dxfview.esm.min.js +3 -3
- package/dist/types/core/helpers/OSnapHelper.d.ts +2 -1
- package/dist/types/plugins/annotation/AnnotationPlugin.d.ts +15 -0
- package/dist/types/plugins/annotation/BaseAnnotation.d.ts +2 -0
- package/dist/types/plugins/annotation/BaseAnnotationDrawable.d.ts +2 -0
- package/dist/types/plugins/annotation/FreeDrawAnnotation.d.ts +1 -1
- package/dist/types/plugins/annotation/RectAnnotation.d.ts +1 -1
- package/dist/types/plugins/divide/FrameAnnotation.d.ts +1 -0
- package/package.json +93 -90
|
@@ -140,9 +140,10 @@ export declare class OSnapHelper {
|
|
|
140
140
|
* @param intersections The raycaster intersections, must have been sorted by distance.
|
|
141
141
|
* @param is3d If it is a 3d or 2d viewer.
|
|
142
142
|
* @param lastMouseDownPosition Used in order to to get foot of perpendicular.
|
|
143
|
+
* @param mousePositionOverride Optional mouse world position (useful for 2d to avoid ray hit drift).
|
|
143
144
|
* @returns Target snap point if any
|
|
144
145
|
*/
|
|
145
|
-
handleSnap(rayCasterResult: THREE.Intersection[], is3d: boolean, lastMouseDownPosition?: THREE.Vector3): THREE.Vector3 | undefined;
|
|
146
|
+
handleSnap(rayCasterResult: THREE.Intersection[], is3d: boolean, lastMouseDownPosition?: THREE.Vector3, mousePositionOverride?: THREE.Vector3): THREE.Vector3 | undefined;
|
|
146
147
|
/**
|
|
147
148
|
* Tries to find a proper snap point and display corresponding marker.
|
|
148
149
|
* @param mousePosition Mouse position in world coordinate.
|
|
@@ -17,6 +17,10 @@ export declare class AnnotationPlugin extends Plugin {
|
|
|
17
17
|
private additionMode;
|
|
18
18
|
private mobileTouchHelper?;
|
|
19
19
|
private selectedMaskColor?;
|
|
20
|
+
private snapObjects;
|
|
21
|
+
private snapObjectsDirty;
|
|
22
|
+
private pendingSnapDrawableIds;
|
|
23
|
+
private snapLineMaterial?;
|
|
20
24
|
private readonly partitionLabels;
|
|
21
25
|
constructor(viewer: BaseViewer);
|
|
22
26
|
getDrawableList(): {
|
|
@@ -27,6 +31,12 @@ export declare class AnnotationPlugin extends Plugin {
|
|
|
27
31
|
}[];
|
|
28
32
|
getDrawableDatas(): AnnotationData[];
|
|
29
33
|
setDrawableDatas(datas: AnnotationData[]): void;
|
|
34
|
+
getSnapObjects(excludeId?: string): THREE.Object3D[];
|
|
35
|
+
invalidateSnapObjects(): void;
|
|
36
|
+
private rebuildSnapObjects;
|
|
37
|
+
private disposeSnapObjects;
|
|
38
|
+
private getSnapLineMaterial;
|
|
39
|
+
private collectDrawableSegments;
|
|
30
40
|
getAigcJson(): {
|
|
31
41
|
properties: {
|
|
32
42
|
uuid: number;
|
|
@@ -158,6 +168,11 @@ export declare class AnnotationPlugin extends Plugin {
|
|
|
158
168
|
* 用于工具栏撤回按钮调用
|
|
159
169
|
*/
|
|
160
170
|
undo(): void;
|
|
171
|
+
/**
|
|
172
|
+
* 公开的重做方法,和 Ctrl+Y 的逻辑一致
|
|
173
|
+
* 用于工具栏重做按钮调用
|
|
174
|
+
*/
|
|
175
|
+
redo(): void;
|
|
161
176
|
/**
|
|
162
177
|
*
|
|
163
178
|
* @param {AnnotationData[]} dataArray
|
|
@@ -142,5 +142,7 @@ export declare abstract class BaseAnnotation extends Event<AnnotationEvents> {
|
|
|
142
142
|
* @param e 事件信息(包含屏幕坐标)
|
|
143
143
|
*/
|
|
144
144
|
getIntersections: (e: EventInfo) => THREE.Intersection[];
|
|
145
|
+
private getAnnotationSnapObjects;
|
|
146
|
+
protected getMouseWorldPosition(e: EventInfo): THREE.Vector3 | undefined;
|
|
145
147
|
}
|
|
146
148
|
export {};
|
|
@@ -142,10 +142,12 @@ export declare abstract class BaseAnnotationDrawable extends Drawable {
|
|
|
142
142
|
* 获取与场景的交点列表(用于吸附)
|
|
143
143
|
*/
|
|
144
144
|
getIntersections(e: EventInfo): THREE.Intersection[];
|
|
145
|
+
private getAnnotationSnapObjects;
|
|
145
146
|
/**
|
|
146
147
|
* 处理鼠标移动时的吸附逻辑
|
|
147
148
|
*/
|
|
148
149
|
handleSnapOnMove(e: EventInfo): THREE.Vector3 | undefined;
|
|
150
|
+
private getMouseWorldPosition;
|
|
149
151
|
/**
|
|
150
152
|
* 激活射线检测器(用于吸附)
|
|
151
153
|
*/
|
|
@@ -2,7 +2,7 @@ import * as THREE from "three";
|
|
|
2
2
|
import { BaseAnnotation } from "./BaseAnnotation";
|
|
3
3
|
import { BaseAnnotationDrawable } from "./BaseAnnotationDrawable";
|
|
4
4
|
import { DrawableList } from "../../core/canvas/DrawableList";
|
|
5
|
-
import type
|
|
5
|
+
import { type OSnapHelper } from "../../core/helpers";
|
|
6
6
|
import { EventInfo, InputManager } from "../../core/input/InputManager";
|
|
7
7
|
import type { BaseViewer } from "../../core/viewers";
|
|
8
8
|
/**
|
|
@@ -2,7 +2,7 @@ import * as THREE from "three";
|
|
|
2
2
|
import { BaseAnnotation } from "./BaseAnnotation";
|
|
3
3
|
import { AnnotationModeType, BaseAnnotationDrawable } from "./BaseAnnotationDrawable";
|
|
4
4
|
import type { DrawableList } from "../../core/canvas/DrawableList";
|
|
5
|
-
import type
|
|
5
|
+
import { type OSnapHelper } from "../../core/helpers";
|
|
6
6
|
import type { EventInfo, InputManager } from "../../core/input/InputManager";
|
|
7
7
|
import type { BaseViewer } from "../../core/viewers";
|
|
8
8
|
/**
|
package/package.json
CHANGED
|
@@ -1,90 +1,93 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dxfview",
|
|
3
|
-
"version": "0.0.4-beta.
|
|
4
|
-
"homepage": "",
|
|
5
|
-
"module": "dist/dxfview.esm.min.js",
|
|
6
|
-
"main": "dist/dxfview.esm.min.js",
|
|
7
|
-
"types": "dist/types/index.d.ts",
|
|
8
|
-
"type": "module",
|
|
9
|
-
"scripts": {
|
|
10
|
-
"clean": "rimraf dist build",
|
|
11
|
-
"build:release": "node --loader ts-node/esm esbuild.config.ts -mode=production",
|
|
12
|
-
"build:prebuild": "node --loader ts-node/esm esbuild.config.ts -mode=prebuild",
|
|
13
|
-
"build:datatype": "tsc && tsc-alias",
|
|
14
|
-
"build": "npm run clean && npm run lint-fix && npm run build:datatype && npm run build:release",
|
|
15
|
-
"build:dev": "npm run clean && npm run lint-fix && npm run build:prebuild",
|
|
16
|
-
"build:dev:watch": "npm run clean && npm run lint-fix && npm run build:datatype && node --loader ts-node/esm esbuild.config.ts -mode=devwatch",
|
|
17
|
-
"demo": "npm run build:dev && node demo/index.cjs",
|
|
18
|
-
"start": "node --loader ts-node/esm esbuild.config.ts -mode=development",
|
|
19
|
-
"lint": "eslint src --ext ts",
|
|
20
|
-
"lint-fix": "npm run lint -- --fix",
|
|
21
|
-
"docs": "typedoc src/export.doc.ts --excludePrivate --excludeProtected --excludeInternal --exclude src/pathes/*"
|
|
22
|
-
},
|
|
23
|
-
"files": [
|
|
24
|
-
"/dist"
|
|
25
|
-
],
|
|
26
|
-
"repository": {
|
|
27
|
-
"type": "git"
|
|
28
|
-
},
|
|
29
|
-
"author": "dxfview",
|
|
30
|
-
"license": "UNLICENSED",
|
|
31
|
-
"dependencies": {
|
|
32
|
-
"@noble/ed25519": "^2.0.0",
|
|
33
|
-
"@noble/hashes": "^1.4.0",
|
|
34
|
-
"@types/concaveman": "^1.1.3",
|
|
35
|
-
"@types/lodash": "^4.14.165",
|
|
36
|
-
"@types/resize-observer-browser": "^0.1.7",
|
|
37
|
-
"2d-polygon-boolean": "^1.0.1",
|
|
38
|
-
"2d-polygon-self-intersections": "^1.3.1",
|
|
39
|
-
"camera-controls": "^1.37.4",
|
|
40
|
-
"clipper-lib": "^6.4.2",
|
|
41
|
-
"concaveman": "^1.2.1",
|
|
42
|
-
"core-js": "^3.27.1",
|
|
43
|
-
"disable-devtool": "^0.3.9",
|
|
44
|
-
"i18next": "^21.6.0",
|
|
45
|
-
"intl-pluralrules": "^1.3.1",
|
|
46
|
-
"javascript-obfuscator": "^4.1.1",
|
|
47
|
-
"js-base64": "^3.7.2",
|
|
48
|
-
"jsbi": "^4.3.0",
|
|
49
|
-
"lodash": "^4.17.20",
|
|
50
|
-
"loglevel": "^1.8.0",
|
|
51
|
-
"mitt": "^3.0.0",
|
|
52
|
-
"opentype.js": "^1.3.4",
|
|
53
|
-
"poly-extrude": "^0.2.0",
|
|
54
|
-
"polybooljs": "^1.2.0",
|
|
55
|
-
"polygon-clipping": "^0.15.3",
|
|
56
|
-
"regenerator-runtime": "^0.13.11",
|
|
57
|
-
"screenfull": "^6.0.0",
|
|
58
|
-
"stream": "^0.0.2",
|
|
59
|
-
"three": "^0.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"@
|
|
64
|
-
"@types/
|
|
65
|
-
"@types/
|
|
66
|
-
"@types/
|
|
67
|
-
"@types/
|
|
68
|
-
"@
|
|
69
|
-
"@typescript-eslint/
|
|
70
|
-
"
|
|
71
|
-
"esbuild": "^0.
|
|
72
|
-
"esbuild-plugin-
|
|
73
|
-
"
|
|
74
|
-
"eslint": "^8.
|
|
75
|
-
"eslint-
|
|
76
|
-
"eslint-import
|
|
77
|
-
"eslint-plugin-
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
}
|
|
90
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "dxfview",
|
|
3
|
+
"version": "0.0.4-beta.17",
|
|
4
|
+
"homepage": "",
|
|
5
|
+
"module": "dist/dxfview.esm.min.js",
|
|
6
|
+
"main": "dist/dxfview.esm.min.js",
|
|
7
|
+
"types": "dist/types/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"clean": "rimraf dist build",
|
|
11
|
+
"build:release": "node --loader ts-node/esm esbuild.config.ts -mode=production",
|
|
12
|
+
"build:prebuild": "node --loader ts-node/esm esbuild.config.ts -mode=prebuild",
|
|
13
|
+
"build:datatype": "tsc && tsc-alias",
|
|
14
|
+
"build": "npm run clean && npm run lint-fix && npm run build:datatype && npm run build:release",
|
|
15
|
+
"build:dev": "npm run clean && npm run lint-fix && npm run build:prebuild",
|
|
16
|
+
"build:dev:watch": "npm run clean && npm run lint-fix && npm run build:datatype && node --loader ts-node/esm esbuild.config.ts -mode=devwatch",
|
|
17
|
+
"demo": "npm run build:dev && node demo/index.cjs",
|
|
18
|
+
"start": "node --loader ts-node/esm esbuild.config.ts -mode=development",
|
|
19
|
+
"lint": "eslint src --ext ts",
|
|
20
|
+
"lint-fix": "npm run lint -- --fix",
|
|
21
|
+
"docs": "typedoc src/export.doc.ts --excludePrivate --excludeProtected --excludeInternal --exclude src/pathes/*"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"/dist"
|
|
25
|
+
],
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git"
|
|
28
|
+
},
|
|
29
|
+
"author": "dxfview",
|
|
30
|
+
"license": "UNLICENSED",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@noble/ed25519": "^2.0.0",
|
|
33
|
+
"@noble/hashes": "^1.4.0",
|
|
34
|
+
"@types/concaveman": "^1.1.3",
|
|
35
|
+
"@types/lodash": "^4.14.165",
|
|
36
|
+
"@types/resize-observer-browser": "^0.1.7",
|
|
37
|
+
"2d-polygon-boolean": "^1.0.1",
|
|
38
|
+
"2d-polygon-self-intersections": "^1.3.1",
|
|
39
|
+
"camera-controls": "^1.37.4",
|
|
40
|
+
"clipper-lib": "^6.4.2",
|
|
41
|
+
"concaveman": "^1.2.1",
|
|
42
|
+
"core-js": "^3.27.1",
|
|
43
|
+
"disable-devtool": "^0.3.9",
|
|
44
|
+
"i18next": "^21.6.0",
|
|
45
|
+
"intl-pluralrules": "^1.3.1",
|
|
46
|
+
"javascript-obfuscator": "^4.1.1",
|
|
47
|
+
"js-base64": "^3.7.2",
|
|
48
|
+
"jsbi": "^4.3.0",
|
|
49
|
+
"lodash": "^4.17.20",
|
|
50
|
+
"loglevel": "^1.8.0",
|
|
51
|
+
"mitt": "^3.0.0",
|
|
52
|
+
"opentype.js": "^1.3.4",
|
|
53
|
+
"poly-extrude": "^0.2.0",
|
|
54
|
+
"polybooljs": "^1.2.0",
|
|
55
|
+
"polygon-clipping": "^0.15.3",
|
|
56
|
+
"regenerator-runtime": "^0.13.11",
|
|
57
|
+
"screenfull": "^6.0.0",
|
|
58
|
+
"stream": "^0.0.2",
|
|
59
|
+
"three-mesh-bvh": "^0.5.21"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@fal-works/esbuild-plugin-global-externals": "^2.1.2",
|
|
63
|
+
"@types/eslint": "^8.21.1",
|
|
64
|
+
"@types/node": "^18.11.19",
|
|
65
|
+
"@types/resize-observer-browser": "^0.1.7",
|
|
66
|
+
"@types/sha256": "^0.2.0",
|
|
67
|
+
"@types/three": "^0.155.0",
|
|
68
|
+
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
69
|
+
"@typescript-eslint/parser": "^5.47.1",
|
|
70
|
+
"esbuild": "^0.16.17",
|
|
71
|
+
"esbuild-plugin-inline-worker": "^0.1.1",
|
|
72
|
+
"esbuild-plugin-sass": "^1.0.1",
|
|
73
|
+
"eslint": "^8.15.0",
|
|
74
|
+
"eslint-config-prettier": "^8.5.0",
|
|
75
|
+
"eslint-import-resolver-typescript": "^3.5.2",
|
|
76
|
+
"eslint-plugin-import": "2.26.0",
|
|
77
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
78
|
+
"express": "^4.17.1",
|
|
79
|
+
"live-server": "^1.2.2",
|
|
80
|
+
"prettier": "^2.5.1",
|
|
81
|
+
"rimraf": "^3.0.2",
|
|
82
|
+
"sha256": "^0.2.0",
|
|
83
|
+
"terser": "^5.16.2",
|
|
84
|
+
"ts-node": "^10.9.1",
|
|
85
|
+
"tsc-alias": "^1.8.2",
|
|
86
|
+
"typedoc": "^0.22.12",
|
|
87
|
+
"typescript": "^4.5.2",
|
|
88
|
+
"three": "^0.155.0"
|
|
89
|
+
},
|
|
90
|
+
"peerDependencies": {
|
|
91
|
+
"three": ">=0.155.0 <0.170.0"
|
|
92
|
+
}
|
|
93
|
+
}
|