Coupling boundary elements to a raytracing procedure