Skip to main content

Quadratic3

Quadratic3

Quadric Error Metric Triangular 4x4 matrix, see https://en.wikipedia.org/wiki/Triangular_matrix

Kind: global class

quadratic3.toVector3(result)

Kind: instance method of Quadratic3

ParamType
resultArrayLike.<number> | Array.<number> | Float32Array

quadratic3.toTensorM3(m3)

Kind: instance method of Quadratic3

ParamType
m3ArrayLike.<number> | Array.<number> | Float32Array

quadratic3.toTensorM3Inverse(m3, epsilon) ⇒ boolean

Equivalent to taking a tensor followed by matrix inversion

Kind: instance method of Quadratic3
Returns: boolean - whether operation was successful or not

ParamType
m3ArrayLike.<number> | Array.<number> | Float32Array
epsilonnumber

quadratic3.setFromVector4(x, y, z, w)

Set from plane expressed as a 4 component vector

Kind: instance method of Quadratic3

ParamTypeDescription
xnumberplane normal
ynumberplane normal
znumberplane normal
wnumberplane offset

quadratic3.setFromFace(face)

Kind: instance method of Quadratic3

ParamType
faceTopoTriangle

quadratic3.evaluate(x, y, z) ⇒ number

Squared distance from the given point to plane encoded by the quadratic

Kind: instance method of Quadratic3

ParamType
xnumber
ynumber
znumber

quadratic3.optimize(out) ⇒ boolean

Find optimal vertex position based on the quadratic

Based on Blender's implementation: https://github.com/blender/blender/blob/594f47ecd2d5367ca936cf6fc6ec8168c2b360d0/source/blender/blenlib/intern/quadric.c

Kind: instance method of Quadratic3

ParamType
outArray.<number>

quadratic3.add(Q)

Kind: instance method of Quadratic3

ParamType
QQuadratic3

quadratic3.multiplyScalar(v)

Kind: instance method of Quadratic3

ParamType
vnumber

quadratic3.clone() ⇒ Quadratic3

Kind: instance method of Quadratic3

quadratic3.copy(other)

Kind: instance method of Quadratic3

ParamType
otherQuadratic3

quadratic3.clear()

Set all matrix values to 0

Kind: instance method of Quadratic3