Message Boards Message Boards

0
|
2832 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

How to make Dipyramids and Trapezohedrons in Mathematica

Posted 2 years ago

Was trying to make 8, 10, 12, 14, 16, and 18-sided dipyramids and trapezohedrons in Mathematica with the Graphics3D function. I'm new to the program and having a lot of difficulty making these shapes. Anyone have a function that would work for those shapes?

POSTED BY: J B
2 Replies

I don't know exactly what you mean. Something like this perhaps?

pc[n_] := Module[{},
  Table[
   {Cos[2 Pi j /n], Sin[2 Pi j/n], 0}, {j, 0, n}]
  ]

e1 = Join[{{0, 0, 1}}, #] & /@ Partition[pc[8], 2, 1];
e2 = Join[{{0, 0, -1.5}}, #] & /@ Partition[pc[8], 2, 1];
Graphics3D[{Map[Polygon, e1], Map[Polygon, e2]}]

Note: the 1.5 in the 2nd statement is just so. You could change it of course

POSTED BY: Hans Dolhaine
Posted 2 years ago

Thank you! Exactly what I was looking for.

POSTED BY: J B
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract