# antenna.Polygon

Create polygon on xy-plane

## Description

Use the `antenna.Polygon` object to create a polygonal board shape centered at the origin and on the xy-plane. You can use `antenna.Polygon` to create single-layer or multi-layered antennas using `pcbStack`.

## Creation

### Syntax

``polygon = antenna.Polygon``
``polygon = antenna.Polygon(Name=Value)``

### Description

````polygon = antenna.Polygon` creates a polygon shape centered at the origin and on the xy-plane.```

example

````polygon = antenna.Polygon(Name=Value)` creates a polygon, with additional Properties using one or more name-value arguments. `Name` is the property name and `Value` is the corresponding value. You can specify several name-value arguments in any order as `Name1=Value1`, `...`, `NameN=ValueN`. Properties that you do not specify retain their default values.```

## Properties

expand all

Name of the polygon board shape, specified as a string.

Example: `"Polygon1"`

Data Types: `string`

Cartesian coordinates of polygon vertices, specified as a N-by-3 matrix in meters where N is the number of points.

Example: `[-1 0 0; -0.5 0.2 0; 0 0 0]`

Data Types: `double`

## Object Functions

 `add` Boolean unite operation on two shapes `subtract` Boolean subtraction operation on two shapes `intersect` Intersection of shape1 and shape2 `plus` Join two shapes `minus` Carve a shape from other shape `and` Boolean intersection operation on two shapes `area` Calculate area of 2-D shapes in square meters `show` Display antenna, array structures, shapes, or platform `plot` Plot boundary of 2-D shape `mesh` Mesh properties of metal, dielectric antenna, or array structure `rotate` Rotate shape about axis by angle `rotateX` Rotate shape about x-axis by angle `rotateY` Rotate shape about y-axis by angle `rotateZ` Rotate shape about z-axis by angle `translate` Move shape to new location `scale` Change size of shape by fixed factor `mirrorX` Mirror shape along x-axis `mirrorY` Mirror shape along y-axis `removeHoles` Remove holes from shape `removeSlivers` Remove sliver outliers from boundary of shape

## Examples

collapse all

Create a polygon using `antenna.Polygon` with vertices at `[-1 0 0; -0.5 0.2 0; 0 0 0]` and display it.

`p = antenna.Polygon(Vertices=[-1 0 0; -0.5 0.2 0; 0 0 0])`
```p = Polygon with properties: Name: 'mypolygon' Vertices: [3x3 double] ```
```show(p) axis equal``` Mesh the polygon and display the meshed shape.

`mesh(p,0.2)` Move the polygon to a new location on the X-Y plane.

```translate(p,[2,1,0]) axis equal``` ## Version History

Introduced in R2017a