I have a user defined curve. For fabrication purposes, I need to divide the curve at the inflection points (where the 2nd derivative = 0). There is need to specify a thickness at the local min and max points (where the 1st derivative = 0). I would like to do this all in Grasshopper with a clean flow of data, for purpose of later manipulations and fabrication. Currently, I am marking the points in Rhino, then referencing those points in GH.
Rhinocommon V6 has method to get the extremas of a NurbsCurve. If you cant script you can also make a simple hodograph. Just sample you curve and display m values in a xy plane, where x is t and y is m.interpolate the 2dpoints and intersect at m=0 and get the t value
I cannot script, so I tried make a hodograph, but I cant quite visualize your instructions. Is this what you mean by sampling my curve? I analyzed for the first derivative at 1000 points along the curve.
If your curve does not have any kinks or rational weights, you can derive an analytical form for the hodograph without any need for sampling / interpolation:
@qythium, I really like your approach. However I am not knowledgeable of scripting, so I cant really work with it well. For example, I also want to use this to split the curve at its inflection points.
Your script seems to work great, but it does not match with Rhinoâs _curvature command. Do you know the reason for this, and which is more accurate?
Evidently the 1st derivative vectors are not horizontal at those points. Rhinoâs _Curvature command marks out points where the curvature is at an extrema - i.e. \frac{d}{ds} ||\gamma''(s)|| =0 (where \gamma(s) is the curveâs arc-length parameterization)
It may be useful to keep in mind that youâre dealing with 3D space curves in arbitrary directions, where their derivatives are always vectors and dependent on the curveâs NURBS parameterization. Saying the first / second derivative = 0 doesnât mean anything, unless youâre specific about what (scalar) value youâre differentiating, and along what parameter.
I think there might be some confusion here - can you specify what you mean by âinflection pointsâ? Iâm assuming youâre looking at the curve as a sort of X-Y cartesian plot, and asking where \frac{d^2y}{dx^2}=0? This is not the same thing as @TomTomâs script, which plots out the curvature vs arc length. ( and is not technically a hodograph in the mathematical sense )
is it not? ⊠oh okay, good to know. Iâm not a mathematician, I took the term hodograph as a general term for plotting out (movement) relations in 2d space. By the way, its not the curvature, its the delta of curvature, which is equivalent to a differentiation of the curvature isnât it? Or am I wrong here? Isnât walking down the curve parameter kind of a velocity diagram?
Yes. I would like to find the points where the curvature flips from concave up to concave down. My understanding is that the 2nd derivative would be 0 at that point.
This has more geometrical meaning, which is why most CAD programs use it instead of parameter-domain derivatives. (difference btw C1 vs. G1 continuity)
âconcave upâ and âconcave downâ make sense in a x-y graph where X is your parameter, but not so much here where the curve itself is your parameter - think of it as driving down a curved road at constant speed and measuring if youâre accelerating to the left or right.
e.g. the curve below has no inflection points where curvature=0, but changes âup/down concavityâ
I think you are wrong on this one, or I didnât understand what you are saying:
k dependents on t, your formula, just uses the char âsâ for âtâ. The same goes for gamma. Sure first and second derivative of gamma are still dependent on t when evaluating it numerically; Because de Casteljau/de Boor require t, so does their derivatives, so does k.
What I did, I didnât evaluate the curve itself but the âcurvature curveâ. By drawing the âhodographâ I found the parameter where the acceleration of this âcurvature curveâ is 0. At the âinfliction pointsâ the acceleration is 0 because its locally not increasing curvature nor decreasing curvature and it usually âflipsâ from positive to negative or the opposite. However I didnât changed the parametric formula, I just evaluated the delta of curvature of t - curvature of t+smallStep (which is what derivation does in a non-mathematical way). So I derived k.
It was in response to Karl , I must have clicked on the wrong âReplyâ button and couldnât edit it afterwards.
I didnât realise the term âhodographâ had a more general meaning (just looked it up), had only encountered it before in the context of Bezier/Nurbs curves, where I think it has the more specific meaning of the degree n-1 curve produced by the derivative in the t parameter domain ( see the link in my first post above)
Sorry, what I meant above was that Îș is independent of the curve parameterization, because two geometrically identical curves can have different control point locations, degrees, weights, knot vectors, etc, which changes the parameter t but not s (the arc-length parameter, which is defined geometrically)
By convention I believe \kappa refers to the curvature itself, and in your hodograph you are representing the derivative of Îș with respect to t, although at equally spaced intervals along the arc length ( which is unequally spaced in the t domain)
But of course in the context of the original question ,all this doesnât really matter⊠And I think your method fits the intention well enough- I just wanted to be clear on the geometric meaning
âŠwell my method isnât perfect in any meaning. It works but I know its not the best way in solving this. However this whole NURBS topic is really hard to understand, and the moment I get the answer to one question 10 new more rise up. At least for me there is more confusion rather then understanding, and sometimes you find a solution to a problem but its much harder to prove or express it mathematically. Sounds easy to derive from k in respect to t, but doing it mathematically is quite challenging I believe. Not even sure if it works like this. Its just that anything related to math is super bad explained. Its like people writing math books donât want non-math people to know whatâs going on. ⊠or maybe its just me ⊠anyway Iâll going to enjoy my extended weekend now.