The title pretty much says it all. Even though this question is really simple, I have not been able to find an answer. When I copy the example from the wolfram page,

Graphics3D[Triangle[{{0, 0, 0}, {1, 0, 0}, {0, 1, 1}}]]    

I get the error Triangle is not a Graphics3D primitive or directive. Just for reference I am using Mathematica 9 (maybe this feature was not enabled till 10?)

enter image description here


closed as off-topic by corey979, Jason B., Bob Hanlon, MarcoB, m_goldberg Feb 23 '17 at 6:10

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – corey979, Jason B., Bob Hanlon, MarcoB
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 4
    $\begingroup$ Triangle - says it was introduced in version 10.0 $\endgroup$ – Jason B. Feb 22 '17 at 23:16
  • 3
    $\begingroup$ But Graphics3D[Polygon[{{0, 0, 0}, {1, 0, 0}, {0, 1, 1}}]] works just fine $\endgroup$ – Jason B. Feb 22 '17 at 23:17
  • $\begingroup$ I'm voting to close this question as off-topic because the OP is asking for functionality that only exists in a later version of Mathematica than the one the OP is using. $\endgroup$ – m_goldberg Feb 23 '17 at 6:10

If you don't have it, you can just define it:

Triangle[opts : OptionsPattern[]] := Triangle[{{0, 0}, {1, 0}, {0, 1}}, opts];
Triangle[pts : {_, _, _}, opts : OptionsPattern[]] := Polygon[pts, opts]

and at least for Graphics and Graphics3D it will work as expected.

Mathematica graphics


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