Longest and Shortes Lines inside ClosedCrv

In this peanut shaped geometry, including a “T”, how do I make Grasshopper find me all longest (orange) and shortest (blue) lines?

Currently I’ve done this manually using Rhino’s “Line perpendicular two curves” command. I have over 650 peanuts though, so it’s impossible to do.

Source file: peanut.3dm (68.1 KB)

Many thanks!

ps. For reference, although it didn’t work: Extract the longest and shortest length of a geometry

What about this one? (red)


Finding double-perpendicular lines is possible.
I’m sure with something like this: Derivative graph on a rolled up toroidal space. - Grasshopper you can find all the line segments.

… but sorting them between

is probably … unreliable.
What is the “rule”?
A line is “short” if other near are longer? (and vice-versa)
Or, if the start and and point of the line are (both) in a convex part of the main curve, it is a “long”, and opposite if in concave is “short”? If so, what about one that start in concave and end in convex?

Here, in your peanut there are some more double-perpendicular lines than what you guessed:

Used again that “derivative torus graph” of mine.
(Does this thing even have a proper name? … It’s just a pseudo: “let’s avoid math and solve everything with geometrical construction” … :upside_down_face: )

2020-03-10 16_42_13-Window
peanut_V0.1.gh (30.8 KB)
Comments inside…

Not even that much components… the “algorythm” is not even much complex.
DataTrees appeared (and promptly avoided) just because the “IsoVist Ray” component failed for me… so i used CCX instead (and so I had to pick the first intersection).

Some last step you could do is to re-check if a found line is really double-perpendicular to start curve.
And maybe try to merge very similar lines to a single one. (I don’t know if “Remove duplicate lines” component do an average or “leave one” …)

Hope it helps!

Just an idea

idea.gh (12.1 KB)