How would you go about determining the maximum distance that a closed curve could be offset before it intersects itself (negative offset/inward direction). Outside of a really heavy loop of testing offset values until it intersects, I don’t see a geometric way of determining this.
Hello
The maximum negative value is equal to the offset of a circle.
OffsetMax = \sqrt{Area\\Pi}
calculating the area with for example an offset divided by 2 could lead by recursion to the maximum offset distance.
here a simple test but you must sort polygon by area after the offset and take the biggest area (not sure it is 100 % true)
3 recursions
That’s a classic “bounce” solver task:
- After finding orientation (thus what is inward … thus value of the offset var) define a “small” offset step.
- Loop using (Plan A) the crap R offset Method and each time check if the result yields self Ccx Events (there’s a handy R Method for that) or (Plan B) do something like the captured test (added perp lines to help you to get the gist of the approach):
- If you arrive into an self ccx Event (Plan A) or no Valid Crvs (Plan B), divide step by 2.0 and backtrace the offset (i.e. start from the last OK result).
- Continue until the (smaller and smaller) step is less than some (rational) value.