DashedVMobject should have dash_legth much like DashedLine
Description of proposed feature
DashedVMobject should allow for fixed-length dashes independent of the length of the underlying curves. DashedLine does, by computing the length of the curve in __init__ (see #3989), but DashedVMobject does not. This makes animated dashed CubicBeziers for example quite ugly, since their dashes will be stretched, leading not only to temporal inconsistencies, but also to inconsistencies between different-length curves (unless users find ways to compute the correct num_dashes, which I did not yet).
How can the new feature be used?
Connections between entities can be visualized with lines or curves, the style of which conveys some meaning (type of connection / relation). If the dash length is consistent, the style will be perceived as the same, so it is possible to use dashing as an indication of the type of connection / relation.
Additional comments
I looked into the implementation myself, and initially thought the reason for this is that the length of arbitrary VMobjects is hard to compute / not available. However, there is already the equal_lengths argument (defaulting to True), which causes the approximate length to be computed.
When further trying to come up with a PR, I found that the current default of num_dashes=15 prevents a backwards-compatible introduction of dash_length: float = DEFAULT_DASH_LENGTH as in DashedLine. I would suggest to really have the latter as new default behavior, but that is obviously something to be discussed and decided on.
I'd like to take this issue as I have some recent experience with the DashedVMobject as I tried fixing another bug about it (Pull request here #4078 )
Hello!
Found this issue while animating a sliding window. As @hmeine says, animating dashedVMObjects leads to strange animations. However, I tried recalculating the number of dashes exactly like DashedLine does, and converting the object into a always_redraw. And it doesn't look smooth either. I think that the problem is about integer steps. The number of steps must be an integer, and the skip from (let's say) 15 steps to 16 steps is a bit rough.
Proposed solution: set the preferred length, and complete N possible complete dashes, and a partial one. This way, when animating a moving DashedVMobject, it wouldn't create those steps.
That's also what I found, see my above discussion of a reasonable dash_length: float parameter.