phetsims / calculus-grapher

"Calculus Grapher" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
4 stars 4 forks source link

Investigate solutions to rendering discontinuities #18

Closed brandonLi8 closed 1 year ago

brandonLi8 commented 4 years ago

From the design doc, the HTML5 version of calculus grapher will need to render discontinuities for non-differentiable points with open circles and a thicker connecting dashed line.

image




@amanda-phet said in the design doc:

brli9486@colorado.edu should review this with developers. A similar spec came up for Natural Selection, and was problematic because scenery doesn't support multiple appearances in a single stroke (or something like that). This is a critical model change for this sim, so it would be good to discuss as a design team and also involve some devs for ideas.

This could potentially be a problem. I'll keep this in mind for when I'm implementing the model. It also came up in collision lab (with the ball paths) and gravity and orbits. The solution for both sims was to use Canvas instead, which supports different strokes between segments (see https://github.com/phetsims/collision-lab/issues/61). It's hard for me to gauge if this approach is appropriate for calculus grapher at the moment (since nothing has been implemented).

Another solution specific to calculus grapher would be to render the curve normally with a single Path and ignoring the discontinuity, then going over it and using separate dashed lines on top of the curve with a different line-dash and line-width. Unsure at this point how this would impact memory/performance.

@amanda-phet is this spec currently in Natural Selection? If so, can you point me to where I can find it in the sim and I'll take a look at how it's rendered.

amanda-phet commented 4 years ago

@amanda-phet is this spec currently in Natural Selection? If so, can you point me to where I can find it in the sim and I'll take a look at how it's rendered.

No, we decided on a different approach because of the difficulty involved. But for Calculus Grapher I think it's a critical piece of the model!

pixelzoom commented 2 years ago

9/22/2022 design meeting:

This feature is needed. @veillette will investigate how to address.

This feature may also have informed the shape of the "pedestal" operator, may need to revisit.

veillette commented 1 year ago

I think we can close this issue as rendering discontinuities has not been a problem. The view side of the "equation" is relatively straightforward. The most difficult part lies in the model, where one would like to detect discontinuities, without false positives. (see #110 ).

veillette commented 1 year ago

I think it would be worth opening a new issue regarding the work that needs to be done with respect of detecting discontinuities.

veillette commented 1 year ago

This issue is superseded by #132 . Closing.