@soonspacejs/plugin-measuring 2.11.37 → 2.11.38
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
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# @soonspacejs/plugin-model-blast
|
|
2
|
-
|
|
3
|
-
> Model blast plugin for SoonSpace.js
|
|
4
|
-
|
|
5
|
-
Document: [http://www.xwbuilders.com:8800/plugin/model-blast.html](http://www.xwbuilders.com:8800/plugin/model-blast.html)
|
|
1
|
+
# @soonspacejs/plugin-model-blast
|
|
2
|
+
|
|
3
|
+
> Model blast plugin for SoonSpace.js
|
|
4
|
+
|
|
5
|
+
Document: [http://www.xwbuilders.com:8800/plugin/model-blast.html](http://www.xwbuilders.com:8800/plugin/model-blast.html)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soonspacejs/plugin-measuring",
|
|
3
3
|
"pluginName": "MeasuringPlugin",
|
|
4
|
-
"version": "2.11.
|
|
4
|
+
"version": "2.11.38",
|
|
5
5
|
"description": "Measuring plugin for SoonSpace.js",
|
|
6
6
|
"main": "dist/index.esm.js",
|
|
7
7
|
"module": "dist/index.esm.js",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
],
|
|
14
14
|
"author": "xunwei",
|
|
15
15
|
"license": "UNLICENSED",
|
|
16
|
-
"gitHead": "
|
|
16
|
+
"gitHead": "af8d864a695bc488b8625268189a1b07eecd9775",
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"soonspacejs": "2.11.
|
|
18
|
+
"soonspacejs": "2.11.38"
|
|
19
19
|
}
|
|
20
20
|
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import SoonSpace, { PoiNode } from 'soonspacejs';
|
|
2
|
-
import { BufferGeometry, Camera, Line, LineBasicMaterial, Mesh, MeshBasicMaterial, Object3D, Scene, Sprite, SpriteMaterial, Vector3 } from 'three';
|
|
3
|
-
import { Options } from './utils/ProjectSettingsDef';
|
|
4
|
-
export declare enum MeasuringMode {
|
|
5
|
-
Distance = "Distance",
|
|
6
|
-
Area = "Area",
|
|
7
|
-
Angle = "Angle"
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* MeasuringPlugin
|
|
11
|
-
*/
|
|
12
|
-
declare class MeasuringPlugin {
|
|
13
|
-
readonly ssp: SoonSpace;
|
|
14
|
-
static LINE_MATERIAL: LineBasicMaterial;
|
|
15
|
-
static MESH_MATERIAL: MeshBasicMaterial;
|
|
16
|
-
static MAX_DISTANCE: number;
|
|
17
|
-
static OBJ_NAME: string;
|
|
18
|
-
static LABEL_NAME: string;
|
|
19
|
-
mode: MeasuringMode | null;
|
|
20
|
-
protected options: Required<Options>;
|
|
21
|
-
protected scene: Scene;
|
|
22
|
-
protected camera: Camera;
|
|
23
|
-
protected spriteMaterial?: SpriteMaterial;
|
|
24
|
-
objectsStore: Set<Object3D<import("three").Object3DEventMap>>;
|
|
25
|
-
onCancel: () => void;
|
|
26
|
-
onDone: () => void;
|
|
27
|
-
protected pointMarkers: Sprite[];
|
|
28
|
-
protected polyline?: Line;
|
|
29
|
-
protected faces?: Mesh;
|
|
30
|
-
protected curve?: Line;
|
|
31
|
-
protected labels: PoiNode[];
|
|
32
|
-
protected pointArray: Vector3[];
|
|
33
|
-
protected tempPointMarker?: Sprite;
|
|
34
|
-
protected tempLine?: Line;
|
|
35
|
-
protected tempLabel?: PoiNode;
|
|
36
|
-
protected lastClickTime?: number;
|
|
37
|
-
constructor(ssp: SoonSpace);
|
|
38
|
-
get domElement(): HTMLDivElement;
|
|
39
|
-
/**
|
|
40
|
-
* Starts the measurement
|
|
41
|
-
*/
|
|
42
|
-
start(mode?: MeasuringMode, options?: Options): void;
|
|
43
|
-
/**
|
|
44
|
-
* Ends the measurement
|
|
45
|
-
*/
|
|
46
|
-
close(): void;
|
|
47
|
-
cancel(): void;
|
|
48
|
-
clear(): void;
|
|
49
|
-
/**
|
|
50
|
-
* Initializes point marker material
|
|
51
|
-
*/
|
|
52
|
-
initPointMarkerMaterial(): void;
|
|
53
|
-
/**
|
|
54
|
-
* Creates point marker
|
|
55
|
-
*/
|
|
56
|
-
private createPointMarker;
|
|
57
|
-
/**
|
|
58
|
-
* Creates Line
|
|
59
|
-
*/
|
|
60
|
-
private createLine;
|
|
61
|
-
/**
|
|
62
|
-
* Creates Mesh
|
|
63
|
-
*/
|
|
64
|
-
private createFaces;
|
|
65
|
-
/**
|
|
66
|
-
* Draw completed
|
|
67
|
-
*/
|
|
68
|
-
done(): void;
|
|
69
|
-
mousemove: (e: MouseEvent) => void;
|
|
70
|
-
dblclick: (e: MouseEvent) => void;
|
|
71
|
-
click: (e: MouseEvent) => void;
|
|
72
|
-
keydown: (e: KeyboardEvent) => void;
|
|
73
|
-
/**
|
|
74
|
-
* The the closest intersection
|
|
75
|
-
* @param e
|
|
76
|
-
*/
|
|
77
|
-
getClosestIntersection: (e: MouseEvent) => Vector3 | null | undefined;
|
|
78
|
-
/**
|
|
79
|
-
* Adds or update temp label and position
|
|
80
|
-
*/
|
|
81
|
-
addOrUpdateTempLabel(label: string, position: Vector3): void;
|
|
82
|
-
/**
|
|
83
|
-
* Creates label
|
|
84
|
-
*/
|
|
85
|
-
createLabel(text: string): PoiNode;
|
|
86
|
-
/**
|
|
87
|
-
* Creates the arc curve to indicate the angle in degree
|
|
88
|
-
*/
|
|
89
|
-
createCurve(p0: Vector3, p1: Vector3, p2: Vector3): Line<BufferGeometry<import("three").NormalBufferAttributes>, LineBasicMaterial, import("three").Object3DEventMap>;
|
|
90
|
-
/**
|
|
91
|
-
* Calculates area
|
|
92
|
-
* TODO: for concave polygon, the value doesn't right, need to fix it
|
|
93
|
-
* @param points
|
|
94
|
-
*/
|
|
95
|
-
calculateArea(points: Vector3[]): number;
|
|
96
|
-
/**
|
|
97
|
-
* Gets included angle of two lines in degree
|
|
98
|
-
*/
|
|
99
|
-
calculateAngle(startPoint: Vector3, middlePoint: Vector3, endPoint: Vector3): number;
|
|
100
|
-
/**
|
|
101
|
-
* Gets angle bisector of two lines
|
|
102
|
-
*/
|
|
103
|
-
getAngleBisector(startPoint: Vector3, middlePoint: Vector3, endPoint: Vector3): Vector3;
|
|
104
|
-
/**
|
|
105
|
-
* Get the barycenter of points
|
|
106
|
-
*/
|
|
107
|
-
getBarycenter(points: Vector3[]): Vector3;
|
|
108
|
-
/**
|
|
109
|
-
* Gets unit string for distance, area or angle
|
|
110
|
-
*/
|
|
111
|
-
getUnitString(): string;
|
|
112
|
-
/**
|
|
113
|
-
* Converts a number to a string with proper fraction digits
|
|
114
|
-
*/
|
|
115
|
-
numberToString(num: number): string;
|
|
116
|
-
}
|
|
117
|
-
export default MeasuringPlugin;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const showPrecisionValue: (value: number, precistionType: number) => string;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { UnitType } from './ProjectSettingsDef';
|
|
2
|
-
export declare const unitConversionByMeter: Record<UnitType, number>;
|
|
3
|
-
export declare const getUnitStr: (unit: UnitType, power?: number) => string;
|
|
4
|
-
/**
|
|
5
|
-
* Gets unit
|
|
6
|
-
* value
|
|
7
|
-
* sourceUnit
|
|
8
|
-
* targetUnit
|
|
9
|
-
*/
|
|
10
|
-
interface valueWithUnit {
|
|
11
|
-
value: number;
|
|
12
|
-
unit: string;
|
|
13
|
-
}
|
|
14
|
-
export declare const getLengthValueByUnit: (value: number, sourceUnit: UnitType, targetUnit: UnitType, power?: number) => valueWithUnit;
|
|
15
|
-
export {};
|