CogGeneralContour AddEllipticalArcSegment Method Cognex VisionPro 9.8
Adds an elliptical arc segment before NextSegment. If NextSegment is Nothing, the new segment is added at the end of the contour. If StartFlags has the 'connected' bit set, then StartX and StartY are ignored. This also applies to EndFlags.

Namespace: Cognex.VisionPro
Assembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 75.1.0.0
Syntax

public void AddEllipticalArcSegment(
	CogGeneralContourSegmentIterator nextSegment,
	CogGeneralContourVertexConstants startFlags,
	double startX,
	double startY,
	double midpointX,
	double midpointY,
	CogGeneralContourVertexConstants endFlags,
	double endX,
	double endY,
	double ellipseFraction
)

Parameters

nextSegment
Type: Cognex.VisionPro CogGeneralContourSegmentIterator

The segment that follows the new segment. If this value is Nothing, the new segment is added at the end of the contour shape.

startFlags
Type: Cognex.VisionPro CogGeneralContourVertexConstants

Flags that specify how the start point is treated with respect to the other segments in the contour shape.

startX
Type: System Double

X-coordinate of the start point of the segment. Ignored if startFlags includes Connected.

startY
Type: System Double

Y-coordinate of the start point of the segment. Ignored if startFlags includes Connected.

midpointX
Type: System Double

X-coordinate of the midpoint of the elliptical arc segment.

midpointY
Type: System Double

Y-coordinate of the midpoint of the elliptical arc segment.

endFlags
Type: Cognex.VisionPro CogGeneralContourVertexConstants

Flags that specify how the end point is treated with respect to the other segments in the contour shape.

endX
Type: System Double

X-coordinate of the end point of the segment. Ignored if endFlags includes Connected.

endY
Type: System Double

Y-coordinate of the end point of the segment. Ignored if endFlags includes Connected.

ellipseFraction
Type: System Double

The fraction of the ellipse that passes through the start, mid-, and end points. For slight arcs, using roughly a quarter of the ellipse usually provides good results. This value must be greater than 0 and less than 1

Events

Event TypeReason
CogGeneralContour Changed

Fires when the segment is added.

The following state flags may be affected:

    Exceptions

    ExceptionCondition
    CogShapeAddWontBreakContourException

    nextSegment is already connected at Start or nextSegment is closed at Start and endFlags indicates that the new segment should be connected there.

    CogShapeBadContourSegConnException

    nextSegment is the first segment and startFlags includes Connected or nextSegment is the end segment (or Nothing) and endFlags includes Connected.

    ArgumentException

    startFlags or endFlags include bits that are not defined in CogGeneralContourVertexConstants.

    ArgumentException

    EllipseFraction is < 0 or > 1.

    CogShapeCoordinatesMustDifferException

    Points in the new segment are coincident.

    CogIteratorInvalidIteratorException

    nextSegment is not Nothing, not a valid iterator, and is not the end iterator.

    CogShapeBadContourChainClosureException

    endFlags include Closed but startFlags do not include Connected ; or startFlags include Closed but endFlags do not include Connected.

    CogShapeDegenerateEllipticalArcSegException

    Points on the elliptical arc segment are colinear.

    Remarks

    Adds a new elliptical arc segment with the specified start and end points before nextSegment. The startFlags and endFlags specify how the end points of the elliptical arc segment are connected to the rest of the contour shape. After adding the new elliptical arc segment, all CogGeneralContourSegmentIterator positioned at or after nextSegment are updated so that they continue to refer to the same segment as before calling AddEllipticalArcSegment(CogGeneralContourSegmentIterator, CogGeneralContourVertexConstants, Double, Double, Double, Double, CogGeneralContourVertexConstants, Double, Double, Double).

    If nextSegment is Nothing, the new segment is added at the end of the contour, so endFlags cannot include Connected. If nextSegment is the first segment, the new segment is added at the beginning of the contour, so startFlags cannot include Connected

    If startFlags includes Connected, then startX and startY are ignored. Similarly, if endFlags includes Connected, then endX and endY are ignored.

    Note: AddEllipticalArcSegment(CogGeneralContourSegmentIterator, CogGeneralContourVertexConstants, Double, Double, Double, Double, CogGeneralContourVertexConstants, Double, Double, Double) never breaks connections or closure, and it never modifies the coordinates of segments that exist before the call.

    See Also