IPCB_ContourUtilities interface
Geometry operations on contours and geometric polygons: union, intersection, difference and exclusive or, area, winding direction, point and overlap tests, splitting a polygon into its connected parts, and the union of many shapes at once.
public interface IPCB_ContourUtilities
Namespace: PCB · Assembly: Altium.SDK.Interfaces
Remarks
Get it with IPCB_ServerInterface.PCBContourUtilities, which returns the same shared object on every call.
The operations that produce a shape replace the content of a result polygon that the caller supplies; create an empty one with IPCB_ServerInterface.PCBGeometricPolygonFactory.
Methods
| Method | Returns | Description |
|---|---|---|
| ClipContourContour | void | Replaces a geometric polygon with the result of a set operation on two contours. |
| ClipSetContour | void | Replaces a geometric polygon with the result of a set operation on a geometric polygon and a contour. |
| ClipSetSet | void | Replaces a geometric polygon with the result of a set operation on two geometric polygons. |
| ContourArea | double | Returns the area enclosed by a contour, in square internal units; the same value as IPCB_Contour.Area. |
| ContourIsCW | bool | Returns true when the vertices of a contour run clockwise. |
| CreateInterfaceList | IInterfaceList | Returns a new empty list, for the list arguments of SplitIntoConnectedPolygons, UnionBatchSet and UnionBatchContour. |
| GeometricPolygonsTouch | bool | Returns true when the intersection of two geometric polygons is not empty. |
| PointInContour | bool | Returns true when a point lies inside a contour. |
| SplitIntoConnectedPolygons | void | Splits a geometric polygon into separate geometric polygons, one for each solid contour together with the holes inside it. |
| UnionBatchContour | void | Replaces a geometric polygon with the union of all contours in a list. |
| UnionBatchSet | void | Replaces a geometric polygon with the union of all geometric polygons in a list. |
ClipContourContour
Replaces a geometric polygon with the result of a set operation on two contours.
void ClipContourContour(TSetOperation argSetOperation, IPCB_Contour argContour, IPCB_Contour argBContour, IPCB_GeometricPolygon argResultPolygon);
void ClipContourContour(int argSetOperation, object argContour, object argBContour, object argResultPolygon);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argSetOperation | TSetOperation | value | The set operation: union, intersection, exclusive or, or difference (argContour minus argBContour). |
argContour | IPCB_Contour | value | The first contour. |
argBContour | IPCB_Contour | value | The second contour; for a difference, the contour that is subtracted. |
argResultPolygon | IPCB_GeometricPolygon | value | The geometric polygon that receives the result. |
Returns: nothing (void)
The first overload is an extension method of IPCB_ContourUtilitiesHelper (using PCB;) with typed parameters; the second is declared by the interface.
Each contour is taken as a solid contour (not a hole). The previous content of argResultPolygon is replaced.
ClipSetContour
Replaces a geometric polygon with the result of a set operation on a geometric polygon and a contour.
void ClipSetContour(TSetOperation argSetOperation, IPCB_GeometricPolygon argGeometricPolygon, IPCB_Contour argContour, IPCB_GeometricPolygon argResultPolygon);
void ClipSetContour(int argSetOperation, object argGeometricPolygon, object argContour, object argResultPolygon);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argSetOperation | TSetOperation | value | The set operation: union, intersection, exclusive or, or difference (argGeometricPolygon minus argContour). |
argGeometricPolygon | IPCB_GeometricPolygon | value | The first operand. |
argContour | IPCB_Contour | value | The second operand; for a difference, the contour that is subtracted. |
argResultPolygon | IPCB_GeometricPolygon | value | The geometric polygon that receives the result. |
Returns: nothing (void)
The first overload is an extension method of IPCB_ContourUtilitiesHelper (using PCB;) with typed parameters; the second is declared by the interface.
The contour is taken as a solid contour (not a hole). The previous content of argResultPolygon is replaced; argResultPolygon can be the same object as argGeometricPolygon.
ClipSetSet
Replaces a geometric polygon with the result of a set operation on two geometric polygons.
void ClipSetSet(TSetOperation argSetOperation, IPCB_GeometricPolygon argGeometricPolygon, IPCB_GeometricPolygon argBGeometricPolygon, IPCB_GeometricPolygon argResultPolygon);
void ClipSetSet(int argSetOperation, object argGeometricPolygon, object argBGeometricPolygon, object argResultPolygon);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argSetOperation | TSetOperation | value | The set operation: union, intersection, exclusive or, or difference (argGeometricPolygon minus argBGeometricPolygon). |
argGeometricPolygon | IPCB_GeometricPolygon | value | The first operand. |
argBGeometricPolygon | IPCB_GeometricPolygon | value | The second operand; for a difference, the polygon that is subtracted. |
argResultPolygon | IPCB_GeometricPolygon | value | The geometric polygon that receives the result. |
Returns: nothing (void)
The first overload is an extension method of IPCB_ContourUtilitiesHelper (using PCB;) with typed parameters; the second is declared by the interface.
The previous content of argResultPolygon is replaced. argResultPolygon can be the same object as one of the operands, for example to add shapes to a polygon one at a time.
ContourArea
Returns the area enclosed by a contour, in square internal units; the same value as IPCB_Contour.Area.
double ContourArea(IPCB_Contour argContour);
double ContourArea(object argContour);
| Parameter | Type | Passing |
|---|---|---|
argContour | IPCB_Contour | value |
Returns: double
The first overload is an extension method of IPCB_ContourUtilitiesHelper (using PCB;) with typed parameters; the second is declared by the interface.
The area is positive or zero whatever the direction of the vertices, and is rounded to a whole number. A contour with fewer than three vertices has an area of 0.
ContourIsCW
Returns true when the vertices of a contour run clockwise.
bool ContourIsCW(IPCB_Contour argContour);
bool ContourIsCW(object argContour);
| Parameter | Type | Passing |
|---|---|---|
argContour | IPCB_Contour | value |
Returns: bool
The first overload is an extension method of IPCB_ContourUtilitiesHelper (using PCB;) with typed parameters; the second is declared by the interface.
A contour with fewer than three vertices, or with an area of zero, returns false.
CreateInterfaceList
Returns a new empty list, for the list arguments of SplitIntoConnectedPolygons, UnionBatchSet and UnionBatchContour.
IInterfaceList CreateInterfaceList();
Returns: IInterfaceList
Extension method of IPCB_ContourUtilitiesHelper (using PCB;).
GeometricPolygonsTouch
Returns true when the intersection of two geometric polygons is not empty.
bool GeometricPolygonsTouch(IPCB_GeometricPolygon argGeometricPolygon, IPCB_GeometricPolygon argBGeometricPolygon);
bool GeometricPolygonsTouch(object argGeometricPolygon, object argBGeometricPolygon);
| Parameter | Type | Passing |
|---|---|---|
argGeometricPolygon | IPCB_GeometricPolygon | value |
argBGeometricPolygon | IPCB_GeometricPolygon | value |
Returns: bool
The first overload is an extension method of IPCB_ContourUtilitiesHelper (using PCB;) with typed parameters; the second is declared by the interface.
PointInContour
Returns true when a point lies inside a contour.
bool PointInContour(IPCB_Contour argContour, int argx, int argy);
bool PointInContour(object argContour, int argx, int argy);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argContour | IPCB_Contour | value | The contour to test. |
argx | int | value | The X coordinate of the point, in internal units (10,000 per mil). |
argy | int | value | The Y coordinate of the point, in internal units (10,000 per mil). |
Returns: bool
The first overload is an extension method of IPCB_ContourUtilitiesHelper (using PCB;) with typed parameters; the second is declared by the interface.
SplitIntoConnectedPolygons
Splits a geometric polygon into separate geometric polygons, one for each solid contour together with the holes inside it.
void SplitIntoConnectedPolygons(IPCB_GeometricPolygon argGeometricPolygon, IInterfaceList argConnectedPolygons);
void SplitIntoConnectedPolygons(object argGeometricPolygon, object argConnectedPolygons);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argGeometricPolygon | IPCB_GeometricPolygon | value | The polygon to split. |
argConnectedPolygons | IInterfaceList | value | The list that receives the new IPCB_GeometricPolygon objects, for example one returned by CreateInterfaceList. |
Returns: nothing (void)
The first overload is an extension method of IPCB_ContourUtilitiesHelper (using PCB;) with typed parameters; the second is declared by the interface.
A hole goes with the smallest solid contour that contains its first vertex; a hole that lies inside no solid contour is left out. The new polygons have their own copies of the vertices and are appended to argConnectedPolygons; items already in the list stay. Does nothing when either argument is null.
UnionBatchContour
Replaces a geometric polygon with the union of all contours in a list.
void UnionBatchContour(IInterfaceList argContours, IPCB_GeometricPolygon argResultPolygon);
void UnionBatchContour(object argContours, object argResultPolygon);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argContours | IInterfaceList | value | The IPCB_Contour objects to unite, for example in a list returned by CreateInterfaceList. |
argResultPolygon | IPCB_GeometricPolygon | value | The geometric polygon that receives the result. |
Returns: nothing (void)
The first overload is an extension method of IPCB_ContourUtilitiesHelper (using PCB;) with typed parameters; the second is declared by the interface.
Each contour is taken as a solid contour (not a hole). Items that are not contours are ignored; when the list holds no contour, argResultPolygon becomes empty. Does nothing when either argument is null.
UnionBatchSet
Replaces a geometric polygon with the union of all geometric polygons in a list.
void UnionBatchSet(IInterfaceList argPolygons, IPCB_GeometricPolygon argResultPolygon);
void UnionBatchSet(object argPolygons, object argResultPolygon);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argPolygons | IInterfaceList | value | The IPCB_GeometricPolygon objects to unite, for example in a list returned by CreateInterfaceList. |
argResultPolygon | IPCB_GeometricPolygon | value | The geometric polygon that receives the result. |
Returns: nothing (void)
The first overload is an extension method of IPCB_ContourUtilitiesHelper (using PCB;) with typed parameters; the second is declared by the interface.
Items that are not geometric polygons are ignored; when the list holds no geometric polygon, argResultPolygon becomes empty. Does nothing when either argument is null.