For sure, you could use the same approach to spawn tiled backgrounds or 9-patches. Set their angle however you'd like, and use raycasting to determine their length.
I suggest you also play around with some effects to find one that fits the lighting style you want. Without seeing more of your project, it's difficult to tell exactly what logic is causing problems.