Skip to content

Commit ae8f05f

Browse files
Changed mesh intersection algorithm to return all times instead of just positive.
Fixed that normals were not sorted along with the times when returning solutions.
1 parent 56e8a8c commit ae8f05f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mcstas-comps/share/union-lib.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4033,9 +4033,9 @@ int sample_mesh_intersect(double *t,
40334033
// Place the solutions into the pointers given in the function parameters for return
40344034
for (int i = 0; i < *num_solutions; i++) {
40354035
t[i] = hits[i].t;
4036-
nx[i] = - hits[i].nx;
4037-
ny[i] = - hits[i].ny;
4038-
nz[i] = - hits[i].nz;
4036+
nx[i] = hits[i].nx;
4037+
ny[i] = hits[i].ny;
4038+
nz[i] = hits[i].nz;
40394039
surface_index[i] = hits[i].surface_index;
40404040
}
40414041

0 commit comments

Comments
 (0)