phetsims / bending-light

"Bending Light" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/bending-light
GNU General Public License v3.0
8 stars 8 forks source link

Segment end is infinite #329

Closed samreid closed 8 years ago

samreid commented 8 years ago

From the fuzz test in https://github.com/phetsims/axon/issues/82

bending-light

Uncaught Error: Assertion failed: Segment end is infinite
Error: Assertion failed: Segment end is infinite
    at window.assertions.assertFunction (http://localhost/assert/js/assert.js:23:13)
    at Subpath.inherit.addSegmentDirectly (http://localhost/kite/js/util/Subpath.js?bust=1450384567676:105:17)
    at Subpath.inherit.addSegment (http://localhost/kite/js/util/Subpath.js?bust=1450384567676:122:14)
    at Shape.inherit.addSegmentAndBounds (http://localhost/kite/js/Shape.js?bust=1450384567676:805:29)
    at Shape.inherit.lineToPoint (http://localhost/kite/js/Shape.js?bust=1450384567676:147:14)
    at new LightRay (http://localhost/bending-light/js/common/model/LightRay.js?bust=1450384567676:124:10)
    at IntroModel.inherit.addAndAbsorb (http://localhost/bending-light/js/intro/model/IntroModel.js?bust=1450384567676:280:27)
    at IntroModel.inherit.propagateRays (http://localhost/bending-light/js/intro/model/IntroModel.js?bust=1450384567676:240:20)
    at IntroModel.inherit.updateModel (http://localhost/bending-light/js/common/model/BendingLightModel.js?bust=1450384567676:120:14)
    at http://localhost/bending-light/js/intro/model/IntroModel.js?bust=1450384567676:91:18
samreid commented 8 years ago

The error did not arise in the next fuzz test:

image

or the second test:

image

or the third one:

image

I'll take a look at the code but since dev is moving to RC I'll have to be wary of branches.

samreid commented 8 years ago

This error is only occurring when the laser view is wave and only on the 1st or 3rd screen.

samreid commented 8 years ago

Commenting out the 2nd screen, and changing the sim so that only the wave view is shown, I still do not see the error in the fuzz test. Perhaps it is rare enough to avoid fixing in this publication.

samreid commented 8 years ago

Manually testing wave mode with the intensity probe and a variety of angles and positions I cannot reproduce the problem, so I'll close and move forward with the RC.

phet-steele commented 8 years ago

This was seen 3/1/2016 via automated testing on the requirejs version off master. Win 10 Chrome.

phet-steele commented 8 years ago

Seen during 4/12/2016 automated tests.

phet-steele commented 8 years ago

Twice again on 5/24/2016 automated tests.

phet-steele commented 8 years ago

And yet again on 6/14/2016 automated tests. @samreid should I be ignoring this error?

samreid commented 8 years ago

@phet-steele No need to report it further until work is done on this issue.

samreid commented 8 years ago

Let's look at this again for #351

samreid commented 8 years ago

This issue could only occur if the argument is positive or negative Infinity or NaN, so I'll add code to zero out infinite/nan values before calling lineTo.

samreid commented 8 years ago

Fixed above, and I'm inclined to close the issue and have @phet-steele reopen if it recurs.