Text this: A generalized laser simulator algorithm for optimal path planning in constraints environment