C# - offset inwards, null exception

Hi! I am struggling to figure out null situation when I use Curve.Offset Method.

The intention of this script is to make multiple offset curves (inwards) with certain distance.
The script works when I reduce the offset distance in half. Thus I assume that there is a way to estimate maximum range of offset distance to avoid failure/null situation.

can you give me some advice how to make this script work?OffsetInwardsNull.gh (12.9 KB) :sweat_smile:

Thanks for your comments!

Moved to Rhino Developer category so it will be seen.

1 Like

Just check for null in your script then and exit the loop. Or are you looking for a way to know beforehand how many offsets you can produce?

1 Like

yes! is there any way to know possible (inward-offset) range?

I think this should do what you want?
OffsetInwards_null_check.gh (20.3 KB)

depends highly on the input if a offset fails. You can make an estimation but I think it is just as fast to make the offsets and count them

1 Like