Closed veillette closed 1 year ago
The commit above fixes the issue above by setting the penultimatePosition to null.
Therefore, for the first drag event, there is only one point, which does not lie on the curve, such that you can create segments of curve as
Note the single dot that results from an exceedingly short drag event.
I'll address this next week to come up with a more acceptable behavior.
Note for self: New approach to average curve based on mollifying functions.
I committed the approach above (after some clean up).
It uses a very different approach on how to smooth functions based on a mollifier. We previously used short quadratic segments, but these had the unfortunate property to becomes a bunch of piecewise constants once we take the second derivative.
A typical result using the mollifying function gives
For reference, here is a typical case using the quadratic segment algorithm.
Even with mollifying approach, you can see that the second derivative is a somewhat bizarre function. However, that is probably the best I can do.
I'll assign this to @amanda-phet to test and review the free-form. I suggest you used the Lab Screen with the second derivative to truly test the free-form.
Let's discuss this in a meeting. I'm not sure what exactly I'd like changed, but this seems difficult to interpret.
Ex 1: This situation wasn't possible in the flash version, so it's cool we can do it now. However the result is difficult to interpret.
Ex 2: This situation is just drawing a random-ish curve, nothing too fancy or unusual. WIth many presses of the "smooth" button, I expected the 2nd derivative to smooth out, but it didn't:
I should add that the presence of discontinuity points in the derivatives is symptomatic of a failure of the discontinuity detection algorithm rather than an intrinsic problem with free form drag.
Thanks for clarifying @veillette . I think the free form drag is working very well.
After adding a drag listener to the graphNode instead of the curve themselves (see #210) we will need to address the behavior of the FreeForm curve manipulation mode as it makes an assumption that the initial drag event is on the curve.