Initializerheckj.voxels 0.2.6Voxels
init
MarchingCubes.swift:305init()
init()
import Voxels
A Swift library for storage, manipulation, export, and 3D rendering of Voxel data.
class MarchingCubesRenderer
A renderer that implements the marching cubes algorithm to create a 3D mesh from voxel data.
static func normalizedOffset(_ f0: Float, _ f1: Float) -> Float
Determines a normalized offset value for linear interpolation from two values on either side of 0, with 0 being the point to interpolate towards. The provided values are required to have opposite signs (one negative, one positive) in order to use 0 as the marker for the interpolation direction.
func edge_to_boundary_vertex(edge: Int, cornerValues: [Float], index: VoxelIndex, adaptive: Bool = false, homeworkMode: Bool = false) -> Vector
Returns a vertex in the middle of the specified edge of a voxel cube.
func render<VOXEL>(_ data: any VoxelAccessible<VOXEL>, scale: VoxelScale<Float>, within bounds: VoxelBounds, adaptive: Bool = false) -> MeshBuffer where VOXEL : VoxelSurfaceRenderable