I want to make different curved walls dynamically as a rectangle toroid. I can make one at a time in blender, but I want to be able to generate different size walls on the fly.

also not pictured would be start and end degrees where a full toroid would be start 0 end 360 and the one pictured might be start 0 end 180. I could make a few different curved walls in blender and then scale but I want width of the wall to stay the same. Is there any way to do this?