Animate painter2D in Vector API Uitoolkit Unity3D

Is it possible to animate the LineTo method of a MeshGenerationContext to have a smooth movement from the current position to the final one?

void Draw(MeshGenerationContext mgc)
{
var painter2D = mgc.painter2D;

painter2D.fillColor = wireColor;

painter2D.BeginPath();
painter2D.MoveTo(p0);
painter2D.LineTo(p1);
painter2D.ClosePath();
painter2D.Fill();
}

I'm still learning, so this might be the wrong answer, but I found you can put: visualElement.MarkDirtyRepaint(); into the Update() method and it will redraw the object. You can just lerp the position of p1 at that point.