Class: VarianceBasedPrecisionCalculator
Serialization.PrecisionDetection.VarianceBasedPrecisionCalculator(qualityFactoropt)
A precision calculator based on the error introduced after rounding
Constructor
new VarianceBasedPrecisionCalculator(qualityFactoropt)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
qualityFactor | float | <optional> | 0.5 | Quality 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:
Name | Type | Description |
---|---|---|
data | Float32Array | The data to be used for the calculation |
property | PathBuilding.PathPoint.Property | Geometric/appearance property, which corresponds to the given sequence of path point data values |
Implements:
Returns:
A decimal precision value
Type
int