This library is a visualization *React* module developed to efficiently render data output from the module [pcd-lod](https://github.com/AMDlab/pcd-lod), which converts point cloud data into an LOD (Level of Detail) format for efficient drawing. The purpos
npm install @i-con/pcd-viewerThis library is a visualization React module developed to efficiently render data output from the module pcd-lod, which converts point cloud data into an LOD (Level of Detail) format for efficient drawing. The purpose of this module is to facilitate effective visualization of this data on web browsers.
It includes a collection of components using React Three Fiber, allowing for easy integration into any React project.
``bash`
npm install @i-con/pcd-viewer # or yarn add @i-con/pcd-viewer
`tsx
/**
* Example component for the point cloud.
* fetches & renders the point cloud in the /examples/public/uav-8bit directory.
*/
const Example = () => {
const root = "/uav-8bit";
const [meta, setMeta] = useState
// Fetch & set the metadata of the point cloud.
useEffect(() => {
axios.get(${root}/meta.json).then(({ data }) => {
setMeta(data);
});
}, [root]);
// Loader callback for the point cloud.
const loader: PointCloudLODLoader
const { address, color } = props;
const { lod, coordinate } = address;
// Construct the URL of the PNG file from the address.
const url = ${root}/${lod}/${coordinate.x}-${coordinate.y}-${coordinate.z};
return pngLoader({ url, color });
}, [root]);
return meta !== null ? (
meta,
loader,
parser: pngParser,
pointSize: 15,
lodHelper: true,
}}
/>
) : null;
};
`
`bash
git clone pcd-viewer
cd pcd-viewer
npm install # or yarn install
npm run dev # or yarn dev