# Curvature Extremes through RhinoCommon

Hi,

I’m looking for a way to find extreme curvatures on a curve.
I suspect there is a faster implementation that just sample along a curve at a specific resolution.
Can someone explain to me where to sample a curve to find the extreme curvatures?

I suspect it’s probably at knots and or other NurbsCurve points, yet my knowledge in that area is very limited.

Thanks
-Willem

I somewhere posted a method some while ago. somewhere in this forum or in the old one.

What I did:I walked down the curve, measuring the change of curvature (from curvature at t and t+(a tiny bit)) and plotted it in a simple x-y (or to be more exact the t-deltaC) diagram. Then I interpolated all values and intersected it with y=0 line. These are the areas where the curvature change is 0, which is true for any extreme and infliction point.

In r6 there is this method:
https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_Curve_ExtremeParameters.htm

I have not used it before so I don’t know how easy it is to implement

Right, completly forgot about it. However I remember that it just returns the extreme values, but not the infliction points, in case this is important as well.

Hi Lando and @TomTom

I’m not looking for extremes in the curve, but rather in the curvature curve.

what I’m looking for is the extremes in the CurvatureGraph:

If I would have the curvature graph I could use the ExtremeParameters method to find the points I’m looking for. specifically I want to find if a curve has extreme curvature to filter unwanted micro loops or near loops:

Does that make sense?

-Willem

this is what it does. I‘ll post it tomorrow.

the curvature is visualised (factorised) by the curvature graph. if you evaluate the change of the curvature in steps you know if the curvature increases or decreases (graph gets bigger or smaller). If it flips from increasing to decreasing or vice versa, you are at a extrem location. so for a specific t there is the change 0. Does this explanation makes sense? You can always solve differential equations discret(stepwise) when coding.

1 Like

Here it is,

could be optimised in a way that it walks the curve more intelligent.
It also shows infliction points. Be aware that this curve is 3d.

extremas2.gh (14.5 KB)

2 Likes

Hoi Menno,

Yes, they are always planar indeed.
You make me curious …

-Willem

Willem, I found this paper that seems to be relevant.

Hi Menno,

Thanks, but I’m afraid that is out of my league atm.
I’ll see if @TomTom 's solution is faster than my current implementation.

Thanks
-Willem