In my effort to understand the trace_ray algorithm, I rewrote it a bit to remove explicit heap allocations. In my opinion, the result is a bit simpler, so it might be worthwhile to merge.
Briefly, the ray std::vector now stores coordinates rather than pointers to coordinate triples. A memoryview is used to alias the active/last point in ray.
It is probably a bit faster. I think there is also a slight difference in behaviour in that the endpoint itself is checked for NaN value, whereas before only the first step was checked.
First, thanks for a very nice and usable library.
In my effort to understand the
trace_ray
algorithm, I rewrote it a bit to remove explicit heap allocations. In my opinion, the result is a bit simpler, so it might be worthwhile to merge.Briefly, the ray
std::vector
now stores coordinates rather than pointers to coordinate triples. Amemoryview
is used to alias the active/last point inray
.It is probably a bit faster. I think there is also a slight difference in behaviour in that the endpoint itself is checked for NaN value, whereas before only the first step was checked.