Distance#310
Conversation
There was a problem hiding this comment.
Yes, I think this is right (and better too, there could have been issues with the old code if someone initialized a polygon with the vertices out of order). Plus, tests are still passing
| ) | ||
|
|
||
| np.testing.assert_allclose(distances, true_distances) | ||
| np.testing.assert_allclose(displacements[1:7], true_displacements) |
There was a problem hiding this comment.
@rynoliphant do you have the other displacement values written out?
There was a problem hiding this comment.
The reason the other displacement values weren't written out was because there are multiple possible displacements to the surface (besides point [4,3,3], which I think actually has only one valid displacement). Point [3,3,3] is in the center of the spheropolyhedron and has 6 valid displacements (one to each face), point [4,4,4] sits on a vertex of the inner cube and has infinite valid displacements, point [4,4,3] sits on an edge of the inner cube and has infinite valid displacements, and point [4,3,3] sits on a face of the inner cube and has 1 valid displacement (which I can add, it should be [radius, 0,0] )
There was a problem hiding this comment.
Noted -- what does the internal code do in this case? Is it left up to whichever is closer in floating point?
Description
Motivation and Context
Types of Changes
1The change breaks (or has the potential to break) existing functionality.
Checklist: