Re: 3D plot
- To: mathgroup at smc.vnet.net
- Subject: [mg2295] Re: [mg2245] 3D plot
- From: Brown Jeffrey Scott <jsbrown0 at basalt.Mines.EDU>
- Date: Mon, 23 Oct 1995 12:41:24 -0400
Begin forwarded message: vecoven at montefiore.ulg.ac.be (Frederic Vecoven) >Now, THE PROBLEM is that I now work with hexahedras.... and that I have >2 files. The first file are all points coord., so that's "x1 y1 z1". >The number of the line is the number of the points. As you may imagine, >the second file is "n1 n2 n3 n4 n5 n6 n7 n8", which represents the 8 >numbers of the points which form the hexahedra... >My problem is that I can read the 2 lists, but I have problems to >switch "n2" to "x2 y2 z2"... names = {{n11,n12,n13,n14,n15,n16,n17,n18}, {n21,n22,n23,n24,n25,n26,n27,n28}, ... } coords = {{x1,y1,z1}, {x2,y2,z2}, ... } You can use (I haven't tested it...) Map[coords[[#]]&, names, {2}] This will yield {{{x1,y1,z1},(7 more terms)} {...} ... } Of course, if you start with line 0 instead of line 1 you'd need coords[[#+1]]& They can be recombined as needed in a similar way as the tetrahedra. Out[_]//TableForm / / / / / / / / / / / / / / / / / / / / / / / / / / / // // JEFF BROWN Colorado School of Mines // // December 1993 BSc in Engineering Physics, Mathematics // // January 1994 -- MS student in Geological Engineering: hydrogeology // // jsbrown0 at mines.edu // // jsbrown0 at basalt.mines.edu (NeXT mail) // // / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / //