Method GetMaskTernary
| Edit this page View SourceGetMaskTernary(bool)
Export occupancy as a ternary mask.
Declaration
public byte[] GetMaskTernary(bool flipSign = false)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | flipSign | flip outside and inside |
Returns
| Type | Description |
|---|---|
| byte[] | (0=outside, 1=inside, 2=boundary) |
GetMaskTernary(Span<byte>, bool)
Export occupancy as a ternary mask into a provided span.
Declaration
public void GetMaskTernary(Span<byte> destination, bool flipSign = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Span<byte> | destination | destination span (length must be at least NxNyNz) |
| bool | flipSign | flip outside and inside |
Remarks
Example:
byte[] buf = ArrayPool.Shared.Rent(gridSize);
grid.GetMaskTernary(buf.AsSpan());
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | if destination span is too small |