Skip to content

Commit f58d45e

Browse files
committed
stop rays when exiting model
1 parent 4adabf0 commit f58d45e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/plot.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -1659,6 +1659,13 @@ void Ray::trace()
16591659
if (stop_)
16601660
return;
16611661

1662+
// There are no more intersections to process
1663+
// if we hit the edge of the model, so stop
1664+
// the particle in that case:
1665+
if (dist_.distance == INFTY || dist_.distance == INFINITY) {
1666+
return;
1667+
}
1668+
16621669
// Advance particle, prepare for next intersection
16631670
for (int lev = 0; lev < n_coord(); ++lev) {
16641671
coord(lev).r += dist_.distance * coord(lev).u;

0 commit comments

Comments
 (0)