VoxelSpace

References
public sealed class VoxelSpace
A sparse voxel volume.

Constructors

VoxelSpace

#
public VoxelSpace(
unitSize,
ushort[,,]
voxels,
offsetX,
offsetY,
offsetZ
)

Properties

All

#
Iterate over all set voxel indices. This includes the voxels on the interior and the boundary of the mesh.
public IEnumerable<(int x, int y, int z)> All { get; }

AllInterior

#
Iterate over all interior voxel indices.
public IEnumerable<(int x, int y, int z)> AllInterior { get; }

Count

#
Total number of voxels in the grid, including the unset ones.
public int Count { get; }

CountX

#
Total number of voxels in the grid X direction.
public int CountX { get; }

CountY

#
Total number of voxels in the grid Y direction.
public int CountY { get; }

CountZ

#
Total number of voxels in the grid Z direction.
public int CountZ { get; }

Unit

#
Unit size for voxels.
public double Unit { get; }

Methods

CreateFromMesh

#
public static VoxelSpace CreateFromMesh(
mesh,
unit,
token
)

GradAt

#
Compute the magnitude of the normalised temperature gradient going into the volume.
public double GradAt(
location,
Sampling location.
normal
Normal at location (sampling will happen in the reverse direction). The normal ought to have unit length, although a scaled normal would also affect the depth at which sampling happens, exposing another level of control to the caller.
)

PointAt

#
Gets the real world coordinate at the voxel centre.
public Point3d PointAt(
x,
Voxel x index.
y,
Voxel y index.
z
Voxel z index.
)
Point at voxel centre.

SolveHeatDispersion

#
Run a cooling simulation. All interior voxels are set to 1.0, all exterior ones to 0.0 and then an iterative smoothing is applied until the average temp drops below 'coolingLimit'.
public void SolveHeatDispersion(
targetTemperature,
Use 0.5 when in doubt.
maximumIterations,
Maximum number of iterations.
token
Cancellation token.
)

TempAt

#
Gets the temperature at the given voxel indices.
public double TempAt(
x,
y,
z
)
Temp at voxel, or double.NaN if undefined.

TempAt

#
Measure the interpolated temperature at a location.
public double TempAt(
location
)