I am trying to get Minimum Radius range of Curved Surfaces in grasshopper. Is there anyway to get that value in grasshopper? later I want to use those values to cull out the surfaces from the list, that are exceeding the required range of Minimum radius.
In rhino with curvature analysis I can get this range easily. But then I have to pick the surface one by one. It would be great if anyone can tell me how to find Minimum Radius Range of Surface in grasshopper.
ps. I do not necessarily want to have color gradient. Just the range is fine.
I have a variety of C#'s that do a variety of things related with surface Lists curvatures (Gauss, Mean, Kappa etc etc). I could add a few lines (if required) and do anything imaginale (including custom queries, visual indication options etc etc).
Notify if you think that a similar “black box” (if you are not familiar with code) solution could be useful to you.
Indeed there’s various more things available on that C# captured written for “similar” (but not the same) facade pre-proccesing purposes.
I’ll add soon (max ETA: this w/e) some Osculating R options (min, max, average) to the most suitable - existed - C# … plus corresponding queries to locate topics of interest [either vertices or mesh quads].
Thanks for you help so far.
I tried using the part of script you made to get the result I needed.
I think I’m pretty much there but for some reason second value in curvature range is always coming out higher from the script if I happen to compare with curvature analysis in Rhino.
Can you tell me where am I going wrong?
find attached script and image
List<double> range = new List<double>();
CurvatureRange_MinRadius(srf, U_num, V_num, out range);
A = range;
public void CurvatureRange_MinRadius(Surface srf, int uNum, int vNum, out List curvatureRange)
curvatureRange = new List();
List<double> remMin = new List<double>();
//List<double> remMax = new List<double>();
// parameterize surface
srf.SetDomain(0, new Interval(0, 1));
srf.SetDomain(1, new Interval(0, 1));
for(int i = 0; i <= uNum;i++)
for(int j = 0; j <= vNum; j++)
double iun = i / (double) uNum; //conver all the value here from whatever to 0 to 1
double ivn = j / (double) vNum; //conver all the value here from whatever to 0 to 1
SurfaceCurvature srfCrv = srf.CurvatureAt(iun, ivn);
double minRad = srfCrv.OsculatingCircle(1).Radius; remMin.Add(minRad);
double maxRad = srfCrv.OsculatingCircle(0).Radius; remMin.Add(maxRad);
Can you tell me what exactly rangeR value does?
Is it like Auto Range? I think this rangeR value has to be unique for every surface.
when it is adjusted it gives me right output for that particular one surface but other values get messed up.
BTW: Using the best brain boosters available (Huan Valdez espresso + cigars) … I can’t see why a global searchR is a bad thing: Imagine having 2 surfaces: a flatish one (meaning sky high R values) and a heavily curved one (meaning “reasonable” R values). So … a globalR just excludes values from the flatish related Interval … that nobody needs anyway. That said if you remove that Interval inclusion filter you’ll get lot’s of NaN values (flat portions in the demo surface list). Nor has any meaning testing against, say, *Math.Sign(d)int.MaxValue (not to mention double.MaxValue or double.IsNaN(d) or double.IsPositiveInfinity(d) blah, blah).
Added some visual indication related with the outOfRange U/V pts.