Table of Contents

Class DxfRegionShape

Namespace
GeometryHelper.Dxf
Assembly
GeometryHelper.dll

The shape of a planar REGION: the loops that bound its faces, outer loops and holes, with the area and the perimeter AutoCAD's Region gives for it.

public sealed class DxfRegionShape
Inheritance
DxfRegionShape
Inherited Members

Remarks

A box 40 by 30 with a circular hole of radius 5 in its middle has two loops, the circle first, a hole, then the box, and area 1 121.46 (1 200 less 78.54) and perimeter 171.42 (140 and 31.42). Create(IEnumerable<DxfCurve>, IEnumerable<IEnumerable<DxfCurve>>, Tolerance) makes the shape of closed loops of lines, arcs, circles, ellipses and polylines with bulges; GetRegionShape() reads the shape of a REGION that AutoCAD or this library wrote, and CreateRegion(DxfRegionShape, DxfDatabase) makes a REGION of one.

A region of AutoCAD whose ACIS body holds a face that is not flat, or an edge that is a spline, has no shape here.

Properties

Area

Gets the area of the region: that of its outer loops less that of its holes, as AutoCAD's Region.Area.

Loops

Gets the loops of every face, the holes of a face before its outer loop.

Normal

Gets the unit normal of the plane of the first face, as AutoCAD's Region.Normal: (0, 0, 1) for a region lying flat on the XY plane.

Perimeter

Gets the perimeter of the region: the length of every loop, holes too, as AutoCAD's Region.Perimeter.

Methods

Create(IEnumerable<DxfCurve>, IEnumerable<IEnumerable<DxfCurve>>, Tolerance)

Makes the shape of one flat face from the curves of its outer loop and of each hole. The curves of a loop may come in any order and any way round, the lines and arcs of a loop joining end to end within the point tolerance; a circle, a whole ellipse or a closed polyline is a loop of itself. The outer loop is made to run counter-clockwise about the normal of its plane (+Z for a loop that lies flat on the XY plane) and a hole clockwise.

Intersect(IEnumerable<DxfRegionShape>, Tolerance)

Gets what every one of the shapes covers: a circle of radius 10 about (0, 0) and one about (10, 0) have a lens of area 122.84 and perimeter 41.89, two arcs.

IsCoplanarWith(DxfRegionShape, Tolerance)

Gets whether every edge of the shape lies in the plane of the first face of another, within the point tolerance.

Subtract(IEnumerable<DxfRegionShape>, IEnumerable<DxfRegionShape>, Tolerance)

Gets what the shapes cover less what the tools cover: a box 40 by 30 less a circle of radius 10 centred on its right edge has area 1 042.92 and perimeter 151.42, the circle a notch of one arc in the right side; less a circle of radius 5 inside it, a face of two loops, the circle a hole.

Unite(IEnumerable<DxfRegionShape>, Tolerance)

Gets what any of the shapes covers: a box 40 by 30 and a circle of radius 10 centred on its right edge give a shape of area 1 357.08 whose one loop is five lines and a half circle, the circle still a circle.