This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Polygon

Updated In 6 Graphic
Polygon[{pt1, pt2, ...}]
is a graphics primitive that represents a filled polygon.
Polygon[{{pt11, pt12, ...}, {pt21, ...}, ...}]
represents a collection of polygons.
  • The positions of points can be specified either in ordinary coordinates as {x, y} or {x, y, z}, or in scaled coordinates as Scaled[{x, y}] or Scaled[{x, y, z}].  »
  • Offset can be used to specify coordinates in two dimensions.  »
  • The boundary of a polygon is formed by joining the last point you specify to the first one.
  • FaceForm and EdgeForm can be used to specify how the interiors and boundaries of polygons should be rendered.  »
  • In two dimensions, polygons are by default rendered with no explicit edges drawn. In three dimensions, they are by default rendered with black lines on their edges.
  • The option VertexColors->{c1, c2, ...} can be used to specify different colors for each vertex of a polygon. The interior is then colored by interpolation between these.  »
  • In three dimensions, shading of polygons is determined by simulated lighting.
  • Polygons are by default assumed to act like diffuse gray reflectors. Color directives can be used to change their surface color.
  • You can specify surface material properties using the graphics directives Specularity and Opacity.
  • Glow[color] can be used to add glow colors that are not affected by simulated illumination.
  • In three-dimensional graphics, polygons are considered to have both front and back faces, with their normals taken to point to the front.
  • You can use FaceForm[front, back] to specify different properties for front and back faces.  »
  • By default, the normal direction for a polygon is determined by a right-hand rule, so that typically the first three vertices will be in a counterclockwise order when viewed from the front.
  • The option VertexNormals->{n1, n2, ...} can be used to specify effective normals at each vertex of a polygon, to be interpolated for purposes of smooth shading.  »
  • Polygons in 2D and 3D can be non-convex, and can intersect themselves. Self-intersecting polygons are filled according to an even-odd rule that alternates between filling and not at each crossing.
  • In 3D, non-planar polygons are broken into triangles for rendering. Quadrilaterals are broken in two; other convex polygons are typically broken into triangles emanating from the center.
  • For purposes of shading, non-planar polygons are taken by default to have a single average normal.
  • Individual coordinates and lists of coordinates in polygons can be Dynamic objects.
New in 1 | Last modified in 6