xeokit-sdk
xeokit-sdk copied to clipboard
Create DeviationAnalysisPlugin
- Compares two models: point cloud and BIM
- Finds for each object a factor that indicates how far it deviates from the corresponding portion of the point cloud
- Possibly colorizes the objects using the factor
A general idea of usage:
import {Viewer, XKTLoaderPlugin, DeviationAnalysisPlugin} from "xeokit-sdk.es.js";
const viewer = new Viewer({
canvasId: "myCanvas",
transparent: true
});
const xktLoader = new XKTLoaderPlugin(viewer);
const model = xktLoader.load({
id: "myModel",
src: "./models/xkt/Schependomlaan.xkt",
edges: true
});
const pointCloud = xktLoader.load({
id: "myPointCloud",
src: "./models/xkt/Schependomlaan.laz.xkt"
});
const deviationAnalysis = new DeviationAnalysisPlugin(viewer, { });
const analysis = deviationAnalysis.analyze({
model: model,
pointCloud: pointCloud
});
// Rough idea
const deviationFactor = analysis.objectDeviationFactors["2hExBg8jj4NRG6zzD0RZML"];
if (deviationFactor > 0) {
viewer.scene.objects["2hExBg8jj4NRG6zzD0RZML"].highlighted = true;
}