spherical-volume-rendering / svr-algorithm

A spherical volume rendering algorithm that performs ray casting through a spherical voxel grid.
Other
6 stars 7 forks source link

add test where ray begins in the sphere + end in sphere #140

Closed nukenukenukelol closed 3 years ago

nukenukenukelol commented 4 years ago

Add test where:

  1. Ray begins within the sphere but ends outside the sphere
  2. Ray begins outside the sphere but ends within the sphere

we are failing testBeginsWithinSphere: It seems that our algo is not outputting hits at all

We do pass testEndsWithinSphere though

cgyurgyik commented 4 years ago

Can you add the following please:

  1. Ray begins in outermost radius and ends within the sphere.
  2. Ray begins (NOT in outermost radius) and ends within sphere.
  3. Ray begins at sphere origin.

These are corner cases I would like to make sure I've covered in the cpp version.

nukenukenukelol commented 4 years ago

Just update testBeginsWithinSphere and add testBeginTimeNotZero tests. The spherical algorithm is failing both cases.

Here's my explanation for my test cases: testBeginTimeNotZero: If we set the beginning time to 0.01, there should be no impact on the output of the algorithm. However, the algo miss the last two radial hit.

testBeginWithinSphere: By letting the ray start at (-10.0,10.0.10.0) with direction (1.0,-1.0,-1.0), according to t2-t1 when we set begin time to 0, we should take around 10 to traverse through the grid. Then by setting t_begin to 9, we should start our traversal right before we exit the grid. If so, we should see the algo outputs the last radial, angular, and azimuthal section and then terminate. However, according to the print statement, we see that ray begins outside the grid which returns [] for radial, angular, and azimuthal hit.

cgyurgyik commented 4 years ago

Can you change your testBeginsWithinSphere to t_begin = 0.0, and use a ray origin inside the sphere? This way we can differentiate the case where the ray begins within the sphere with the case where the t_begin != 0.0

nukenukenukelol commented 4 years ago

Add new test cases. The only test case we are failing right now is testBeginTimeNotZero.

New test cases are: testBeginsOuterMostRadiusAndEndsWithinSphere testBeginsNotOuterMostRadiusAndEndsWithinSphere

Update: testBeginsWithinSphere (now the beginning time is zero but the ray starting point is within sphere)

nukenukenukelol commented 4 years ago

Add new test cases: testRayTangentialHit: The ray is tangential hit with radial voxel 3 testRayNearTangentialHit: The ray is perturbed such that it's not a tangential hit, but it is really close to radial voxel 3. The output of this test case should be the same as the previous one.

nukenukenukelol commented 4 years ago

Add a second tangential hit test case, to see whether the algorithm will terminate after seeing a tangential hit or it will miss any particular hit. It seems that the algorithm right now will not output the last hit.