Autodesk数据可视化问题:热力图不渲染且精灵位置偏移
APS IoT Extensions Demo 运行异常排查
环境与配置
- 克隆
aps-iot-extensions-demo项目,替换自身 Client ID 和 Secret,使用rac_basic_sample_project.rvt模型,其余配置保持默认 - 自定义传感器与通道配置代码:
const SENSORS = { 'sensor-1': { name: 'Living Room', description: 'Basic sensor in the middle of the living room.', groupName: 'Level 1', location: { x: 31.92, y: 11.49, z: -12.97 }, objectId: 4124 }, 'sensor-2': { name: 'Dining Table', description: 'Basic sensor at the dining table.', groupName: 'Level 1', location: { x: -10, y: 41.64, z: -12.15 }, objectId: 4111 }, 'sensor-3': { name: 'Kitchen', description: 'Basic sensor in the kitchen.', groupName: 'Level 1', location: { x: 10, y: 41.64, z: -12.15 }, objectId: 4111 }, 'sensor-4': { name: 'Bedroom', description: 'Basic sensor in the bedroom.', groupName: 'Level 2', location: { x: -7.46, y: 41.47, z: 2.97 }, objectId: 4085 } }; const CHANNELS = { 'temp': { name: 'Temperature', description: 'External temperature in degrees Celsius.', type: 'double', unit: '°C', min: 18.0, max: 28.0 }, 'co2': { name: 'CO₂', description: 'Level of carbon dioxide.', type: 'double', unit: 'ppm', min: 482.81, max: 640.00 } };
问题现象
- 传感器定位错误:3个标注为
Level 1的传感器,2个出现在客厅楼层,1个在基础楼层,位置完全偏移 - 热力图无法显示:虽有数据点,但模型上无热力图渲染效果
- 无法从模型结构中获取房间数据
- 控制台存在错误(截图:
)
模型加载函数代码
export function loadModel(viewer: any, urn: string) { return new Promise(function (resolve, reject) { function onDocumentLoadSuccess(doc: any) { const viewable = doc.getRoot().getDefaultGeometry(true); resolve(viewer.loadDocumentNode(doc, viewable)); } function onDocumentLoadFailure(code: any, message: any, errors: any) { reject({ code, message, errors }); } window.Autodesk.Viewing.Document.load('urn:' + urn, onDocumentLoadSuccess, onDocumentLoadFailure); }); }
预期与实际结果
预期
- 热力图通过颜色梯度在模型上渲染数据点
- 精灵(Sprites)精准定位在模型对应位置
实际
- 有数据点但热力图完全不显示
- 精灵已渲染,但位置偏移,部分不在对应楼层
内容的提问来源于stack exchange,提问作者Ali Hamza
相关产品推荐
相关产品推荐

