Class VolumeTakeoff
- Namespace
- GeometryHelper.Takeoff
- Assembly
- GeometryHelper.dll
Takes off the volumes of the parts of a model, each bit of material counted once: by the part ranked first among those holding it.
public static class VolumeTakeoff
- Inheritance
-
VolumeTakeoff
- Inherited Members
Remarks
The parts are ranked by their Priority, the highest first, of two the same by their Id, the largest first and any id before none, and then by their order in the list. A part keeps all it shares with the parts ranked after it, and loses to them nothing. Where a slab 200 thick sits on a beam 300 wide that runs into a column 400 by 400, and the column is ranked first, the beam second and the slab third, the block the three share, 300 by 400 by 200, is the column's: the slab loses it to the column, and to the beam only what the beam shares with it beyond the column. Taken off by each part it meets, the slab would lose those 24 000 000 twice. So the net volumes add up to the volume of all the parts together, and two exact copies count once: the later comes out nought.
The bodies given are never cut; only what they share is. First every pair whose boxes overlap by more than the point tolerance has its common part worked out, by TryIntersect(GeoSolid3, GeoSolid3, out GeoSolid3, SolidBooleanOptions, out BooleanOutcome) of the part ranked later with the part ranked first, which is put onto it as the contact says. Then each part's pieces, in the order of the parts that keep them, have the pieces before them taken out, by TrySubtractAll(GeoSolid3, IEnumerable<GeoSolid3>, out GeoSolid3, SolidBooleanOptions, out SubtractReport), so that each is what that part keeps and no part before it kept already. Both steps run in parallel, and the volumes come out the same, bit for bit, on one thread or on every processor.
A common part the booleans cannot make, one that is not valid, holds more than the smaller of the two, or cannot be worked out at all, is worked out by slicing instead: the part is cut by parallel planes, and the area of what it shares with the keeper and with no keeper ranked before is added up the height, exactly over flat faces and with no tolerance. So is a piece the cut of the pieces before it cannot finish, or that has a keeper before it whose overlap was sliced. A curved wall of 354 faces and a curved girder of 322 of a Tekla model, met within a thousandth with a contact of a hundredth, share a common part of 4 256 faces that is not valid; slicing gives them 2 226 236 967 in 0.04 seconds, where Tekla's own boolean gives 2 226 236 773 cutting the wall and 2 226 236 807 cutting the girder. A pair as near-coincident as these two, with at least a hundred pairs of faces less than a millimetre apart and less than a tenth of a degree off parallel, though neither flush nor parallel, is sliced without the booleans being tried: on these two they run a minute or two before failing, and the take-off of the two takes 0.1 seconds without them. A deduction worked out by slicing is exact, and carries no issue. Only a pair that cannot be sliced either is not taken off: a section of a body crossed an odd number of times, as where a corner sits more than about 1E-9 off its neighbour's edge, a T-junction, even in a body Validate(Tolerance) accepts. Its result says so in Issues, and the net volume is then no less than it should be. No failure of the geometry escapes: each comes back as an issue and is logged.
A common part thinner on average than half the point tolerance, its volume no more than the point tolerance times half its area, is taken as touching, and nothing is taken off for it: a beam standing on a slab, flush with it or a hair into it, loses nothing. A volume worked out by slicing has no body to measure, and is judged by the least area a body of its volume can have, a ball's; slicing snaps nothing, so a sheet a hair thick that the contact would have put away is taken off as the faces give it.
The tolerance the booleans work within is the one the options carry. A scope opened with Use(Tolerance) around the call is opened on every worker as well, so that it reaches the few steps underneath that read the global tolerance whichever thread runs them.
Methods
- Run(IReadOnlyList<VolumeItem>)
Takes off the volumes of the parts with the default options.
- Run(IReadOnlyList<VolumeItem>, VolumeTakeoffOptions)
Takes off the volumes of the parts.