Table of Contents

Method IsClosed

Namespace
GeometryHelper.Geometry
Assembly
GeometryHelper.dll

IsClosed()

Checks whether the boundary closes without gaps, using the default tolerance.

public bool IsClosed()

Returns

bool

IsClosed(Tolerance)

Checks whether the boundary closes without gaps, within a tolerance.

public bool IsClosed(Tolerance tolerance)

Parameters

tolerance Tolerance

Returns

bool

Remarks

A closed surface has every stretch of every edge shared by an even number of faces. One face on a stretch is an open rim and three are a fin standing off the surface; two close it, and so do four where two blocks meet along an edge — watertight, and measuring and holding points as they should. Hole rims count as edges like any other, since in a closed body they are shared with the surface lining the cavity behind them.

The edges are matched as Validate(Tolerance) matches them, so the two agree on every body but a speck: by overlap along a line within the tolerance, stretch by stretch, so that a long edge beside two short ones, which merging coplanar faces and the booleans both leave behind, is matched stretch by stretch; two copies of an edge whose ends lie within the tolerance of each other are matched however little of them lies along the other, the one no longer than the tolerance kept with the other where its own loop has an edge longer than the tolerance, and left out, as every edge that short is otherwise, where it is a speck's; and a body whose edges pair to a sixty-fourth of the tolerance is settled on a grid, in time linear in its corners. A body with no edge longer than the tolerance, a speck, is not closed here, where Validate, finding no stretch open, calls it closed and not valid, enclosing nothing.

A gap no wider than the point tolerance mostly reads closed and a wider one open: a cube of 100 whose top stands 0.0005 over the tops of its sides is closed within a thousandth, placed anywhere, and one whose top stands 0.0015 over them is open. A gap of a thousandth is so to a few bits either way, 100.001 less 100 being 0.001 000 000 000 004 8, and reads as the rounding has it. Edges matched along one line are matched one after another, so a gap wider than the tolerance is closed where other edges lie in it within the tolerance of either side: that cube with a box of 1 standing against each of its sides half way up the gap reads closed, and valid, though its top stands 0.0015 clear of its sides. So too a short copy of a side of a hole, kept with it, cuts the open side into stretches no longer than the tolerance: a speck in each side of a hole 0.0019 across keeps none of its edges and leaves the hole open, but a sliver face with an edge longer than the tolerance lying across such a side can still hide it. Below the rounding of the coordinates, a quadrillionth of the largest of the whole body's, not of each part, the edges are matched within that rounding, so that at a tolerance of nought a cube turned in space, and the union of two such boxes made within a thousandth, are closed.

The booleans, the weld, the cutting and TryGetVolume(out double, Tolerance) read the bodies they work on otherwise, the ends of the edges matched first and within the tolerance given, as this did: two corners 0.0015 apart were one where a corner lay between them, and with a speck of a face at each corner of that top half way up the cube read closed, and open with the specks given last. What a boolean makes is taken as closed where the tolerance given, unraised, reads it closed along lines, so that the two differ on a body closed only to the rounding or by twin edges no longer than about the tolerance. Mesh3 cuts into cells only a body closed both ways.