algorithmic modeling for Rhino
private void RunScript(Curve x, Point3d y, ref object A)
{
//We only use this method if there is a curve
if(x != null)
{
//"t" is the parameter on the curve
double t;
//A is assigned true if closest point to y is within tolerance,
//otherwise it will be assigned false, and t will not be calculated
A = x.GetClosestPoint(y, out t, doc.ModelAbsoluteTolerance);
}
}
Hi Chris
this is an updated component with upgraded code.
Now the GetClosestPoint() call in RhinoCommon changed to:
x.ClosestPoint(y, out t, doc.ModelAbsoluteTolerance)
The attached file also shows a Grasshopper-only approach to this.
Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com
hey Giulio , your component is for one cure. what about we have several curve and several point to test?
Grasshopper can handle several curves and several points with the same component. It's a question of how the data structure looks like. You can read the section on Data Trees to understand this better, inside the GH 101 Manual.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by