Ion trajectory simulation for electrode configurations with arbitrary geometries