From: Benjamin R. <ben...@ou...> - 2011-03-07 20:22:36
|
On Mon, Mar 7, 2011 at 2:09 PM, M.Rule <mru...@gm...> wrote: > I want to plot as if rendering a 3D object. Usually this would involve > specifying vertices and facets. Its not obvious to me how to send this to > functions like plot_wireframe. I have looked at the documentation and the > tutorials, and am still not getting it. > > Maybe start with something very simple : how would I plot a cube ? > verts = > [[1,1,1],[1,1,-1],[1,-1,-1],[1,-1,1],[-1,1,1],[-1,1,-1],[-1,-1,-1],[-1,-1,1]] > faces = [[0,1,2,3],[4,5,6,7],[0,4,5,1],[0,4,7,3],[1,5,6,2],[2,6,7,3]] > > The wireframe and surface functions are a little un-intuitive to deal with. Based on your description of your problem and your example, it might be better to create a collection of 3d polygon objects. Consider this example: http://matplotlib.sourceforge.net/examples/mplot3d/polys3d_demo.html I hope this helps you. Ben Root |