potree icon indicating copy to clipboard operation
potree copied to clipboard

Error While using the new potree data format I.e the metadata.json, octree.bin, hierarchy.bin.

Open victorchrollo14 opened this issue 1 year ago • 3 comments

Getting the following error when trying to use the new potree data format.

Screenshot from 2024-07-02 14-20-12

What I did to get here

  1. Used the potreeconverter to convert a las file to potree format like below.
   ├── hierarchy.bin                                                                                                                                     
   ├── log.txt                                                                                                                                           
   ├── metadata.json                                                                                                                                     
   └── octree.bin  
  1. Implemented a simple web server in python to fetch the files.
  2. 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 avatar Jul 02 '24 09:07 victorchrollo14

@victorchrollo14 Hi, seems like you didnt load jQuery properly. Can you try and check again?

im-hamza-dev avatar Jul 08 '24 10:07 im-hamza-dev

@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.

victorchrollo14 avatar Jul 08 '24 13:07 victorchrollo14

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

victorchrollo14 avatar Oct 25 '24 08:10 victorchrollo14