edge_to_boundary_vertex(edge:cornerValues:index:adaptive:homeworkMode:)

Returns a vertex in the middle of the specified edge of a voxel cube.

MarchingCubes.swift:412
func edge_to_boundary_vertex(edge: Int, cornerValues: [Float], index: VoxelIndex, adaptive: Bool = false, homeworkMode: Bool = false) -> Vector

Parameters

edge

The index of the edge of the voxel.

cornerValues

An array of the evaluated values at each of the corners of the voxel cube.

index

The voxel index of the voxel being evaluated.

adaptive

If true, chooses a vertex location based on interpolation of the isofield values on the relevant edges.

homeworkMode

If true, enables detailed print statements showing the calculations and logic for the choice of locations for the polygon(s).

Returns

a vector location interpolated between the corners for the face of the polygon