diff options
Diffstat (limited to 'view.py')
-rwxr-xr-x | view.py | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -22,7 +22,14 @@ def view(geometry, name=''): - rotate: click and drag the mouse - move: shift+click and drag the mouse """ - lower_bound, upper_bound = get_bounds(geometry.mesh) + + lower_bound = np.array([np.min(geometry.mesh[:,:,0]), + np.min(geometry.mesh[:,:,1]), + np.min(geometry.mesh[:,:,2])]) + + upper_bound = np.array([np.max(geometry.mesh[:,:,0]), + np.max(geometry.mesh[:,:,1]), + np.max(geometry.mesh[:,:,2])]) scale = np.linalg.norm(upper_bound-lower_bound) @@ -74,8 +81,7 @@ def view(geometry, name=''): def render(): """Render the mesh and display to screen.""" - cuda_raytrace(np.int32(pixels.size), origins_gpu, directions_gpu, - np.int32(geometry.first_leaf), pixels_gpu, **gpu_kwargs) + cuda_raytrace(np.int32(pixels.size), origins_gpu, directions_gpu, np.int32(geometry.node_map.size-1), np.int32(geometry.first_node), pixels_gpu, texrefs=texrefs, **gpu_kwargs) cuda.memcpy_dtoh(pixels, pixels_gpu) pygame.surfarray.blit_array(screen, pixels.reshape(size)) @@ -172,7 +178,7 @@ if __name__ == '__main__': parser = optparse.OptionParser('%prog filename.stl') parser.add_option('-b', '--bits', type='int', dest='bits', - help='bits for z-ordering space axes', default=6) + help='bits for z-ordering space axes', default=8) options, args = parser.parse_args() if len(args) < 1: |