Table of Contents

Class DxfSpatialFilter

Namespace
GeometryHelper.Dxf
Assembly
GeometryHelper.dll

The clip boundary of a block reference or an external reference, as AutoCAD's XCLIP keeps it: a SPATIAL_FILTER in the dictionary ACAD_FILTER of the reference's extension dictionary, under the name SPATIAL. Reached by SpatialFilter; made by ClipTo(IReadOnlyList<GeoPoint2>, GeoTransform3).

public sealed class DxfSpatialFilter : DxfDBObject
Inheritance
DxfSpatialFilter
Inherited Members

Remarks

The boundary is a list of points in the clip coordinate system, the user coordinate system that was current when it was made: two points are a rectangle's opposite corners, three or more a polygon. WorldToClip carries a point of the world into that system, and InverseBlockTransform a point of the world into the block's own coordinates, measured from its origin, as the reference stood when it was clipped. Both are kept with the boundary, and the reference moved, turned or scaled afterwards leaves them as they are, so that the clip goes with the content: a block 100 by 100 inserted at (1000, 500) and clipped to the rectangle (1020, 520) to (1100, 600) still shows its corner 20 by 20 in from its lower left, in whatever place it is moved to.

A clip turned inside out (XCLIP Invert) is kept as AutoCAD keeps it: a polygon that goes round the outside of the block and in along a slit to the boundary and round that, so that what the polygon holds is the part cut away.

Properties

BackClip

Gets or sets the distance of the back clipping plane from the boundary plane (groups 73 and 41), as XCLIP's Clipdepth back sets it; null where there is none.

FrontClip

Gets or sets the distance of the front clipping plane from the boundary plane (groups 72 and 40), as XCLIP's Clipdepth front sets it; null where there is none.

InverseBlockTransform

Gets the 3 by 4 matrix, row by row, that carries a point of the world into the block's own coordinates measured from its origin, as the reference stood when it was clipped (the first twelve groups 40).

IsEnabled

Gets or sets whether the clip is on (group 71), as XCLIP's ON and OFF: off, the block or reference is shown whole and the boundary kept.

Normal

Gets the direction the clip coordinate system looks along (group 210): its Z axis in the world.

Origin

Gets the origin of the clip coordinate system in the world (group 11).

Points

Gets the points of the boundary in the clip coordinate system (groups 10 and 20 of 70 of them): two for a rectangle, its opposite corners, three or more for a polygon.

WorldToClip

Gets the 3 by 4 matrix, row by row, that carries a point of the world into the clip coordinate system (the second twelve groups 40).

Methods

Erase()

Erases the filter, as AutoCAD's Erase: it is taken out of the file, with the entry of the dictionary that names it.

GetRing()

Gets the boundary as a ring of points in the block's own coordinates measured from its origin: its points taken out of the clip coordinate system into the world and from there into the block, a rectangle's two corners made the four of a ring. Fewer than three points give none.

ToString()

Gives the filter as a line for debugging: its type, its handle and how many points its boundary has.