Skip to content

Instantly share code, notes, and snippets.

@hugoledoux
Last active May 7, 2024 09:19
Show Gist options
  • Save hugoledoux/7868e3d1c09480e606cbf045f73b3fc7 to your computer and use it in GitHub Desktop.
Save hugoledoux/7868e3d1c09480e606cbf045f73b3fc7 to your computer and use it in GitHub Desktop.
ahn4 viewer with rerun
import rerun as rr
import numpy as np
import trimesh
import laspy
import startinpy
las = laspy.read("/Users/hugo/data/ahn4/crop.laz")
d = np.vstack((las.x, las.y, las.z)). transpose()
c = np. vstack((las.red, las.green, las.blue) ).transpose()
# dt = startinpy.DT()
# dt.insert(las.xyz)
# pts = dt.points
# pts[0] = pts[1]
# rr.log(
# "tintin",
# rr.Mesh3D(
# vertex_positions=pts,
# # vertex_colors=vertex_colors,
# # vertex_normals=mesh.vertex_normals,
# # vertex_texcoords=vertex_texcoords,
# # albedo_texture=albedo_texture,
# indices=dt.triangles,
# # mesh_material=mesh_material,
# ),
# )
rr. init("rerun_tin", spawn=True)
rr.log(
"my_points",
rr. Points3D(d, colors=c, radii=0.5)
)
# mesh = trimesh.load_mesh('/Users/hugo/projects/val3dity/data/poly/bunny.stl')
# mesh.show()
# rr. init("rerun_example_my_data", spawn=True)
# rr.log(
# "bunny",
# rr.Mesh3D(
# vertex_positions=mesh.vertices,
# # vertex_colors=vertex_colors,
# vertex_normals=mesh.vertex_normals,
# # vertex_texcoords=vertex_texcoords,
# # albedo_texture=albedo_texture,
# indices=mesh.faces,
# # mesh_material=mesh_material,
# ),
# )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment