Method TryCutOpenings
- Namespace
- GeometryHelper.Geometry
- Assembly
- GeometryHelper.dll
TryCutOpenings(out GeoSolid3)
Cuts every opening into this body, giving one without openings whose faces are the surface of its material.
public bool TryCutOpenings(out GeoSolid3 material)
Parameters
materialGeoSolid3
Returns
TryCutOpenings(out GeoSolid3, Tolerance)
Cuts every opening into this body, giving one without openings whose faces are the surface of its material, within a tolerance.
public bool TryCutOpenings(out GeoSolid3 material, Tolerance tolerance)
Parameters
materialGeoSolid3The body with its openings cut in, or this body when it has none; null when the method returns false.
toleranceToleranceThe tolerance.
Returns
- bool
true when some material is left; false when the openings take all of it, or when the cut cannot be worked out, or will not close, which is logged.
Remarks
Every question this library asks of a body takes its openings into account already. Cutting them in is for a body that will be asked many questions: the queries that need it do the cutting each time, of the openings near the question, and a caller checking one plate against a hundred bolts is better off cutting the plate once and asking the result — the same bargain as BuildIndex(). The body keeps only the cut its measures take, GetVolume(Tolerance) and the rest.
The answer is the body's material, closed as Validate(Tolerance) reads it where the body and its openings are: an opening drawn past a face, as a through hole usually is, takes off only what lies in the body. The openings are cut in at once; where that leaves the material open it is welded within the tolerance, or failing that the openings are taken out one at a time by a difference. They are taken out so too where a plane of an opening runs through the body and will not cut it, leaving a piece part in the opening and part out of it, which cut in at once would be kept or dropped whole. Cut in together, each opening keeps or loses a skin the tolerance thin as it would cut in alone: twelve boxes hidden 0.01 inside the faces of a plate 300 by 200 by 12, one 1.7E-7 deeper than the tolerance and another 5.7E-6 nearer the faces, cut within a hundredth, came back valid and holding 9.68 cubic millimetres more than the most its skins can leave, the plane of the deeper box's floor having cut a skin off the whole plate that the nearer kept over and under it; it loses its skins now, as it does measured by GetVolume(Tolerance). What the differences leave is refused where it is not valid, and each reads a corner as on a plane within the planar tolerance and the rounding of the coordinates, a trillionth of their size, as cutting in at once does: a plate 300 by 200 by 12 with twelve blind holes ending the tolerance under its top, to a few bits, turned and far from the origin, came back wound two ways at its top within a thousandth, and the method returned true; it comes back valid, holding 666 657.36, eleven holes through and one under a skin 0.0010002 thick. At a tolerance at or above the rounding of the coordinates, a welded cut can hold a little more or less than GetVolume(Tolerance) measures, no more than the tolerance times the area of the openings: a plate 300 by 200 by 12 with twelve blind holes ending 0.011 under its top, turned and far from the origin, cut within a hundredth, holds 0.028 cubic millimetres more.
Where walls of two openings, or of an opening and the body, stand apart within the tolerance of one plane and further apart than a trillionth of the size of the coordinates, the openings are cut within a finer tolerance, between the gap of those walls and the most that walls meeting within the tolerance, or a face off flat, stand off one plane, where the body and its openings close within it, and what that gives is taken where it closes within the tolerance asked: the plane of an opening cuts the whole of what it reaches, and a plane of another within the tolerance of it was read as that plane, however far away: an L 100 by 80 by 50, a million out, with two blind openings 27 apart whose walls stood 0.0009 apart across it, cut within a thousandth, held 153 674.08 where it holds 153 673.56, the second opening's wall cut in the plane of the first's, and with the openings the other way round 153 673.30. Walls that meet are made one plane, as before.
Where the point tolerance is below the rounding of the coordinates, a quadrillionth of the largest of them, nought
among them, the openings are cut within that rounding, as the queries read them; a planar tolerance below it with a
point tolerance that is not cuts as it did. Where cutting them in together leaves the material open they are cut in
one at a time, each kept only where it closes, not taken out by a difference, which within the rounding came back
closed and wrong, and corners the cut leaves a rounding apart are made one where that closes the material within
the tolerance given. Cut at nought, a plate 200 by 100 by 3 turned about in space, with a hole 20 by 20 through
it, came back as a shell of 7 faces, its bottom lost, and was said to be cut; it comes back closed, holding
58 800. Openings that touch or overlap each other or lie flush with a face are refused more often at nought than
they were cut wrong: of 120 plates with a hole flush with each face, 34 are refused. What comes back can be valid
at the default tolerance and not at the rounding, for slivers a rounding thin, and
TryGetVolume(out double, Tolerance) at nought can still refuse it where corners stand further
apart than the rounding. The measures of a body with openings, GetVolume(Tolerance),
TryGetVolume(out double, Tolerance), GetSurfaceArea(Tolerance) and
GetCentroid(Tolerance), read the material this method gives: at nought that plate measures
58 800, where it measured 60 000, its hole not taken out, and TryGetVolume said that could be trusted.
A body far out, as GetVolume(Tolerance) says, is moved near the origin with its openings, by whole
coordinates, cut there, and its material moved back: each corner of the body or of an opening it keeps comes back as
it was given, to the bit, and only the corners the cut makes are rounded, once. Where it stood, walls of openings a
fraction of the tolerance apart were cut in one plane: the L 100 by 80 by 50 that GetVolume measures a
thousand million out came back holding 153 732.16 within a thousandth, 0.52 too much, the far wall of one opening
cut in the plane of the other's; it holds 153 731.64 now, to 3E-5.