
"""
    shotlines(target,rays)

Returns the number of hit and a list of rays that interserct with the target. 
"""
function shotlines(target::CSGGenerator{Float64},rays::Vector)

    pang =0
    shots=[]
    #Vis.draw(t)
    #Vis.draw(t, debug=true, resolution = (800, 600))
    for r in rays
        if OpticSim.surfaceintersection(target(),r) !=EmptyInterval{Float64}()
            pang +=1
            push!(shots,r)
            #Vis.draw!(r,rayscale=0.2)
            #Vis.draw!(surfaceintersection(target(),r), color=:red)
        end
    end
    return pang,shots
end
