# 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

Anyway…

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” … )

peanut_V0.1.gh (30.8 KB)