Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Taking a look at this question and this one, I checked to see if Mathematica really does not have a Prism primitive. To my surprise the function Prism was black but hitting the F1 key didn't bring up anything useful. I also stumbled upon Tetrahedron and Hexahedron as being undocumented too. So how can one properly use these functions? If these functions have already been unearthed please forgive me as I could not find any usage of them here.

share|improve this question
add comment

1 Answer 1

up vote 12 down vote accepted

I'll show some examples of using the undocumemnted function Prism. Tetrahedron and Hexahedron are very similar.

First some points:

g = {{4, 2, 4}, {2, 2, 2}, {6, 2, 2}, {4, 6, 4}, {2, 6, 2}, {6, 6, 2}}
p = Prism[g];

We can use p directly in Graphics3D e.g.

Graphics3D[p]

Mathematica graphics

Or more fancy stuff:

Graphics3D[{EdgeForm[{Thick, Darker@Green}], 
  FaceForm[{Lighter@Yellow, Opacity[0.3]}], p}, Boxed -> False]

Mathematica graphics

Doing ?Prism reveals it has the following Options

Mathematica graphics

Edit

Here I show how to use Tetrahedron to generate a 3D Delaunay tetrahedralization:

First we load TeTGenLink package

Needs["TetGenLink`"]

Then we generate some points in 3D

pts3d = RandomReal[3, {50, 3}];

We tetrahedralize:

{ptstg, tetrahedra} = TetGenDelaunay[pts3d];
tetra = pts3d[[#]] & /@ tetrahedra;

Now the plot:

Graphics3D[{{Opacity[0.3], EdgeForm[{Thin, Darker@Blue}], 
   FaceForm[Yellow], Tetrahedron[tetra]}, {PointSize[0.02], Red, 
   Point[pts3d]}}, Boxed -> False, Lighting -> "Neutral"]

Mathematica graphics

Will Be included in V10

As I was writing this up I looked online in the new Wolfram documentation and it turns out these functions will be officially included in the upcoming v10. If you want to see how Tetrahedron and Hexahedron are used please see here and here respectively. Note that some of the functionalities shown there are not implemented in current versions of Mathematica

share|improve this answer
    
Regarding the edit: You can actually try these using the programming cloud. –  Szabolcs Jun 29 at 13:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.