IPCB_GeometricPolygon interface
A shape made of an ordered list of contours, each of which is either a solid outline or a hole.
public interface IPCB_GeometricPolygon
Namespace: PCB · Assembly: Altium.SDK.Interfaces
Remarks
An empty geometric polygon is created with IPCB_ServerInterface.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 | double | get | The area of the polygon, in square internal units. |
| Contour | IPCB_Contour | get | Returns a contour of the polygon. |
| Count | int | get | The number of contours in the polygon, holes included. |
| 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.
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.
IPCB_Contour GetState_Contour(int argI);
Type: IPCB_Contour · 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.
int GetState_Count();
Type: int · Access: read-only
IsHole
Whether a contour of the polygon is a hole rather than a solid contour.
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 | IPCB_Contour | Appends a copy of a contour to the polygon as a solid contour (not a hole), and returns the contour that was passed. |
| AddContourIsHole | IPCB_Contour | Appends a copy of a contour to the polygon as a solid contour or a hole, and returns the contour that was passed. |
| AddEmptyContour | IPCB_Contour | Appends an empty solid contour (not a hole) to the polygon. |
| 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.
IPCB_Contour AddContour(IPCB_Contour argContour);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argContour | IPCB_Contour | value | The contour whose vertices are copied. When it is null, an empty contour is added. |
Returns: IPCB_Contour
Extension method of IPCB_GeometricPolygonHelper (using PCB;).
The same as 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.
IPCB_Contour AddContourIsHole(IPCB_Contour argContour, bool argIsHole);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argContour | IPCB_Contour | 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
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.
IPCB_Contour AddEmptyContour();
Returns: IPCB_Contour
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.
IPCB_GeometricPolygon Replicate();
Returns: IPCB_GeometricPolygon
Extension method of IPCB_GeometricPolygonHelper (using PCB;).
Returned by
IPCB_BoardOutline.BoardOutline_GeometricPolygon, IPCB_BoardOutline.BuildFromObjects_ReturnGeometricPolygon, IPCB_ContourMaker.MakeContour, IPCB_ContourMaker.MakeContour_1, IPCB_ContourMaker.MakeContour_2, IPCB_ContourMaker.MakeContour_3, IPCB_ContourMaker.MakeContour_4, IPCB_ContourMaker.MakeContour_5, IPCB_ContourMaker.MakeContour_6, IPCB_ContourMaker.MakeContour_7, IPCB_ContourMaker.MakeContour_8, IPCB_ContourMaker.MakeContour_9, IPCB_ContourMaker2.MakeContour_10, IPCB_ContourMaker2.MakeContour_11, IPCB_ContourMaker2.MakeContour_12, IPCB_ContourMaker2.MakeContour_13, IPCB_ContourMaker2.MakeContour_14, IPCB_ContourMaker2.MakeContour_15, IPCB_ContourMaker2.MakeContour_16, IPCB_ContourMaker2.MakeContour_17, IPCB_ContourMaker2.MakeContour_18, IPCB_ContourMaker2.MakeContour_19, IPCB_MaskHelper.GenerateMaskPolygon, IPCB_Region.GeometricPolygon, IPCB_ServerInterface.PCBGeometricPolygonFactory, IPCB_Text.GetTrueTypeTextOutlineGeometricPolygon, IPCB_Text.GetTrueTypeTextOutlineGeometricPolygon_1
Accepted by
IPCB_ContourUtilities.ClipContourContour, IPCB_ContourUtilities.ClipSetContour, IPCB_ContourUtilities.ClipSetSet, IPCB_ContourUtilities.GeometricPolygonsTouch, IPCB_ContourUtilities.SplitIntoConnectedPolygons, IPCB_ContourUtilities.UnionBatchContour, IPCB_ContourUtilities.UnionBatchSet, IPCB_MaskHelper.GenerateMaskPolygon