feat: initial commit - massive-cloud point cloud processing system
This commit is contained in:
36
server/assemblyInspectionJobRunner.ts
Normal file
36
server/assemblyInspectionJobRunner.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* 子进程入口:装配检测(STEP + 最近零件 + 统计 / 可选顶点热力)
|
||||
*/
|
||||
import 'dotenv/config';
|
||||
import { runAssemblyInspectionJob, type AssemblyInspectionOptions } from './assemblyInspectionJob.js';
|
||||
|
||||
const resultId = Number(process.argv[2]);
|
||||
const taskId = Number(process.argv[3]);
|
||||
const raw = process.argv[4] ?? '{}';
|
||||
|
||||
if (!Number.isFinite(resultId) || !Number.isFinite(taskId) || resultId <= 0 || taskId <= 0) {
|
||||
console.error('[AssemblyInspectionJobRunner] 参数: <resultId> <taskId> <jsonOptions>');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
let options: AssemblyInspectionOptions;
|
||||
try {
|
||||
options = JSON.parse(raw) as AssemblyInspectionOptions;
|
||||
} catch {
|
||||
options = {
|
||||
samplePoints: 100_000,
|
||||
toleranceMm: 0.3,
|
||||
includeVertexHeatmap: false,
|
||||
};
|
||||
}
|
||||
|
||||
if (options.samplePoints == null) options.samplePoints = 100_000;
|
||||
if (options.toleranceMm == null) options.toleranceMm = 0.3;
|
||||
if (options.includeVertexHeatmap == null) options.includeVertexHeatmap = false;
|
||||
|
||||
runAssemblyInspectionJob(resultId, taskId, options)
|
||||
.then(() => process.exit(0))
|
||||
.catch((e) => {
|
||||
console.error('[AssemblyInspectionJobRunner]', e);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user