Runtime error: Unable to unitize vector

Dear All,
I am trying to make a script that generates blocks around central areas, Each central area is a polygon consisting of several segments. However, when the input: minimum width (length of segment ) is smaller than 15, it gives me the following error : Runtime e

rror: Unable to unitize vector (13.5 KB)
Kindly find attached the grasshopper file

This means that your script is trying to unitize a 0 (no length) vector. There’s no direction to unitize it, so the call fails.

You can check if the vector length is zero, and in that case, set maybe a default.