star-line

Structure for accelerating line importance sampling
git clone git://git.meso-star.fr/star-line.git
Log | Files | Refs | README | LICENSE

commit 7de1389b55eab73ff961f4c021aef3de35c1b5af
parent 1a4807e87740ee85ec096eb4569cace30e734bed
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Mon, 30 May 2022 18:47:23 +0200

Update the criterion of the polyline decimation

Diffstat:
Msrc/sln_polyline.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/sln_polyline.c b/src/sln_polyline.c @@ -34,7 +34,7 @@ * approximation by the line (range[0], range[1]). Let K the real value of the point * and Kl its linear approximation, the error is computed as: * - * err = |K-Kl|/(K, Kl) */ + * err = |K-Kl|/K */ static void find_falsest_vertex (const struct sln_vertex* vertices, @@ -103,7 +103,7 @@ find_falsest_vertex val = -(N[0]*p[0] + C)/N[1]; /* Compute the relative error of the linear approximation of p */ - err = absf(val - p[1]) / MMIN(val, p[1]); + err = absf(val - p[1]) / p[1]; if(err > err_max) { imax = ivertex; err_max = err;