# Inner width of a polygon

How can I calculate the minimum inner width of a polygon?

A) Thatâ€™s not a polygon (closed curve).
B) The angled right side creates problems because many vertical lines can be created that are shorter and parallel to your blue line.

Itâ€™s best to post multiple examples of internalized geometry (â€śpolygonsâ€ť) to test, and expected results.

Thatâ€™s very easy with code â€¦ but I have no idea how to do it the other way.

Notify if you want a full C# take on that. Do you have open Polygons as well? (thatâ€™s a bit tricky, mind). Are your collections planar (up to some tolerance) ?. How many they are?

BTW: Polygons are called Polylines in R speech. If members/segments are Curves as well the combo is called PolyCurve (or confusingly: Curve).

1 Like

yes this is exactly am looking for. All polygons are co planer and closed ones.
Yes I would like to understand the C# you have used here. Will be very helpful. Thanks

Iâ€™m out in the wild for the moment.When back Iâ€™ll post the thing (+ TextDots to clarify what is where).

This means that you walk that walk?

BTW: I do have a stupid laptop with me. So spend 5 minutes for a â€ścomparison comboâ€ť demo (what pair to take to extract min distance - but what is the min distance â€¦ this â€¦ is another matter). After that the only thing required is a Class with suitable Properties where you sample the combo data and then â€¦ well â€¦ IF THE Class contains any item - a simple LINQ query (OrderBy(x=>x.MinDist)) tells you the truth out there.

Polyline_MinW_ComboLogicDemo.gh (10.4 KB)

Can you please share the one you shared first ? I want exactly that

Iâ€™ m back - so get the thing (with some DextDot ability for fun).

Polyline_MinW_V1A.gh (135.3 KB)

NOTE: This is NOT the Jack for all Trades â€¦ but is some Jack anyway.

yeah sure one solution may not fit all.
Thanks alot

That said: this DOES not check your Polygons for self ccx events, colinear Pts within a given segment â€¦ and numarous other â€śfreaky/unexpectedâ€ť situations.

Meaning that if you fail to prepare, prepare to fail.

Agree with you 100 % .
You have a very interesting personality:-)

BTW: feel free to sample and post here (in R5 format) Polygons (with no self ccx events) that refuse to play ball - they must be a zillion cases where the C# does bananas.