Closed cgyurgyik closed 4 years ago
@ak-2485 When we talked earlier, I said I thought it was because of small floating point error due to a large number of radial sections and a small sphere max radius; I no longer think this is the case. It works fine when N = 32, 64, 127, 129. It breaks exactly when N = 128. This seems to be occurring because of a tangential hit at radial voxel 119. Since its a tangential hit, no step occurs and it gets stuck using the same times. Since the next biggest time will be the last radial voxel, it jumps to the end.
We should be able to test a case when we have several radial sections and the ray is tangential to an interior section. @nukenukenukelol can you create a matlab test with that spec?
We should be able to test a case when we have several radial sections and the ray is tangential to an interior section. @nukenukenukelol can you create a matlab test with that spec?
Yes, I will work on that! Just to be clear, we want a sphere with large radial sections with a ray that is tangential to one of the planes (xy, xz, yz) or tangential to one of the radial sections?
I think any number of radial sections is fine. We want a ray tangent to a radial section that is not the first or last radial section. So if there are N radial sections, it needs to be between the bounds 1 and N (exclusive). There should just be one azimuthal and angular section, since we're just trying to see this case.
The issue: The ray is tangent to a radial section, the step value is 0, and then it jumps to the end.
If this doesn't work, maybe try replicating my numbers above in MATLAB.
I believe I may have some issues with the tangential hit.
The expected behavior for radial_voxels is 1, 2, 3, ..., X, ..., 3, 2, 1. This works fine when num_radial_sections = 64, num_radial_sections = 127, and num_radial_sections = 129. When it is changed to 128, we get the following behavior:
Here, I've printed out the data for the last few radial hits. The issue arises with the second to last radial hit:
The algorithm just ends after this. It should continue here; since the ray passes entirely through the sphere, the first and last radial voxel should be 1.
At first I thought it was because the sphere maximum radius was small and the number of radial sections large, but I don't think this is the case. Let's set num_radial_sections to 129:
No issues at all.