"""
    target(target,xlength,ylength,zlength)

Creates a cuboid target of dimensions (xlength, ylength and zlength) at the target position
for shotline intersection computation
"""
function target(t::AbstractTarget,xlength::Float64,ylength::Float64,zlength::Float64)
    target = Cuboid(xlength, ylength, zlength)
    target = OpticSim.transform(target,OpticSim.Geometry.translation(t.position[1], t.position[2], t.position[3]))
    return target
end

"""
    target(size)

Creates a cuboid target of dimensions specified by the vector size
"""
function target(size::Vector{Float64})
    target = Cuboid(size[1], size[2], size[3])
    #target = OpticSim.transform(target,OpticSim.Geometry.translation(t.position[1], t.position[2], t.position[3]))
    return target
end

function targetPosition(target::CSGGenerator{Float64},position::Vector{Float64})
    #target = Cuboid(size[1], size[2], size[3])
    target = OpticSim.transform(target,OpticSim.Geometry.translation(position[1], position[2], position[3]))
    return target
end
