rm-gxf-computing-rusts 0.0.18 → 0.0.20

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rm-gxf-computing-rusts",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "description": "",
5
5
  "author": "初秋",
6
6
  "type": "commonjs",
@@ -19,6 +19,16 @@
19
19
  "types": "./src/index.d.ts",
20
20
  "default": "./src/main.js"
21
21
  }
22
+ },
23
+ "./utils": {
24
+ "import": {
25
+ "types": "./src/index.d.ts",
26
+ "default": "./src/main.js"
27
+ },
28
+ "require": {
29
+ "types": "./src/index.d.ts",
30
+ "default": "./src/main.js"
31
+ }
22
32
  }
23
33
  }
24
34
  }
Binary file
package/src/index.d.ts CHANGED
@@ -22,15 +22,12 @@ export interface CheckResult {
22
22
  offsets?: Array<number>
23
23
  }
24
24
 
25
- export interface CheckResult {
26
- originalVertices: Array<Square>
27
- allCenterPoints: Array<Point>
28
- offsets?: Array<number>
25
+ export interface Index {
26
+ index: number
29
27
  }
30
28
 
31
- export interface Line {
32
- start: Vector3F64
33
- end: Vector3F64
29
+ export interface Index {
30
+ index: number
34
31
  }
35
32
 
36
33
  export interface Line {
@@ -54,17 +51,27 @@ export interface LineData {
54
51
  checkResults: Array<CheckResult>
55
52
  }
56
53
 
57
- export interface LineData {
58
- start: Vector3F64
59
- end: Vector3F64
60
- checkResults: Array<CheckResult>
54
+ export interface ParseLineResult {
55
+ start?: Vector3F64
56
+ end?: Vector3F64
57
+ missingCheckResults: Array<Quads>
58
+ existSegments: Array<Quads>
59
+ intersectionSegments: Array<Array<Index>>
60
+ }
61
+
62
+ export interface ParseLineResult {
63
+ start?: Vector3F64
64
+ end?: Vector3F64
65
+ missingCheckResults: Array<Quads>
66
+ existSegments: Array<Quads>
67
+ intersectionSegments: Array<Array<Index>>
61
68
  }
62
69
 
63
70
  export interface PcBackfaceTestOptions {
64
71
  view?: boolean
65
72
  pcdDir: string
66
73
  lines: LineDataList
67
- trajectorys: Record<string, Vector3F64>
74
+ trajectorys: Record<string, Trajectory>
68
75
  distProjection: boolean
69
76
  }
70
77
 
@@ -72,7 +79,7 @@ export interface PcBackfaceTestOptions {
72
79
  view?: boolean
73
80
  pcdDir: string
74
81
  lines: LineDataList
75
- trajectorys: Record<string, Vector3F64>
82
+ trajectorys: Record<string, Trajectory>
76
83
  distProjection: boolean
77
84
  }
78
85
 
@@ -81,6 +88,7 @@ export interface PcObjectEcognizerOption {
81
88
  pcdUrl: string
82
89
  imageUrls: Array<string>
83
90
  groundZ: number
91
+ version?: string
84
92
  }
85
93
 
86
94
  export interface PcObjectEcognizerOption {
@@ -88,17 +96,67 @@ export interface PcObjectEcognizerOption {
88
96
  pcdUrl: string
89
97
  imageUrls: Array<string>
90
98
  groundZ: number
99
+ version?: string
100
+ }
101
+
102
+ export interface PcObjectEcognizerOption20 {
103
+ view?: boolean
104
+ pcdUrl: string
105
+ pcdChunk?: boolean
106
+ imageUrls: Array<string>
107
+ groundZ: number
108
+ version?: string
109
+ clusterFilter?: boolean
110
+ distanceThreshold?: number
111
+ }
112
+
113
+ export interface PcObjectEcognizerOption20 {
114
+ view?: boolean
115
+ pcdUrl: string
116
+ pcdChunk?: boolean
117
+ imageUrls: Array<string>
118
+ groundZ: number
119
+ version?: string
120
+ clusterFilter?: boolean
121
+ distanceThreshold?: number
91
122
  }
92
123
 
93
124
  export declare function pointCloudObjectEcognizer(option: PcObjectEcognizerOption): Array<Array<Array<number>>>
94
125
 
126
+ export declare function pointCloudObjectEcognizer20(option: PcObjectEcognizerOption20): Array<Array<Array<number>>>
127
+
128
+ export interface Quads {
129
+ originalVertices: Array<Array<Vector3F64>>
130
+ allCenterPoints: Array<Vector3F64>
131
+ }
132
+
133
+ export interface Quads {
134
+ originalVertices: Array<Array<Vector3F64>>
135
+ allCenterPoints: Array<Vector3F64>
136
+ }
137
+
95
138
  export declare function squareBackfacePointCloudTest(option: PcBackfaceTestOptions): Array<number>
96
139
 
97
- /** 三维向量,包含 x、y、z 分量 */
98
- export interface Vector3F64 {
140
+ export declare function squareBackfaceSquareTest(option: SquareBackfaceTestOptions): Array<number>
141
+
142
+ export interface SquareBackfaceTestOptions {
143
+ view?: boolean
144
+ lines: Array<ParseLineResult>
145
+ }
146
+
147
+ export interface SquareBackfaceTestOptions {
148
+ view?: boolean
149
+ lines: Array<ParseLineResult>
150
+ }
151
+
152
+ export interface Trajectory {
99
153
  x: number
100
154
  y: number
101
155
  z: number
156
+ qx: number
157
+ qy: number
158
+ qz: number
159
+ qw: number
102
160
  }
103
161
 
104
162
  /** 三维向量,包含 x、y、z 分量 */
package/src/index.js CHANGED
@@ -589,4 +589,6 @@ if (!nativeBinding) {
589
589
  module.exports = nativeBinding
590
590
  module.exports.checkLineSideVisibility = nativeBinding.checkLineSideVisibility
591
591
  module.exports.pointCloudObjectEcognizer = nativeBinding.pointCloudObjectEcognizer
592
+ module.exports.pointCloudObjectEcognizer20 = nativeBinding.pointCloudObjectEcognizer20
592
593
  module.exports.squareBackfacePointCloudTest = nativeBinding.squareBackfacePointCloudTest
594
+ module.exports.squareBackfaceSquareTest = nativeBinding.squareBackfaceSquareTest
package/src/main.js CHANGED
@@ -120,6 +120,46 @@ function squareBackfacePointCloudTest(params) {
120
120
  return gxf.squareBackfacePointCloudTest(params)
121
121
  }
122
122
 
123
+ /**
124
+ *
125
+ * @param {import("./index").SquareBackfaceTestOptions} params
126
+ * @returns
127
+ */
128
+ function squareBackfaceSquareTest(params) {
129
+ // params.lines 参数验证
130
+ if (!Array.isArray(params.lines)) {
131
+ throw new Error("params.lines must be an array");
132
+ }
133
+
134
+ for (let i = 0; i < params.lines.length; i++) {
135
+ const line = params.lines[i]
136
+ if (!line || typeof line !== "object") {
137
+ throw new Error(`params.lines[${i}] must be an object`)
138
+ }
139
+
140
+ // start
141
+ if (!isVector3(line.start)) {
142
+ throw new Error(`params.lines[${i}].start must be {x,y,z}`)
143
+ }
144
+
145
+ // end
146
+ if (!isVector3(line.end)) {
147
+ throw new Error(`params.lines[${i}].start must be {x,y,z}`)
148
+ }
149
+
150
+ // missingCheckResults
151
+ if (line.missingCheckResults == undefined) {
152
+ line.missingCheckResults = []
153
+ }
154
+
155
+ if (line.existSegments == undefined) {
156
+ line.existSegments = []
157
+ }
158
+ }
159
+
160
+ return gxf.squareBackfaceSquareTest(params)
161
+ }
162
+
123
163
  /**
124
164
  *
125
165
  * @param {import("./index").PcObjectEcognizerOption} params
@@ -129,6 +169,17 @@ function pointCloudObjectEcognizer(params) {
129
169
  return gxf.pointCloudObjectEcognizer(params)
130
170
  }
131
171
 
172
+ /**
173
+ *
174
+ * @param {import("./index").PcObjectEcognizerOption20} params
175
+ * @returns
176
+ */
177
+ function pointCloudObjectEcognizer2_0(params) {
178
+ return gxf.pointCloudObjectEcognizer20(params)
179
+ }
180
+
132
181
  module.exports.checkLineSideVisibility = checkLineSideVisibility
133
182
  module.exports.squareBackfacePointCloudTest = squareBackfacePointCloudTest
134
- module.exports.pointCloudObjectEcognizer = pointCloudObjectEcognizer
183
+ module.exports.pointCloudObjectEcognizer = pointCloudObjectEcognizer
184
+ module.exports.squareBackfaceSquareTest = squareBackfaceSquareTest
185
+ module.exports.pointCloudObjectEcognizer2_0 = pointCloudObjectEcognizer2_0