The Global ARCHICAD Community

Stay informed. Get help. Share your knowledge.

Discussions about using GRAPHISOFT's tools (API DevKit) for independent software developers

Moderators: Barry Kelly, Karl Ottenstein, LaszloNagy, ejrolon, gkmethy, Tibor Lorántfy, MOREH Tamas, Akos Somorjai, Ed Brown, Mihály Palenik


Does the ARCHICAD API support detecting ray-to-object collision/intersection detection.
Revit has a pure method Document.FindReferencesWithContextByDirection which takes a ray origin, ray direction and the 3D view and returns references which collide with the ray. (in my specific case a simple boolean result would be sufficient.)

I have already manually written code to create boxes for all walls, beams, slabs, however this is not accurate enough. My collision detection uses the Möller-Trumbore intersection algorithm for the 12 surface triangles each box consists of (6 sides * 2 triangles per side). Using that algorithm it would also be helpful to get triangles for any object, so also more complicated elements (non-box, slanted walls, etc.) can be detected accurately.

Of course a one-liner method like the one I mentioned above would be preferable, but if I could get the surface geometry of elements in the form of (more accurate) triangles (or some other shape with a different algorithm) this would also help me immensely!

Thanks in advance for any help,
- Dan
Last bumped by dan on Mon Feb 04, 2019 8:50 am.