Home Reference Source
import {QEFSolver} from 'rabbit-hole'
public class | source

QEFSolver

A Quaratic Error Function solver.

Finds a point inside a voxel that minimises the sum of the squares of the distances to the surface intersection planes associated with the voxel.

Based on an implementation by Leonard Ritter and Nick Gildea: https://github.com/nickgildea/qef

Constructor Summary

Public Constructor
public

Constructs a new QEF solver.

Member Summary

Public Members
public

Indicates whether this solver has a solution.

public

massPoint: Vector3

The mass point of the current QEF data set.

Method Summary

Public Methods
public

Sets the QEF data.

public

solve(x: Vector3): Number

Solves the Quadratic Error Function.

Public Constructors

public constructor() source

Constructs a new QEF solver.

Public Members

public hasSolution: Boolean source

Indicates whether this solver has a solution.

public massPoint: Vector3 source

The mass point of the current QEF data set.

Public Methods

public setData(d: QEFData): QEFSolver source

Sets the QEF data.

Params:

NameTypeAttributeDescription
d QEFData

QEF Data.

Return:

QEFSolver

This solver.

public solve(x: Vector3): Number source

Solves the Quadratic Error Function.

Params:

NameTypeAttributeDescription
x Vector3

A target vector to store the vertex position in.

Return:

Number

The quadratic error of the solution.