Grasshopper

algorithmic modeling for Rhino

I want to use OnRayShooter in my C# plugin but I don't know how to use it and which namespace I should use.

I have imported all namespaces below Rhino but still I cannot call OnRayShooter.

Views: 577

Replies to This Discussion

Hi Mohammed,
the RayShoot method is in the Rhino.Geometry.Intersect namespace, try this:

Private void RunScript(Point3d P, Vector3d D, List<GeometryBase> G, int N, ref object A)
{
    Ray3d ray = new Ray3d(P, D);
    A = Rhino.Geometry.Intersect.Intersection.rayShoot(ray, G, N);
}

Dear Pieter,

Thanks for your help. It work well. just the syntax of "rayShoot" function name is incorrect. the correct name is "RayShoot" . (I think it was just a typing fault).

Again Thanks for your help

Regards

Mohammad

LOL
I myself was wondering how to efficiently get the indices of hit surfaces in a list. I was trying by meassuring distances to closest points, but I have a feeling that's not the way to go.
Of coarse I can use the Collision One/Many component, but I'd like to learn how to implement that in the RayShoot scripted component.

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