zauberzeug / nicegui

Create web-based user interfaces with Python. The nice way.
https://nicegui.io
MIT License
10.16k stars 605 forks source link

scene.point_cloud() doesn't parse the cloud properly #3971

Closed bhomaidan1990 closed 1 week ago

bhomaidan1990 commented 1 week ago

Description

I want to visualize the bunny point cloud using NiceGUI, here is the code that I'm using:

import numpy as np
import open3d as o3d
from nicegui import ui

pcd_scene = ui.scene()

pcl_path = "bunny.ply"
cloud = o3d.io.read_point_cloud(pcl_path)
pts = np.asarray(cloud.points)
# o3d.visualization.draw_geometries([cloud])

pcd_scene.axes_helper()
pcd_scene.point_cloud(points=pts, point_size=0.1)

ui.run(show=False)

but as you can see the result is not OK, can you please tell me how I can fix that? thanks

Screenshot from 2024-11-10 20-30-20

falkoschindler commented 1 week ago

Hi @bhomaidan1990,

I think the bunny is alright. It just needs a smaller point size, maybe some color and can be scaled and turned up:

cloud = o3d.io.read_point_cloud('/Users/falko/Downloads/bunny.ply')
pts = np.asarray(cloud.points)

with ui.scene() as scene:
    scene.point_cloud(pts, point_size=0.001).material('silver').scale(20).rotate(3.14 / 2, 0, 0)
Screenshot 2024-11-11 at 07 18 07
bhomaidan1990 commented 1 week ago

@falkoschindler thanks