commit b96291c2b1279cff00298f4f5f819795adde0f2e
parent 5299e99da7226452902dfcb8d18f1d206d57c26a
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Sun, 3 May 2020 12:53:58 +0200
BugFix: wrong projection on boundary with -P option
Diffstat:
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/src/stardis-compute.c b/src/stardis-compute.c
@@ -69,13 +69,6 @@ select_probe_type
d3_sub(dp, projected_pos, pos);
d = d3_len(dp);
- if(d == 0) {
- /* Best possible match */
- found = i;
- logger_print(stardis->logger, LOG_OUTPUT,
- "The probe is on the primitive %llu.\n", (long long int)*iprim);
- break;
- }
if(d >= min_d) {
/* No improvement */
continue;
@@ -83,6 +76,15 @@ select_probe_type
min_d = d;
d2_set(min_uv, tmp_uv);
+ if(d == 0) {
+ /* Best possible match */
+ found = i;
+ d3_set(new_pos, projected_pos);
+ logger_print(stardis->logger, LOG_OUTPUT,
+ "The probe is on the primitive %llu.\n", (long long int) * iprim);
+ break;
+ }
+
/* Find side */
ERR(sg3d_geometry_get_unique_vertex(stardis->geometry.sg3d, indices[0], tmp));
f3_set_d3(v0, tmp);