You can support custom geometry and intersection by providing codes with C++ template.
See TriangleMesh, TriangleSAHPred, TriangleIntersection and TriangleIntersector class in nanort.h, and
TriangleMesh
TriangleSAHPred
TriangleIntersection
TriangleIntersector
nanort.h
examples/particle_primitive
examples/curves_primitive
examples/cylinder_primitive