Skip to main content
View as Markdown

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​

MethodReturnsDescription
ClipContourContourvoidReplaces a geometric polygon with the result of a set operation on two contours.
ClipSetContourvoidReplaces a geometric polygon with the result of a set operation on a geometric polygon and a contour.
ClipSetSetvoidReplaces a geometric polygon with the result of a set operation on two geometric polygons.
ContourAreadoubleReturns the area enclosed by a contour, in square internal units; the same value as IPCB_Contour.Area.
ContourIsCWboolReturns true when the vertices of a contour run clockwise.
CreateInterfaceListIInterfaceListReturns a new empty list, for the list arguments of SplitIntoConnectedPolygons, UnionBatchSet and UnionBatchContour.
GeometricPolygonsTouchboolReturns true when the intersection of two geometric polygons is not empty.
PointInContourboolReturns true when a point lies inside a contour.
SplitIntoConnectedPolygonsvoidSplits a geometric polygon into separate geometric polygons, one for each solid contour together with the holes inside it.
UnionBatchContourvoidReplaces a geometric polygon with the union of all contours in a list.
UnionBatchSetvoidReplaces 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);
ParameterTypePassingDescription
argSetOperationTSetOperationvalueThe set operation: union, intersection, exclusive or, or difference (argContour minus argBContour).
argContourIPCB_ContourvalueThe first contour.
argBContourIPCB_ContourvalueThe second contour; for a difference, the contour that is subtracted.
argResultPolygonIPCB_GeometricPolygonvalueThe 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);
ParameterTypePassingDescription
argSetOperationTSetOperationvalueThe set operation: union, intersection, exclusive or, or difference (argGeometricPolygon minus argContour).
argGeometricPolygonIPCB_GeometricPolygonvalueThe first operand.
argContourIPCB_ContourvalueThe second operand; for a difference, the contour that is subtracted.
argResultPolygonIPCB_GeometricPolygonvalueThe 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);
ParameterTypePassingDescription
argSetOperationTSetOperationvalueThe set operation: union, intersection, exclusive or, or difference (argGeometricPolygon minus argBGeometricPolygon).
argGeometricPolygonIPCB_GeometricPolygonvalueThe first operand.
argBGeometricPolygonIPCB_GeometricPolygonvalueThe second operand; for a difference, the polygon that is subtracted.
argResultPolygonIPCB_GeometricPolygonvalueThe 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);
ParameterTypePassing
argContourIPCB_Contourvalue

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);
ParameterTypePassing
argContourIPCB_Contourvalue

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);
ParameterTypePassing
argGeometricPolygonIPCB_GeometricPolygonvalue
argBGeometricPolygonIPCB_GeometricPolygonvalue

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);
ParameterTypePassingDescription
argContourIPCB_ContourvalueThe contour to test.
argxintvalueThe X coordinate of the point, in internal units (10,000 per mil).
argyintvalueThe 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);
ParameterTypePassingDescription
argGeometricPolygonIPCB_GeometricPolygonvalueThe polygon to split.
argConnectedPolygonsIInterfaceListvalueThe 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);
ParameterTypePassingDescription
argContoursIInterfaceListvalueThe IPCB_Contour objects to unite, for example in a list returned by CreateInterfaceList.
argResultPolygonIPCB_GeometricPolygonvalueThe 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);
ParameterTypePassingDescription
argPolygonsIInterfaceListvalueThe IPCB_GeometricPolygon objects to unite, for example in a list returned by CreateInterfaceList.
argResultPolygonIPCB_GeometricPolygonvalueThe 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.

Returned by​

IPCB_ServerInterface.PCBContourUtilities