Ply
The Ply component loads and displays PLY (Polygon File Format) point cloud files. This is ideal for:
- Loading 3D scan data
- Displaying pre-processed point clouds
- Visualizing LiDAR captures
- Loading assets from 3D scanning software
Basic Usage
A minimal example that loads a PLY file from a URL:
python
import os
import numpy as np
from vuer import Vuer, VuerSession
from vuer.schemas import Ply, Scene, OrbitControls
pixelnerf = "pointclouds/pixelnerf.ply"
app = Vuer(static_root=os.getcwd() + "/../../../assets")
@app.spawn(start=True)
async def main(sess: VuerSession):
# setting the toneMappingExposure to a lower value to make the color look nicer.
sess.set @ Scene(
toneMappingExposure=0.4,
bgChildren=[
OrbitControls(key="OrbitControls")
],
)
sess.upsert @ Ply(
src="http://localhost:8012/workspace/" + pixelnerf,
size=0.008,
rotation=[-0.5 * np.pi, 0, -0.5 * np.pi]
)
await sess.forever()
Learn More
For detailed examples of using Ply, see: