Child Space Coordinate System in VisionPro ShapesCognex VisionPro

This topic contains the following sections.

Every VisionPro shape has a special coordinate space named $ which is used to draw the shape's Children. In most cases the children of a shape are the interactive handles used to manipulate the shape when it is in Interactive mode. VisionPro uses this coordinate system to make sure that the handles appear in the right place on the shape even if it has been rotated or skewed. You can use this coordinate system yourself to locate points relative to a shape.

Child Space Coordinate Systems for Each Shape

In general, the child space coordinate system for each shape represents the shape in its simplest form. For lines and rectangular shapes, the child space is a unit square; for circular and elliptical shapes, the child space is a unit circle. To draw into a shape's child space, set the selected space name to $. You can use GetParentFromChildTransform to obtain a CogTransform2D that you can use to map from the child space to any other space.

Table 1. Child space coordinate systems
ShapeChild space coordinate system

CogLineSegment

Unit square such that (0,0) maps to (StartX,StartY) and (1,0) maps to (EndX,EndY)

X- and y-units scale uniformly. The child space has the same handedness as the shape, but may be rotated.

CogCoordinateAxes

The child space point (1,0) maps to the end point of the x-axis; the point (0,1) maps to the end-point of the y-axis. The child space point (0,0) maps to (OriginX,OriginY).

CogRectangleUnit square such that (0,0) maps to (X,Y) and (1,1) maps to (X+Width,Y+Height)
CogRectangleAffineUnit square such that (0,0) maps to (CornerOriginX,CornerOriginY) and (1,1) maps to (CornerOppositeX,CornerOppositeY)
CogLineSame as parent coordinate space with (0,0) mapped to (X,Y)
CogGraphicLabelSame as parent coordinate space with (0,0) mapped to (X,Y)
CogPointMarkerSame as parent coordinate space with (0,0) mapped to (X,Y)
CogPolygonSame as parent coordinate space with (0,0) mapped to (X,Y) of GetVertex
CogCircleUnit circle in which (0,0) maps to (CenterX,CenterY) and (1,1) maps to (CenterX+Radius,CenterY+Radius)
CogCircularArcUnit circle in which (0,0) maps to (CenterX,CenterY) and (1,1) maps to (CenterX+Radius,CenterY+Radius)
CogCircularAnnulusSectionUnit circle in which (0,0) maps to (CenterX,CenterY) and (1,1) maps to (CenterX+Radius,CenterY+Radius)
CogEllipseUnit circle in which (0,0) maps to (CenterX,CenterY) and (1,1) maps to (CenterX+RadiusX,CenterY+RadiusY)
CogEllipticalArcUnit circle in which (0,0) maps to (CenterX,CenterY) and (1,1) maps to (CenterX+RadiusX,CenterY+RadiusY)
CogEllipticalAnnulusSectionUnit circle in which (0,0) maps to (CenterX,CenterY) and (1,1) maps to (CenterX+RadiusX,CenterY+RadiusY)