Table of Contents

Method SetClipBoundary

Namespace
GeometryHelper.Dxf
Assembly
GeometryHelper.dll

SetClipBoundary(DxfClipBoundaryType, IReadOnlyList<GeoPoint2>)

Clips the image by a boundary, as AutoCAD's SetClipBoundary: a rectangle given by its five corners, the first again at the end, written as the first and the third, as AutoCAD 2021 writes it; a polygon of three corners or more, its first again at the end, written as given, the last as the first. The boundary is in pixels, counted from the centre of the top left pixel with y down, and may cross itself or leave the image, as AutoCAD takes it; its record is said to be clipped (280 of 1). IsClipped is left as it is: the image clips by the boundary where it is on, as AutoCAD sets it on every new image.

public void SetClipBoundary(DxfClipBoundaryType type, IReadOnlyList<GeoPoint2> clipBoundaryVertices)

Parameters

type DxfClipBoundaryType

The kind of boundary, a rectangle or a polygon.

clipBoundaryVertices IReadOnlyList<GeoPoint2>

The corners, in pixels.

Remarks

The picture of 4 by 3 pixels 10 apart placed at (10, 20), clipped by the rectangle (0.5, 0.5), (0.5, 1.5), (2.5, 1.5), (2.5, 0.5), (0.5, 0.5), shows the rectangle from (20, 30, 0) to (40, 40, 0). AutoCAD 2021 refuses a rectangle of two corners or four, and a boundary not closed by its first corner to its rounding, which the library closes where the last corner is within the point tolerance of Default of the first in the world, 0.001 whatever the size of a pixel: on a wipeout's frame of 10 000, a corner 0.0009 of the frame off, 9 away, is not.

Exceptions

ArgumentNullException

Thrown when the corners are null.

ArgumentException

Thrown when the kind is neither, a corner is not of finite numbers, the last is not the first, a rectangle is not of five corners or a polygon of four or more, as AutoCAD answers eInvalidInput.

InvalidOperationException

Thrown when the image is erased.