Error While using the new potree data format I.e the metadata.json, octree.bin, hierarchy.bin.
Getting the following error when trying to use the new potree data format.
What I did to get here
- Used the potreeconverter to convert a las file to potree format like below.
├── hierarchy.bin
├── log.txt
├── metadata.json
└── octree.bin
- Implemented a simple web server in python to fetch the files.
- loading it like this inside next.js app
Potree.loadPointCloud('http://localhost:8000/metadata.json', (e: any) => {
let scene = viewer.scene;
let pointcloud = e.pointcloud;
let material = pointcloud.material;
material.size = 0.7;
material.pointSizeType = Potree.PointSizeType.ADAPTIVE;
material.shape = Potree.PointShape.SQUARE;
material.activeAttributeName = 'rgba';
material.rgbGamma = 0.67;
scene.addPointCloud(pointcloud);
// viewer.fitToScreen();
viewer.scene.view.setView(
[8.408, 12.242, 2.585],
[9.27, 12.767, 2.584],
);
});
Does anyone know what the issue might be? Any docs on using the new format would also be good.
@victorchrollo14 Hi, seems like you didnt load jQuery properly. Can you try and check again?
@victorchrollo14 Hi, seems like you didnt load jQuery properly. Can you try and check again?
Sure. I'll give that a try.
I seem to have this jQuery error, even while using the old potree format, but it doesn't cause any issue with the old format. The old format loads without any issue.
jQuery might be causing an issue, I'll fix it n see if the new format works.
Got this issue fixed. It was actually my server that had the issue. It did not support partial fetching of a file as a result I was unable to view the whole model.
went through the following lines in octreeLoader and figured that it requires partial fetching. https://github.com/potree/potree/blob/c53cf7f7e692ee27bc4c2c623fe17bd678d25558/src/modules/loader/2.0/OctreeLoader.js#L49C5-L54C8