I am doing raycasting using below code.
ReferenceIntersector intersector = new ReferenceIntersector(uidoc.ActiveView as View3D);
IList<ReferenceWithContext> references = intersector.Find(point1, point2 - point1);
foreach (ReferenceWithContext reference in references)
{
ElementId id = reference.GetReference().ElementId;
}
It takes around 13 seconds to do around 10,000 ray casting in this situation.
Is there any efficient way to do ray casting in Revit API.
Are there any alternatives of ReferenceIntersector?
No, sorry.
Is that really slow? Is that not very fast, actually?
Would you like to share a reproducible case including a sample model and benchmarking code?
https://thebuildingcoder.typepad.com/blog/about-the-author.html#1b
In my current project, I might need to do maybe 100,000 or more ray casting, and doing Ray casting using ReferenceIntersector might be inefficient.
Unfortunately, I won't be able to share a reproducible case.
Me and my team are trying to see what else can we do to increase the efficiency.
Thanks for replying.
I implemented a specific raytracing functionality twice over, using the Revit raytracer and the threejs one in the Forge viewer:
https://thebuildingcoder.typepad.com/blog/2017/03/threejs-raytracing-in-the-forge-viewer.html
That might provide a viable alternative for you too.
Cheers,
Jeremy
Thanks for the idea.
I am still a bit confused by that documentation.
I am working with .NET framework. I'll be implementing it in C#. I can see first, we need Mesh objects, and then we can call RayCaster Object. I am also searching for how to get Meshes of an element or a Family Type.
Is there any documentation or GitHub page where I can find examples of implementing RayCaster in Revit API, using .NET framework?
Thank you again.
RayCaster is for use in the browser JavaScript implementation. No support for .NET, no support for C#.
Can't find what you're looking for? Ask the community or share your knowledge.