Does anyone know of a simple control in grasshopper to find a point(parameter) on a gently curving 2d curve at a given slope.
I have been experimenting with graphing all slopes on curve at even intervals,then interpoloating data to find my slope, it just seems very involved.I am hoping there is a control or cluster that is readily available.
i have searched the discourse forum and internet with little success.
Probably not the one component fits all solution you were hoping for, but anyway…You can specify a slope and it will find the corresponding point (with a little leeway for rounding) For purposes of visibility, I scaled your curve x100 in the y direction to do all the geometry.
Method I use in Rhino, not Grasshopper for curves without wiggles:
Create line with the desired slope CrvDeviation to find the closest and furtherest points
Depending on whether the curve is convex or concave relative to the test line, the point with the same slope is either the closest or futherest point. Find Slope.3dm (1.5 MB)
I figured I’d try @davidcockey’s method in GH. Definitely simpler than mine. It uses the Curve Proximity component which looks for the closest point between two curves. As mentioned elsewhere, the curve can’t have any squiggles.
David
thanks for the reply, your method is like snapping a line tangent to the curve(like i would do it in solidworks).
however, my curve is a raw ,precision cmm measurement of a master sphere+system noise.
i have a calibration file with thouands of points that represent the error in my probe tip.
this file is two column data (slope and error at that slope) and need to superimpose it on the raw curve data, so i need grasshopper or rhinoscript for automation.
Ethan
thanks for the quick reply
this method is basically the same as mine. A lot of “stuff” to get a simple answer.
i was surprised that threre was not a stock control available.
Pascal had shown me some of the new slope tools in V7 for surfaces when released,but seems 2d was not on anyones radar.
thanks for looking and giving me ideas.
Phil
not sure if i completely understood. Why do you need to find a specific slope ?
can t the information of the calibration be represented (approximated) geometrically ?
another thought - you might benefit from using a line-arc approximation of the initial curve.
then query each segment of this polycurve.
what does the screenshot in your initial post show ? or is your problem already solved ?
Tom
at the risk of sounding rude(which is not my intention), in my original question i was asking if there was a control available to do this, my image was of my version, which works but is cluttered, i was hoping for a pointer to a food 4 rhino download. That said i appreciate what you have posted, my problem is solved already, this is a small aspect of overall project, and was looking for something clean and reliable.
This problem should probably be solved using the 1st derivative of curve and a converging search using a tree,
but that stuff still gives me nighmares whenever i delve into the data tree world.i Know that some of the superstars here would make this so slick, but i am not asking for it to be solved ,unless perhaps if you count an existing control that i was asking about.
i also do appreciate your input, there are always many ways to solve a problem and this place is where i get most of my ideas to solve problems,so thanks for contributing.
Kind regards
Phil
Resurecting an old topic because I am experiencing the same as Philip above.
The proposed solution is quite simple and elegant !
But the approach identified above had one limit: It does not work with wigely curves.
I have a case with a curve which is unfortnuately wiggely.
I was thinking : there must be a more mathematical approach to the challenging task of finding the precise point(S) where a given curve has a x slope (degree or percentage…) ? However I am far from being a math wizzard…
I just thought : A curve is defined by an equation - can this lead to the solution ? I remember that the derivative of a given curve gives us the slope… but lets be honnest : I do not know where I am going and neither how to implement that in Grasshopper - so it is kind of a little SOS if anyone has an idea on how to deal with these math…
Some background. Rhino uses parametric equations for curves with x, y and z each being a function of a parameter u. One of the reasons this method is used is because it works in three dimensions. It is also compatible with the parametric equations used for surfaces. Rhino uses a NURBS forumulation for both curves and surfaces.
With the parametric equations the slope is not equal to simple first derivative. If the curve is planar and parallel to the xy, xz or yz planes then the slope in the two dimensional sense will be equal to dy/du / dx/du; dz/du / dx/du or dz/du / dy/du. In other situations calculating the “slope” is a bit more complicated but can entirely feasible and will depend on how “slope” is defined.
The direction of a 3D curve at a point is usually defined as a vector tangent to the curve at that point.
David
My original question was for a 2d planar curve only. That being said i cant remember if i solved it or not. i was hoping for a “reverse” component of eval curve , ie point(s) at a cetain slope.
Phil
This thread is three years old but it’s a slow day…
This version works on two curves at once. ‘Slope_1’ slider sets the target slope on the smooth curve at the bottom, ‘Slope_2’ slider sets the target slope on the wiggly curve (which has multiple points that match the target slope, even though I show only one).
Slope angles are measured relative to X and Y directions respectively and use absolute value, but all of that could be changed.
Mhmmm interesting - Is a funny rabbit hole to dive in.
Both solutions (spaghetis script from Joesph, and VB from Philip’s best friend) work in a discrete approach by testing x points along the curve if I am correct ?