
# IPCB_GeometricPolygon interface

A shape made of an ordered list of contours, each of which is either a solid outline or a hole.

```csharp
public interface IPCB_GeometricPolygon
```

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

## Remarks

An empty geometric polygon is created with [`IPCB_ServerInterface.PCBGeometricPolygonFactory`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ServerInterface.md#pcbgeometricpolygonfactory). The vertices of its contours are in internal units (10,000 per mil).

Adding a contour copies its vertices into the polygon: changing the added contour afterwards does not change the polygon. To change a contour of the polygon, get it with `Contour`.

## Properties

| Property | Type | Access | Description |
| --- | --- | --- | --- |
| [Area](#area) | `double` | get | The area of the polygon, in square internal units. |
| [Contour](#contour) | [IPCB_Contour](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Contour.md) | get | Returns a contour of the polygon. |
| [Count](#count) | `int` | get | The number of contours in the polygon, holes included. |
| [IsHole](#ishole) | `bool` | get; set | Whether a contour of the polygon is a hole rather than a solid contour. |

### Area

The area of the polygon, in square internal units.

```csharp
double GetState_Area();
```

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

The value is the sum of the areas of the solid contours minus the sum of the areas of the holes.

### Contour

Returns a contour of the polygon.

```csharp
IPCB_Contour GetState_Contour(int argI);
```

**Type:** [IPCB_Contour](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Contour.md) · **Access:** read-only · **Index:** `argI` (`int`): The zero-based index of the contour.

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

The returned contour refers to the vertices of the polygon: changing it changes the polygon. It is valid only until another contour is added to the polygon. Returns null when the index is outside 0 to `Count` - 1.

### Count

The number of contours in the polygon, holes included.

```csharp
int GetState_Count();
```

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

### IsHole

Whether a contour of the polygon is a hole rather than a solid contour.

```csharp
bool GetState_IsHole(int argI);
void SetState_IsHole(int argI, bool argValue);
```

**Type:** `bool` · **Access:** read/write · **Index:** `argI` (`int`): The zero-based index of the contour, from 0 to `Count` - 1.

Assigning the value changes whether the contour is a hole.

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [AddContour](#addcontour) | [IPCB_Contour](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Contour.md) | Appends a copy of a contour to the polygon as a solid contour (not a hole), and returns the contour that was passed. |
| [AddContourIsHole](#addcontourishole) | [IPCB_Contour](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Contour.md) | Appends a copy of a contour to the polygon as a solid contour or a hole, and returns the contour that was passed. |
| [AddEmptyContour](#addemptycontour) | [IPCB_Contour](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Contour.md) | Appends an empty solid contour (not a hole) to the polygon. |
| [Replicate](#replicate) | [IPCB_GeometricPolygon](#) | Returns an independent copy of the polygon with all its contours and their hole flags; changing the copy does not change the original, and the reverse. |

### AddContour

Appends a copy of a contour to the polygon as a solid contour (not a hole), and returns the contour that was passed.

```csharp
IPCB_Contour AddContour(IPCB_Contour argContour);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argContour` | [IPCB_Contour](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Contour.md) | value | The contour whose vertices are copied. When it is null, an empty contour is added. |

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

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

The same as [`AddContourIsHole`](#addcontourishole) with `argIsHole` false. The returned contour is not part of the polygon; use `Contour` to reach the polygon's copy.

### AddContourIsHole

Appends a copy of a contour to the polygon as a solid contour or a hole, and returns the contour that was passed.

```csharp
IPCB_Contour AddContourIsHole(IPCB_Contour argContour, bool argIsHole);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argContour` | [IPCB_Contour](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Contour.md) | value | The contour whose vertices are copied. When it is null, an empty contour is added. |
| `argIsHole` | `bool` | value | True to add the contour as a hole, false to add it as a solid contour. |

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

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

When `argContour` is null, a new empty contour is returned. The returned contour is not part of the polygon; use `Contour` to reach the polygon's copy.

### AddEmptyContour

Appends an empty solid contour (not a hole) to the polygon.

```csharp
IPCB_Contour AddEmptyContour();
```

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

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

The returned contour is not part of the polygon: adding vertices to it does not change the polygon. To add vertices to the new contour, get it with `Contour` at index `Count` - 1.

### Replicate

Returns an independent copy of the polygon with all its contours and their hole flags; changing the copy does not change the original, and the reverse.

```csharp
IPCB_GeometricPolygon Replicate();
```

**Returns:** [IPCB_GeometricPolygon](#)

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

## Returned by

[IPCB_BoardOutline.BoardOutline_GeometricPolygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_BoardOutline.md#boardoutline_geometricpolygon), [IPCB_BoardOutline.BuildFromObjects_ReturnGeometricPolygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_BoardOutline.md#buildfromobjects_returngeometricpolygon), [IPCB_ContourMaker.MakeContour](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker.md#makecontour), [IPCB_ContourMaker.MakeContour_1](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker.md#makecontour_1), [IPCB_ContourMaker.MakeContour_2](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker.md#makecontour_2), [IPCB_ContourMaker.MakeContour_3](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker.md#makecontour_3), [IPCB_ContourMaker.MakeContour_4](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker.md#makecontour_4), [IPCB_ContourMaker.MakeContour_5](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker.md#makecontour_5), [IPCB_ContourMaker.MakeContour_6](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker.md#makecontour_6), [IPCB_ContourMaker.MakeContour_7](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker.md#makecontour_7), [IPCB_ContourMaker.MakeContour_8](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker.md#makecontour_8), [IPCB_ContourMaker.MakeContour_9](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker.md#makecontour_9), [IPCB_ContourMaker2.MakeContour_10](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker2.md#makecontour_10), [IPCB_ContourMaker2.MakeContour_11](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker2.md#makecontour_11), [IPCB_ContourMaker2.MakeContour_12](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker2.md#makecontour_12), [IPCB_ContourMaker2.MakeContour_13](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker2.md#makecontour_13), [IPCB_ContourMaker2.MakeContour_14](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker2.md#makecontour_14), [IPCB_ContourMaker2.MakeContour_15](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker2.md#makecontour_15), [IPCB_ContourMaker2.MakeContour_16](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker2.md#makecontour_16), [IPCB_ContourMaker2.MakeContour_17](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker2.md#makecontour_17), [IPCB_ContourMaker2.MakeContour_18](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker2.md#makecontour_18), [IPCB_ContourMaker2.MakeContour_19](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker2.md#makecontour_19), [IPCB_MaskHelper.GenerateMaskPolygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_MaskHelper.md#generatemaskpolygon), [IPCB_Region.GeometricPolygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Region.md#geometricpolygon), [IPCB_ServerInterface.PCBGeometricPolygonFactory](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ServerInterface.md#pcbgeometricpolygonfactory), [IPCB_Text.GetTrueTypeTextOutlineGeometricPolygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Text.md#gettruetypetextoutlinegeometricpolygon), [IPCB_Text.GetTrueTypeTextOutlineGeometricPolygon_1](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Text.md#gettruetypetextoutlinegeometricpolygon_1)

## Accepted by

[IPCB_ContourUtilities.ClipContourContour](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourUtilities.md#clipcontourcontour), [IPCB_ContourUtilities.ClipSetContour](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourUtilities.md#clipsetcontour), [IPCB_ContourUtilities.ClipSetSet](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourUtilities.md#clipsetset), [IPCB_ContourUtilities.GeometricPolygonsTouch](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourUtilities.md#geometricpolygonstouch), [IPCB_ContourUtilities.SplitIntoConnectedPolygons](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourUtilities.md#splitintoconnectedpolygons), [IPCB_ContourUtilities.UnionBatchContour](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourUtilities.md#unionbatchcontour), [IPCB_ContourUtilities.UnionBatchSet](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourUtilities.md#unionbatchset), [IPCB_MaskHelper.GenerateMaskPolygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_MaskHelper.md#generatemaskpolygon)
