
# IPCB_Polygon interface

A polygon pour on a PCB document, an irregular area of copper that connects to a net and is poured around existing objects.

```csharp
public interface IPCB_Polygon : IPCB_Group
```

**Namespace:** PCB · **Assembly:** Altium.SDK.Interfaces

**Inherits:** [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md) → [IPCB_Group](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Group.md)

**Derived:** [IPCB_BoardOutline](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_BoardOutline.md)

## Remarks

Polygons are similar to area fills, except that they can fill irregular shaped areas of a board and can connect to a specified net as they are poured. By adjusting the grid and track size, a polygon can be either a solid copper area or a cross-hatched lattice. Polygons can be placed on any layer except an internal plane layer; a polygon on a layer that is not a signal layer is not poured around existing objects.

Polygons are group objects: the tracks, arcs and regions created when a polygon is poured are its child objects. Use [`GroupIterator_Create`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Group.md#groupiterator_create) and [`GroupIterator_Destroy`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Group.md#groupiterator_destroy) to iterate them. To copy a polygon together with its poured copper, the examples use [`ReplicateWithChildren`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Group.md#replicatewithchildren).

Split planes on internal plane layers are represented by [`IPCB_SplitPlane`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_SplitPlane.md), not by this interface.

## Example

Report the net, type, size and segments of every polygon on the current board.

```csharp
using System.Collections.Generic;
using System.IO;
using DXP;
using PCB;

// Retrieve the current board.
IPCB_Board board = PCB.GlobalVars.PCBServer?.GetCurrentPCBBoard();
if (board == null)
    return;

// Search for polygons and, for each polygon found, collect
// its attributes in a list to be saved as a text file.
IPCB_BoardIterator iterator = board.BoardIterator_Create();
iterator.AddFilter_ObjectSet(new PCB.TObjectSet { TObjectId.ePolyObject });
iterator.AddFilter_AllLayers();
iterator.AddFilter_Method(TIterationMethod.eProcessAll);

int polyNo = 0;
var polygonReport = new List<string>();
var polygon = iterator.FirstPCBObject() as IPCB_Polygon;
while (polygon != null)
{
    polyNo++;
    polygonReport.Add("Polygon No : " + polyNo);
    // Check that the net exists before getting its name.
    if (polygon.GetState_Net() != null)
        polygonReport.Add(" Polygon Net : " + polygon.GetState_Net().GetState_Name());
    if (polygon.GetState_PolygonType() == TPolygonType.eSignalLayerPolygon)
        polygonReport.Add(" Polygon type : " + "Polygon on Signal Layer");
    else
        polygonReport.Add(" Polygon type : " + "Split plane polygon");
    polygonReport.Add(" Polygon BorderWidth : " + polygon.GetState_BorderWidth());
    polygonReport.Add(" Area size : " + polygon.GetState_AreaSize());

    // Segments of the polygon.
    for (int i = 0; i <= polygon.GetState_PointCount() - 1; i++)
    {
        PolySegment segment = polygon.GetState_Segments(i);
        if (segment.Kind == TPolySegmentType.ePolySegmentLine)
        {
            polygonReport.Add(" Polygon Segment Line at X: " + segment.Vx);
            polygonReport.Add(" Polygon Segment Line at Y: " + segment.Vy);
        }
        else
        {
            polygonReport.Add(" Polygon Segment Arc 1 : " + segment.Angle1);
            polygonReport.Add(" Polygon Segment Arc 2 : " + segment.Angle2);
            polygonReport.Add(" Polygon Segment Radius : " + segment.Radius);
        }
    }
    polygonReport.Add("");
    polygon = iterator.NextPCBObject() as IPCB_Polygon;
}
board.BoardIterator_Destroy(ref iterator);

// Save the polygon data as a text file next to the board file.
string fileName = Path.ChangeExtension(board.GetState_FileName(), ".pol");
File.WriteAllLines(fileName, polygonReport);

// Display the polygons report.
IClient client = DXP.GlobalVars.Client;
IServerDocument document = client.OpenDocument("Text", fileName);
if (document != null)
    client.ShowDocument(document);
```

## Properties

| Property | Type | Access | Description |
| --- | --- | --- | --- |
| [ArcApproximation](#arcapproximation) | `int` | get; set | The arc resolution of the pour, the maximum distance by which the line segments that approximate an arc, for example around a pad or via, may deviate from a perfect arc. |
| [ArcPourMode](#arcpourmode) | `bool` | get; set |  |
| [AreaSize](#areasize) | `double` | get; set | The area enclosed by the polygon's outline, in square internal units. |
| [AutoGenerateName](#autogeneratename) | `bool` | get; set | Whether the polygon's name is generated automatically. |
| [AvoidObsticles](#avoidobsticles) | `bool` | get; set | Whether the polygon is poured around the other objects in its area. |
| [BorderWidth](#borderwidth) | `int` | get; set |  |
| [ClipAcuteCorners](#clipacutecorners) | `bool` | get; set |  |
| [CopperPourInvalid](#copperpourinvalid) | `bool` | get | Whether the polygon's pour is marked as out of date. |
| [DrawDeadCopper](#drawdeadcopper) | `bool` | get; set | A diagnostic drawing option for dead copper. |
| [DrawRemovedIslands](#drawremovedislands) | `bool` | get; set | A diagnostic drawing option for the islands that the pour removes. |
| [DrawRemovedNecks](#drawremovednecks) | `bool` | get; set | A diagnostic drawing option for the narrow necks that the pour removes. |
| [ExpandOutline](#expandoutline) | `bool` | get; set |  |
| [Grid](#grid) | `int` | get; set | The grid on which the hatch tracks of the polygon are placed, in internal units (10,000 per mil). |
| [HitPrimitive](#hitprimitive) | `bool` | get | Whether the given primitive touches the polygon's outline or lies inside it. |
| [IgnoreViolations](#ignoreviolations) | `bool` | get; set | Whether on-line DRC violations are ignored for the polygon. |
| [InRepour](#inrepour) | `bool` | get | Whether the polygon is being repoured. |
| [IslandAreaThreshold](#islandareathreshold) | `double` | get; set | The area below which the islands created when the polygon is poured are removed, in square internal units (100,000,000 per square mil). |
| [MinTrack](#mintrack) | `int` | get; set | The minimum length of the primitives created when the polygon is poured, in internal units (10,000 per mil). |
| [MitreCorners](#mitrecorners) | `bool` | get; set |  |
| [Name](#name) | `string` | get; set | The polygon's name. |
| [NeckWidthThreshold](#neckwidththreshold) | `int` | get; set | The width below which narrow sections of the pour are removed, in internal units (10,000 per mil). |
| [PointCount](#pointcount) | `int` | get; set | The number of segments in the polygon's outline. |
| [PolygonType](#polygontype) | [TPolygonType](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TPolygonType.md) | get; set | The kind of polygon. |
| [PolyHatchStyle](#polyhatchstyle) | [TPolyHatchStyle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TPolyHatchStyle.md) | get; set | How the polygon is filled when it is poured. |
| [Poured](#poured) | `bool` | get; set | Whether the polygon is poured, that is, not shelved. |
| [PourIndex](#pourindex) | `int` | get; set | The polygon's position in the board's pour order. |
| [PourOver](#pourover) | [TPolygonPourOver](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TPolygonPourOver.md) | get; set | Which existing copper of the polygon's own net the polygon pours over. |
| [RemoveDead](#removedead) | `bool` | get; set | Whether regions of dead copper are removed from the polygon when it is poured. |
| [RemoveIslandsByArea](#removeislandsbyarea) | `bool` | get; set | Whether islands of the pour with an area less than [`IslandAreaThreshold`](#islandareathreshold) are removed. |
| [RemoveNarrowNecks](#removenarrownecks) | `bool` | get; set | Whether sections of the pour narrower than [`NeckWidthThreshold`](#neckwidththreshold) are removed. |
| [Segments](#segments) | [PolySegment](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/PolySegment.md) | get; set | The segments of the polygon's outline, by index. |
| [StrictHitTest](#stricthittest) | `bool` | get | Whether the given point lies inside the polygon's bounding rectangle and inside its outline. |
| [TrackSize](#tracksize) | `int` | get; set | The width of the tracks that hatch the polygon, in internal units (10,000 per mil). |
| [UseOctagons](#useoctagons) | `bool` | get; set | Whether pads are surrounded by octagons rather than arcs when the polygon is poured. |

### ArcApproximation

The arc resolution of the pour, the maximum distance by which the line segments that approximate an arc, for example around a pad or via, may deviate from a perfect arc.

```csharp
int GetState_ArcApproximation();
void SetState_ArcApproximation(int argValue);
```

**Type:** `int` · **Access:** read/write

The value is in internal units (10,000 per mil). The default value is 0.5 mil. The lower the value, the smoother the arc; the higher the value, the coarser the arc, with longer line segments.

### ArcPourMode

*No description yet.*

```csharp
bool GetState_ArcPourMode();
void SetState_ArcPourMode(bool argValue);
```

**Type:** `bool` · **Access:** read/write

### AreaSize

The area enclosed by the polygon's outline, in square internal units.

```csharp
double GetState_AreaSize();
void SetState_AreaSize(double argValue);
```

**Type:** `double` · **Access:** read/write

The value is approximate: it does not take the width of the outline or the hatching into account. [`SetState_XSizeYSize_1`](#setstate_xsizeysize_1) recalculates it from the outline; an assigned value is stored as given.

### AutoGenerateName

Whether the polygon's name is generated automatically.

```csharp
bool GetState_AutoGenerateName();
void SetState_AutoGenerateName(bool argValue);
```

**Type:** `bool` · **Access:** read/write

Only polygons on signal layers are named automatically: on other layers the property reads false and assigning it does nothing. While it is true and the polygon is on a board, `Name` returns the generated name. Setting it to false keeps the last generated name as the polygon's name.

### AvoidObsticles

Whether the polygon is poured around the other objects in its area.

```csharp
bool GetState_AvoidObsticles();
void SetState_AvoidObsticles(bool argValue);
```

**Type:** `bool` · **Access:** read/write

When false, the pour does not cut voids around other objects.

### BorderWidth

*No description yet.*

```csharp
int GetState_BorderWidth();
void SetState_BorderWidth(int argValue);
```

**Type:** `int` · **Access:** read/write

### ClipAcuteCorners

*No description yet.*

```csharp
bool GetState_ClipAcuteCorners();
void SetState_ClipAcuteCorners(bool argValue);
```

**Type:** `bool` · **Access:** read/write

### CopperPourInvalid

Whether the polygon's pour is marked as out of date.

```csharp
bool GetState_CopperPourInvalid();
```

**Type:** `bool` · **Access:** read-only

### DrawDeadCopper

A diagnostic drawing option for dead copper.

```csharp
bool GetState_DrawDeadCopper();
void SetState_DrawDeadCopper(bool argValue);
```

**Type:** `bool` · **Access:** read/write

### DrawRemovedIslands

A diagnostic drawing option for the islands that the pour removes.

```csharp
bool GetState_DrawRemovedIslands();
void SetState_DrawRemovedIslands(bool argValue);
```

**Type:** `bool` · **Access:** read/write

### DrawRemovedNecks

A diagnostic drawing option for the narrow necks that the pour removes.

```csharp
bool GetState_DrawRemovedNecks();
void SetState_DrawRemovedNecks(bool argValue);
```

**Type:** `bool` · **Access:** read/write

### ExpandOutline

*No description yet.*

```csharp
bool GetState_ExpandOutline();
void SetState_ExpandOutline(bool argValue);
```

**Type:** `bool` · **Access:** read/write

### Grid

The grid on which the hatch tracks of the polygon are placed, in internal units (10,000 per mil).

```csharp
int GetState_Grid();
void SetState_Grid(int argValue);
```

**Type:** `int` · **Access:** read/write

Ideally this grid is a fraction of the component pin pitch, to allow the most effective placement of the polygon tracks.

### HitPrimitive

Whether the given primitive touches the polygon's outline or lies inside it.

```csharp
bool GetState_HitPrimitive(IPCB_Primitive argPrimitive);
```

**Type:** `bool` · **Access:** read-only · **Index:** `argPrimitive` ([IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md))

The accessors are extension methods of `IPCB_PolygonHelper` (`using PCB;`).

Returns true when the primitive's reference point is inside the outline or the primitive overlaps one of the outline's segments. On a board outline ([`IPCB_BoardOutline`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_BoardOutline.md)) the primitive's layer is not taken into account.

**See also:** [IPCB_BoardOutline](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_BoardOutline.md)

### IgnoreViolations

Whether on-line DRC violations are ignored for the polygon.

```csharp
bool GetState_IgnoreViolations();
void SetState_IgnoreViolations(bool argValue);
```

**Type:** `bool` · **Access:** read/write

### InRepour

Whether the polygon is being repoured.

```csharp
bool GetState_InRepour();
```

**Type:** `bool` · **Access:** read-only

### IslandAreaThreshold

The area below which the islands created when the polygon is poured are removed, in square internal units (100,000,000 per square mil).

```csharp
double GetState_IslandAreaThreshold();
void SetState_IslandAreaThreshold(double argValue);
```

**Type:** `double` · **Access:** read/write

Islands are removed only when [`RemoveIslandsByArea`](#removeislandsbyarea) is true. The default value is 2500 square mils.

### MinTrack

The minimum length of the primitives created when the polygon is poured, in internal units (10,000 per mil).

```csharp
int GetState_MinTrack();
void SetState_MinTrack(int argValue);
```

**Type:** `int` · **Access:** read/write

### MitreCorners

*No description yet.*

```csharp
bool GetState_MitreCorners();
void SetState_MitreCorners(bool argValue);
```

**Type:** `bool` · **Access:** read/write

### Name

The polygon's name.

```csharp
string GetState_Name();
void SetState_Name(string argName);
```

**Type:** `string` · **Access:** read/write

While [`AutoGenerateName`](#autogeneratename) is true, assigning a name does nothing.

### NeckWidthThreshold

The width below which narrow sections of the pour are removed, in internal units (10,000 per mil).

```csharp
int GetState_NeckWidthThreshold();
void SetState_NeckWidthThreshold(int argValue);
```

**Type:** `int` · **Access:** read/write

Narrow sections are removed only when [`RemoveNarrowNecks`](#removenarrownecks) is true. The default value is 5 mils.

### PointCount

The number of segments in the polygon's outline.

```csharp
int GetState_PointCount();
void SetState_PointCount(int argValue);
```

**Type:** `int` · **Access:** read/write

`Segments` accepts indexes from 0 to `PointCount` inclusive.

### PolygonType

The kind of polygon.

```csharp
TPolygonType GetState_PolygonType();
void SetState_PolygonType(TPolygonType argValue);
```

**Type:** [TPolygonType](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TPolygonType.md) · **Access:** read/write

The accessors are extension methods of `IPCB_PolygonHelper` (`using PCB;`).

The property is read-only in effect: it always returns `TPolygonType.eSignalLayerPolygon`, and assigning a value does not change it.

**See also:** [TPolygonType](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TPolygonType.md)

### PolyHatchStyle

How the polygon is filled when it is poured.

```csharp
TPolyHatchStyle GetState_PolyHatchStyle();
void SetState_PolyHatchStyle(TPolyHatchStyle argValue);
```

**Type:** [TPolyHatchStyle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TPolyHatchStyle.md) · **Access:** read/write

The accessors are extension methods of `IPCB_PolygonHelper` (`using PCB;`).

`TPolyHatchStyle.ePolySolid` fills the polygon with solid copper regions. `TPolyHatchStyle.ePolyHatch90`, `TPolyHatchStyle.ePolyHatch45`, `TPolyHatchStyle.ePolyVHatch` and `TPolyHatchStyle.ePolyHHatch` fill it with a hatch of tracks and arcs (90 degree, 45 degree, vertical or horizontal).

`TPolyHatchStyle.ePolyNoHatch` does not fill the polygon at all: only the boundary tracks are present. You may wish to use this option if you want to place a polygon during the design phase, but do not want it to slow system performance. The polygon can be re-poured with the desired hatching before generating output.

**See also:** [TPolyHatchStyle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TPolyHatchStyle.md), [IPCB_Region](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Region.md)

### Poured

Whether the polygon is poured, that is, not shelved.

```csharp
bool GetState_Poured();
void SetState_Poured(bool argValue);
```

**Type:** `bool` · **Access:** read/write

Assigning a value does nothing.

### PourIndex

The polygon's position in the board's pour order.

```csharp
int GetState_PourIndex();
void SetState_PourIndex(int argValue);
```

**Type:** `int` · **Access:** read/write

When [`AutoGenerateName`](#autogeneratename) is true, assigning a value regenerates the polygon's name, which contains the pour index.

### PourOver

Which existing copper of the polygon's own net the polygon pours over.

```csharp
TPolygonPourOver GetState_PourOver();
void SetState_PourOver(TPolygonPourOver argValue);
```

**Type:** [TPolygonPourOver](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TPolygonPourOver.md) · **Access:** read/write

The accessors are extension methods of `IPCB_PolygonHelper` (`using PCB;`).

With `TPolygonPourOver.ePolygonPourOver_None` the polygon pours around existing tracks and arcs of the same net. With `TPolygonPourOver.ePolygonPourOver_SameNet` it covers existing tracks and arcs of the same net. With `TPolygonPourOver.ePolygonPourOver_SameNetPolygons` it covers only same-net copper that belongs to a polygon.

**See also:** [TPolygonPourOver](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TPolygonPourOver.md)

### RemoveDead

Whether regions of dead copper are removed from the polygon when it is poured.

```csharp
bool GetState_RemoveDead();
void SetState_RemoveDead(bool argValue);
```

**Type:** `bool` · **Access:** read/write

Dead copper is created when an area of the polygon can not be connected to the selected net. You can view dead copper as unconnected "islands" of copper within the polygon created when existing tracks, pads and vias prevent the plane pouring as one continuous area. If this property is false, areas of dead copper are not removed.

The entire polygon is removed if it does not enclose any pads on the selected net, as it is all viewed as dead copper.

### RemoveIslandsByArea

Whether islands of the pour with an area less than [`IslandAreaThreshold`](#islandareathreshold) are removed.

```csharp
bool GetState_RemoveIslandsByArea();
void SetState_RemoveIslandsByArea(bool argValue);
```

**Type:** `bool` · **Access:** read/write

### RemoveNarrowNecks

Whether sections of the pour narrower than [`NeckWidthThreshold`](#neckwidththreshold) are removed.

```csharp
bool GetState_RemoveNarrowNecks();
void SetState_RemoveNarrowNecks(bool argValue);
```

**Type:** `bool` · **Access:** read/write

If false, narrow necks are left alone.

### Segments

The segments of the polygon's outline, by index.

```csharp
PolySegment GetState_Segments(int argI);
void SetState_Segments(int argI, PolySegment argValue);
```

**Type:** [PolySegment](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/PolySegment.md) · **Access:** read/write · **Index:** `argI` (`int`)

The accessors are extension methods of `IPCB_PolygonHelper` (`using PCB;`).

Each segment is a line (`Kind` is `TPolySegmentType.ePolySegmentLine`) given by its vertex `Vx`, `Vy`, or an arc (`TPolySegmentType.ePolySegmentArc`) given by its center `Cx`, `Cy`, its `Radius` and the angles `Angle1` and `Angle2`. Coordinates are in internal units (10,000 per mil). Valid indexes are from 0 to [`PointCount`](#pointcount) inclusive; any other index returns a segment with all fields zero, and assigning a segment at such an index does nothing.

**See also:** [PolySegment](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/PolySegment.md)

### StrictHitTest

Whether the given point lies inside the polygon's bounding rectangle and inside its outline.

```csharp
bool GetState_StrictHitTest(int argHitX, int argHitY);
```

**Type:** `bool` · **Access:** read-only · **Index:** `argHitX` (`int`): The X coordinate of the point, in internal units (10,000 per mil)., `argHitY` (`int`): The Y coordinate of the point, in internal units (10,000 per mil).

### TrackSize

The width of the tracks that hatch the polygon, in internal units (10,000 per mil).

```csharp
int GetState_TrackSize();
void SetState_TrackSize(int argValue);
```

**Type:** `int` · **Access:** read/write

### UseOctagons

Whether pads are surrounded by octagons rather than arcs when the polygon is poured.

```csharp
bool GetState_UseOctagons();
void SetState_UseOctagons(bool argValue);
```

**Type:** `bool` · **Access:** read/write

Octagons give smaller Gerber files and faster photoplotting.

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [AcceptsLayer](#acceptslayer) | `bool` | Returns whether the polygon can be placed on the given layer. |
| [CopperPourValidate](#copperpourvalidate) | `void` | Repours the polygon if its pour is marked as out of date ([`CopperPourInvalid`](#copperpourinvalid)). |
| [GetDefaultName](#getdefaultname) | `string` | Returns a unique name for the polygon, generated for the board the polygon is on. |
| [GrowPolyshape](#growpolyshape) | `void` | Moves the edges of the polygon's outline outwards or inwards by the given distance. |
| [Internal_xBoundingRectangle](#internal_xboundingrectangle) | [ICoordRect](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/ICoordRect.md) |  |
| [PointInPolygon](#pointinpolygon) | `bool` | Returns whether the given point lies inside the polygon's outline. |
| [PrimitiveInsidePoly](#primitiveinsidepoly) | `bool` | Returns whether the given primitive lies completely inside the polygon's outline. |
| [Rebuild](#rebuild) | `void` | Repours the polygon, regenerating its child copper. |
| [RotateAroundXY](#rotatearoundxy) | `void` | Rotates the polygon about the given point. |
| [SetState_AutoNameInvalidate](#setstate_autonameinvalidate) | `void` | Marks the polygon's automatically generated name as out of date. |
| [SetState_CopperPourInvalid](#setstate_copperpourinvalid) | `void` | Marks the polygon's pour as out of date. |
| [SetState_CopperPourValid](#setstate_copperpourvalid) | `void` | Marks the polygon's pour as up to date. |
| [SetState_XSizeYSize_1](#setstate_xsizeysize_1) | `bool` | Recalculates the polygon's bounding rectangle and [`AreaSize`](#areasize) from its outline. |
| [XBoundingRectangle](#xboundingrectangle) | [CoordRect](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/CoordRect.md) | Returns the bounding rectangle of the polygon's outline. |

### AcceptsLayer

Returns whether the polygon can be placed on the given layer.

```csharp
bool AcceptsLayer(TV6_Layer argLayer);
bool AcceptsLayer(int argLayer);
```

| Parameter | Type | Passing |
| --- | --- | --- |
| `argLayer` | [TV6_Layer](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TV6_Layer.md) | value |

**Returns:** `bool`

The first overload is an extension method of `IPCB_PolygonHelper` (`using PCB;`) with typed parameters; the second is declared by the interface.

Returns false for internal plane layers and true for any other layer.

### CopperPourValidate

Repours the polygon if its pour is marked as out of date ([`CopperPourInvalid`](#copperpourinvalid)).

```csharp
void CopperPourValidate();
```

**Returns:** nothing (`void`)

### GetDefaultName

Returns a unique name for the polygon, generated for the board the polygon is on.

```csharp
string GetDefaultName();
```

**Returns:** `string`

Returns an empty string when the polygon is not on a board.

### GrowPolyshape

Moves the edges of the polygon's outline outwards or inwards by the given distance.

```csharp
void GrowPolyshape(int argDist);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argDist` | `int` | value | The distance, in internal units (10,000 per mil). A positive value moves the edges outwards, so the area grows; a negative value moves them inwards. |

**Returns:** nothing (`void`)

Does nothing when the distance is 0 or the outline has fewer than two points.

### Internal_xBoundingRectangle

*No description yet.*

```csharp
ICoordRect Internal_xBoundingRectangle();
```

**Returns:** [ICoordRect](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/ICoordRect.md)

### PointInPolygon

Returns whether the given point lies inside the polygon's outline.

```csharp
bool PointInPolygon(int argHitX, int argHitY);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argHitX` | `int` | value | The X coordinate of the point, in internal units (10,000 per mil). |
| `argHitY` | `int` | value | The Y coordinate of the point, in internal units (10,000 per mil). |

**Returns:** `bool`

### PrimitiveInsidePoly

Returns whether the given primitive lies completely inside the polygon's outline.

```csharp
bool PrimitiveInsidePoly(IPCB_Primitive argPrimitive);
bool PrimitiveInsidePoly(object argPrimitive);
```

| Parameter | Type | Passing |
| --- | --- | --- |
| `argPrimitive` | [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md) | value |

**Returns:** `bool`

The first overload is an extension method of `IPCB_PolygonHelper` (`using PCB;`) with typed parameters; the second is declared by the interface.

Returns true when the primitive's reference point is inside the outline and the primitive does not touch any of the outline's segments.

### Rebuild

Repours the polygon, regenerating its child copper.

```csharp
void Rebuild();
```

**Returns:** nothing (`void`)

On a board outline ([`IPCB_BoardOutline`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_BoardOutline.md)) it rebuilds the outline instead and deletes all of the outline's bending lines.

**See also:** [IPCB_BoardOutline](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_BoardOutline.md)

### RotateAroundXY

Rotates the polygon about the given point.

```csharp
void RotateAroundXY(int argX, int argY, double argngle);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argX` | `int` | value | The X coordinate of the point to rotate about, in internal units (10,000 per mil). |
| `argY` | `int` | value | The Y coordinate of the point to rotate about, in internal units (10,000 per mil). |
| `argngle` | `double` | value | The rotation angle, in degrees. |

**Returns:** nothing (`void`)

### SetState_AutoNameInvalidate

Marks the polygon's automatically generated name as out of date.

```csharp
void SetState_AutoNameInvalidate();
```

**Returns:** nothing (`void`)

### SetState_CopperPourInvalid

Marks the polygon's pour as out of date.

```csharp
void SetState_CopperPourInvalid();
```

**Returns:** nothing (`void`)

[`CopperPourValidate`](#copperpourvalidate) then repours the polygon.

### SetState_CopperPourValid

Marks the polygon's pour as up to date.

```csharp
void SetState_CopperPourValid();
```

**Returns:** nothing (`void`)

### SetState_XSizeYSize_1

Recalculates the polygon's bounding rectangle and [`AreaSize`](#areasize) from its outline.

```csharp
bool SetState_XSizeYSize_1();
```

**Returns:** `bool`

Returns true. The examples call it after assigning [`PointCount`](#pointcount) and `Segments` of a board outline.

### XBoundingRectangle

Returns the bounding rectangle of the polygon's outline.

```csharp
CoordRect XBoundingRectangle();
```

**Returns:** [CoordRect](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/CoordRect.md)

Extension method of `IPCB_PolygonHelper` (`using PCB;`).

## Inherited members

- From [IPCB_Group](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Group.md): [AddPCBObject](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Group.md#addpcbobject), [FastSetState_XSizeYSize](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Group.md#fastsetstate_xsizeysize), [FreePrimitives](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Group.md#freeprimitives), [GetPrimitiveAt](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Group.md#getprimitiveat), [GetPrimitiveCount](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Group.md#getprimitivecount), [GroupIterator_Create](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Group.md#groupiterator_create), [GroupIterator_Destroy](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Group.md#groupiterator_destroy), [LayerUsed](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Group.md#layerused), [PrimitiveLock](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Group.md#primitivelock), [RemovePCBObject](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Group.md#removepcbobject), [ReplicateWithChildren](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Group.md#replicatewithchildren), [SetState_LayersUsedArray](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Group.md#setstate_layersusedarray), [SetState_XSizeYSize](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Group.md#setstate_xsizeysize), [XLocation](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Group.md#xlocation), [YLocation](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Group.md#ylocation)
- From [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md): [AllowGlobalEdit](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#allowglobaledit), [BeginModify](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#beginmodify), [Board](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#board), [BoundingRectangle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#boundingrectangle), [BoundingRectangleChildren](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#boundingrectanglechildren), [BoundingRectangleForPainting](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#boundingrectangleforpainting), [BoundingRectangleForSelection](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#boundingrectangleforselection), [CancelModify](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#cancelmodify), [Component](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#component), [Coordinate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#coordinate), [DescriptorString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#descriptorstring), [DetailString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#detailstring), [Dimension](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#dimension), [DrawAsPreview](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#drawaspreview), [DRCError](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#drcerror), [Enabled](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled), [Enabled_Direct](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_direct), [Enabled_vComponent](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vcomponent), [Enabled_vCoordinate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vcoordinate), [Enabled_vDimension](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vdimension), [Enabled_vNet](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vnet), [Enabled_vPolygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vpolygon), [EnableDraw](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabledraw), [EndModify](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#endmodify), [Export_ToParameters](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#export_toparameters), [FlipXY](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#flipxy), [GraphicallyInvalidate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#graphicallyinvalidate), [Handle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#handle), [Identifier](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#identifier), [InBoard](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#inboard), [InComponent](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#incomponent), [InCoordinate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#incoordinate), [Index](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#index), [InDimension](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#indimension), [InNet](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#innet), [InPolygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#inpolygon), [InSelectionMemory](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#inselectionmemory), [IsAssyTestPoint_Bottom](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#isassytestpoint_bottom), [IsAssyTestPoint_Top](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#isassytestpoint_top), [IsElectricalPrim](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#iselectricalprim), [IsFreePrimitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#isfreeprimitive), [IsHidden](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#ishidden), [IsKeepout](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#iskeepout), [IsPreRoute](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#ispreroute), [IsSaveable](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#issaveable), [IsTenting](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istenting), [IsTenting_Bottom](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istenting_bottom), [IsTenting_Top](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istenting_top), [IsTestPoint_Bottom](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istestpoint_bottom), [IsTestPoint_Top](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istestpoint_top), [Layer](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#layer), [MiscFlag1](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#miscflag1), [MiscFlag2](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#miscflag2), [MiscFlag3](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#miscflag3), [Moveable](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#moveable), [MoveByXY](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#movebyxy), [MoveToXY](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#movetoxy), [Net](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#net), [ObjectID](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#objectid), [ObjectIDString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#objectidstring), [PadCacheRobotFlag](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#padcacherobotflag), [PasteMaskExpansion](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#pastemaskexpansion), [Polygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#polygon), [PolygonOutline](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#polygonoutline), [PowerPlaneClearance](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#powerplaneclearance), [PowerPlaneConnectStyle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#powerplaneconnectstyle), [PowerPlaneReliefExpansion](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#powerplanereliefexpansion), [Preview](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#preview), [ReliefAirGap](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#reliefairgap), [ReliefConductorWidth](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#reliefconductorwidth), [ReliefEntries](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#reliefentries), [Replicate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#replicate), [RequiredParamterSpace](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#requiredparamterspace), [RotateBy](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#rotateby), [Selected](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#selected), [SolderMaskExpansion](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#soldermaskexpansion), [SwapLayerPairs](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#swaplayerpairs), [TearDrop](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#teardrop), [UnionIndex](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#unionindex), [UniqueId](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#uniqueid), [UniqueID](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#uniqueid-1), [Used](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#used), [UserRouted](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#userrouted), [V7Layer](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#v7layer), [ViewableObjectID](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#viewableobjectid)

## Returned by

[IPCB_BoardEx.GetVoidsOnPlaneLayer](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_BoardEx.md#getvoidsonplanelayer), [IPCB_Primitive.Polygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#polygon)

## Accepted by

[IPCB_ContourMaker.MakeContour_8](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker.md#makecontour_8), [IPCB_ContourMaker2.MakeContour_18](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker2.md#makecontour_18)
