Open yawning-lion opened 2 years ago
thanks a lot for the great library! I try to run sample code in terminal of ubuntu, but I just can't get proper result. ''' from mesh_to_sdf import mesh_to_voxels
import trimesh import skimage
mesh = trimesh.load('chair.obj')
voxels = mesh_to_voxels(mesh, 64, pad=True)
vertices, faces, normals, _ = skimage.measure.marching_cubes(voxels, level=0) mesh = trimesh.Trimesh(vertices=vertices, faces=faces, vertex_normals=normals) mesh.show() ''' ''' from mesh_to_sdf import sample_sdf_near_surface
import trimesh import pyrender import numpy as np
points, sdf = sample_sdf_near_surface(mesh, number_of_points=250000)
colors = np.zeros(points.shape) colors[sdf < 0, 2] = 1 colors[sdf > 0, 0] = 1 cloud = pyrender.Mesh.from_points(points, colors=colors) scene = pyrender.Scene() scene.add(cloud) viewer = pyrender.Viewer(scene, use_raymond_lighting=True, point_size=2) ''' I'm totally a noob there, and I'm wondering what's wrong with it. someone can help? I'll greatly apprieciate your help😭
thanks a lot for the great library! I try to run sample code in terminal of ubuntu, but I just can't get proper result. ''' from mesh_to_sdf import mesh_to_voxels
import trimesh import skimage
mesh = trimesh.load('chair.obj')
voxels = mesh_to_voxels(mesh, 64, pad=True)
vertices, faces, normals, _ = skimage.measure.marching_cubes(voxels, level=0) mesh = trimesh.Trimesh(vertices=vertices, faces=faces, vertex_normals=normals) mesh.show() ''' ''' from mesh_to_sdf import sample_sdf_near_surface
import trimesh import pyrender import numpy as np
mesh = trimesh.load('chair.obj')
points, sdf = sample_sdf_near_surface(mesh, number_of_points=250000)
colors = np.zeros(points.shape) colors[sdf < 0, 2] = 1 colors[sdf > 0, 0] = 1 cloud = pyrender.Mesh.from_points(points, colors=colors) scene = pyrender.Scene() scene.add(cloud) viewer = pyrender.Viewer(scene, use_raymond_lighting=True, point_size=2) ''' I'm totally a noob there, and I'm wondering what's wrong with it. someone can help? I'll greatly apprieciate your help😭