WOLFRAM

WindingPolygon[{p1,p2,,pn}]

gives a polygon representing all points for which the closed contour p1,p2,,pn,p1 winds around at least once.

WindingPolygon[{{p11,p12,},{p21,p22,},}]

gives a polygon from the closed contours p11,p12, and p21,p22,.

WindingPolygon[,"wrule"]

uses the specified winding rule "wrule" to define the polygon.

Details and Options

  • WindingPolygon is also known as winding filling rule.
  • WindingPolygon is commonly used to define a polygon from self-intersecting closed curves.
  • A point p is in the polygon if the number of revolutions of the closed contour around p is not zero. The number of revolutions is given by WindingCount.
  • The number of winding counts are given below for each region:
  • Different winding rules "wrule" give different polygons. Possible winding rules include:
  • WindingPolygon[{p1,p2,}] is equivalent to WindingPolygon[{p1,p2,},"NonzeroRule"].
  • The points pi can have any embedding dimension, but must all lie in a plane and have the same embedding dimension.
  • WindingPolygon takes the same options as Polygon.
  • List of all options

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

Define a polygon:

Out[1]=1
Out[2]=2

Construct a polygon from a self-intersecting contour:

Out[1]=1

Its area:

Out[2]=2

Scope  (14)Survey of the scope of standard use cases

Basic Uses  (5)

Define a two-dimensional polygon:

Out[1]=1
Out[2]=2

Three-dimensional polygons:

Out[1]=1
Out[2]=2

n-dimensional polygons:

Out[1]=1

Construct polygons from self-intersecting contours:

Out[1]=1
Out[2]=2

Multiple contours:

Out[1]=1
Out[2]=2

Nonzero Rule  (3)

Polygons:

Out[2]=2

Three-dimensional polygons:

Out[2]=2

n-dimensional polygons:

Out[1]=1

EvenOdd Rule  (3)

Polygons:

Out[2]=2

Three-dimensional polygons:

Out[2]=2

n-dimensional polygons:

Out[1]=1

Two Rule  (3)

Polygons:

Out[2]=2

Three-dimensional polygons:

Out[2]=2

n-dimensional polygons:

Out[1]=1

Options  (6)Common values & functionality for each option

VertexColors  (2)

Polygon with vertex colors:

Out[1]=1

Specify vertex colors for 3D polygons:

Out[1]=1

VertexNormals  (1)

Compute normal vectors using the cross-product of edge vectors:

Out[2]=2

A triangle with normals pointing in the direction {1,-1,1}:

Out[3]=3

Using different normals will affect shading:

Out[4]=4

VertexTextureCoordinates  (3)

Texture mapping with 2D polygons:

Out[1]=1

Texture mapping with 3D polygons:

Out[2]=2

Repeat a texture by using non-unified texture coordinate values:

Out[1]=1

Texture mapping is preceded by VertexColors:

Out[1]=1

Applications  (3)Sample problems that can be solved with this function

Basic Applications  (1)

Out[1]=1

Geometry  (1)

Generation of regular star polygons:

Out[2]=2
Out[3]=3

Computational Geometry  (1)

Generate random polygons:

Out[3]=3
Out[4]=4

Properties & Relations  (2)Properties of the function, and connections to other functions

WindingPolygon is in general different than Polygon:

Out[2]=2

CrossingPolygon is an alternate polygon constructor:

Out[2]=2

Possible Issues  (2)Common pitfalls and unexpected behavior

WindingPolygon always gives full-dimensional components:

Out[1]=1
Out[2]=2

The points in WindingPolygon must lie on a plane:

Out[1]=1
Wolfram Research (2019), WindingPolygon, Wolfram Language function, https://reference.wolfram.com/language/ref/WindingPolygon.html.
Wolfram Research (2019), WindingPolygon, Wolfram Language function, https://reference.wolfram.com/language/ref/WindingPolygon.html.

Text

Wolfram Research (2019), WindingPolygon, Wolfram Language function, https://reference.wolfram.com/language/ref/WindingPolygon.html.

Wolfram Research (2019), WindingPolygon, Wolfram Language function, https://reference.wolfram.com/language/ref/WindingPolygon.html.

CMS

Wolfram Language. 2019. "WindingPolygon." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/WindingPolygon.html.

Wolfram Language. 2019. "WindingPolygon." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/WindingPolygon.html.

APA

Wolfram Language. (2019). WindingPolygon. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/WindingPolygon.html

Wolfram Language. (2019). WindingPolygon. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/WindingPolygon.html

BibTeX

@misc{reference.wolfram_2025_windingpolygon, author="Wolfram Research", title="{WindingPolygon}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/WindingPolygon.html}", note=[Accessed: 05-May-2025 ]}

@misc{reference.wolfram_2025_windingpolygon, author="Wolfram Research", title="{WindingPolygon}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/WindingPolygon.html}", note=[Accessed: 05-May-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_windingpolygon, organization={Wolfram Research}, title={WindingPolygon}, year={2019}, url={https://reference.wolfram.com/language/ref/WindingPolygon.html}, note=[Accessed: 05-May-2025 ]}

@online{reference.wolfram_2025_windingpolygon, organization={Wolfram Research}, title={WindingPolygon}, year={2019}, url={https://reference.wolfram.com/language/ref/WindingPolygon.html}, note=[Accessed: 05-May-2025 ]}