Archicad C++ API
About Archicad add-on development using the C++ API.

Ray-to-object 3D intersection test method in Archicad?

Anonymous
Not applicable
Hello!

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
0 REPLIES 0