Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mhuebert committed Feb 14, 2024
1 parent 82474b6 commit 40d9a2c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion bayes3d/genjax/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,4 +302,4 @@ def update_address(trace, key, address, value):
key,
genjax.choice_map({address: value}),
tuple(map(lambda v: Diff(v, UnknownChange), trace.args)),
)[0]
)[0]
35 changes: 19 additions & 16 deletions bayes3d/viser.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import viser
import os
import random
import time

import imageio.v3 as iio
import numpy as onp
import numpy as np
import trimesh
import viser

import bayes3d as b

server = viser.ViserServer()

server.add_frame(
"/tree",
Expand All @@ -18,22 +22,16 @@

client_handle = list(server.get_clients().values())[0]

p,q = client_handle.camera.position, client_handle.camera.wxyz
p, q = client_handle.camera.position, client_handle.camera.wxyz

client_handle.camera.position = p
client_handle.camera.wxyz = q

img = client_handle.camera.get_render(100,100)

img = client_handle.camera.get_render(100, 100)


server = viser.ViserServer()

import os
import trimesh
i = 9
model_dir = os.path.join(b.utils.get_assets_dir(), "ycb_video_models/models")
mesh_path = os.path.join(model_dir, b.utils.ycb_loader.MODEL_NAMES[i],"textured.obj")
mesh_path = os.path.join(model_dir, b.utils.ycb_loader.MODEL_NAMES[i], "textured.obj")
mesh = trimesh.load(mesh_path)

server.add_mesh_trimesh(
Expand All @@ -43,16 +41,21 @@

server.reset_scene()


server.add_mesh(
name="/trimesh",
vertices=mesh.vertices,
faces=mesh.faces,
)

sphere = trimesh.creation.uv_sphere(0.1, (10,10,))
sphere = trimesh.creation.uv_sphere(
0.1,
(
10,
10,
),
)
server.add_mesh(
name="/trimesh2",
vertices=sphere.vertices * np.array([1.0, 2.0, 3.0]),
faces=sphere.faces,
)
)

0 comments on commit 40d9a2c

Please sign in to comment.