Grasshopper

algorithmic modeling for Rhino

Hi,

How can I get closest naked edge of surface to u v?

I found this function:

 IsosStatus iso = MySurface.ClosestSide(u1,v1);

but when I press dot . there are only methods like toString, Equals,

What is a proper way of getting closest naked edge of the surface?

Views: 279

Replies to This Discussion

I think IsoStatus is intended for use with .Extends() method, or perhaps some more. I mean, it's not what you want.
Look for the closest one from the collection of naked edges.
Curve[] MyNakedEdges = MySurface.ToBrep().DuplicateNakedEdgeCurves(true, false); 
double minDist = double.MaxValue;

Curve closestEdge = null;

foreach(Curve ne in MyNakedEdges){

   double t;

  ne.ClosestPoint(pt, out t);

  double dist = pt.DistanceTo(ne.PointAt(t));

  if(dist<minDist){

    minDist = dist;

    closestEdge = ne;

  }

}

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service