Skip to main content

Class: VarianceBasedPrecisionCalculator

Serialization.PrecisionDetection.VarianceBasedPrecisionCalculator(qualityFactoropt)

A precision calculator based on the error introduced after rounding

Constructor

new VarianceBasedPrecisionCalculator(qualityFactoropt)

Parameters:
NameTypeAttributesDefaultDescription
qualityFactorfloat<optional>0.5Quality factor is used during optimal precision detection.Valid values range between 0 and 1. A value of 0 is considered 'worst quality / smallest size', a value of 1 - 'best quality / max size'.

Implements:

Methods

calculatePrecision(data, property) → {int}

Calculates an estimated precision value based on the variance of the fractional part of floating point numbers

Parameters:
NameTypeDescription
dataFloat32ArrayThe data to be used for the calculation
propertyPathBuilding.PathPoint.PropertyGeometric/appearance property, which corresponds to the given sequence of path point data values

Implements:

Returns:

A decimal precision value

Type

int

Home