This differential implements the function BKE_gpencil_stroke_periemter and an operator (GPENCIL_OT_stroke_to_perimeter) that uses it.`BKE_gpencil_stroke_perimeter` and an operator (`GPENCIL_OT_stroke_to_perimeter`) that uses it.
Here is a video, showing the operator in action:
{F8290061}