Method TrySubtract
- Namespace
- GeometryHelper.Core
- Assembly
- GeometryHelper.dll
TrySubtract(GeoSolid3, GeoSolid3, out GeoSolid3)
Takes one solid out of another, using the default tolerance.
public static bool TrySubtract(GeoSolid3 subject, GeoSolid3 tool, out GeoSolid3 result)
Parameters
Returns
TrySubtract(GeoSolid3, GeoSolid3, out GeoSolid3, Tolerance)
Takes one solid out of another, within a tolerance.
public static bool TrySubtract(GeoSolid3 subject, GeoSolid3 tool, out GeoSolid3 result, Tolerance tolerance)
Parameters
subjectGeoSolid3The body to cut material from.
toolGeoSolid3The body to remove.
resultGeoSolid3What is left of the subject.
toleranceToleranceThe tolerance.
Returns
- bool
false when nothing is left, because the tool swallowed the subject whole, or when it cannot be worked out, which is logged: of two closed bodies, what is left closed as Validate(Tolerance) reads it, or not at all.
Remarks
The walls of the cavity are not taken from the tool; they are already there. Dividing the subject by the planes of the tool lays a face along every part of the surface of the tool that passes through it, so keeping the cells that fall outside the tool keeps those faces with them. A tool that misses the subject changes nothing, and the subject comes back unaltered.
TrySubtract(GeoSolid3, GeoSolid3, out GeoSolid3, out BooleanOutcome)
Takes one solid out of another, saying how it came out, using the default tolerance.
public static bool TrySubtract(GeoSolid3 subject, GeoSolid3 tool, out GeoSolid3 result, out BooleanOutcome outcome)
Parameters
subjectGeoSolid3toolGeoSolid3resultGeoSolid3outcomeBooleanOutcome
Returns
TrySubtract(GeoSolid3, GeoSolid3, out GeoSolid3, Tolerance, out BooleanOutcome)
Takes one solid out of another, within a tolerance, saying how it came out.
public static bool TrySubtract(GeoSolid3 subject, GeoSolid3 tool, out GeoSolid3 result, Tolerance tolerance, out BooleanOutcome outcome)
Parameters
subjectGeoSolid3The body to cut material from.
toolGeoSolid3The body to remove.
resultGeoSolid3What is left of the subject.
toleranceToleranceThe tolerance.
outcomeBooleanOutcomeMade with what is left, Empty where the tool took the whole subject, or left no more than a slab the tolerance thick, or NotWorkedOut where it could not be worked out, which is logged: nothing left takes a net volume to nought, where no answer is a step to work out some other way. A plate 10 by 10 and 0.0018 thick less a box over all but 0.0018 of its width leaves a rod 0.0018 square, which encloses nothing at a tolerance of a thousandth as Validate(Tolerance) reads it, and is empty.
Returns
- bool
false when nothing is left, no more than a slab the tolerance thick among it, or when it cannot be worked out.
TrySubtract(GeoSolid3, GeoSolid3, out GeoSolid3, SolidBooleanOptions, out BooleanOutcome)
Takes one solid out of another as the options say; see SolidBooleanOptions.
public static bool TrySubtract(GeoSolid3 subject, GeoSolid3 tool, out GeoSolid3 result, SolidBooleanOptions options, out BooleanOutcome outcome)
Parameters
subjectGeoSolid3The body to cut material from; it is not moved.
toolGeoSolid3The body to remove; its faces lying against the subject's are put onto them.
resultGeoSolid3What is left of the subject.
optionsSolidBooleanOptionsHow the difference is worked out.
outcomeBooleanOutcomeHow it came out, as TrySubtract(GeoSolid3, GeoSolid3, out GeoSolid3, Tolerance, out BooleanOutcome) says.
Returns
- bool
false when nothing is left, or no more than a slab the tolerance thick, or when it cannot be worked out.
Exceptions
- ArgumentNullException
Thrown when either body or the options are null.