Problem with Sweep1 for rectangular railing

Hi everyone,

I’m trying to create a rectangular railing using closed outlines.
My current approach is to use Sweep1 with a rectangular profile.

However, I’m running into a few problems:

  1. One Sweep1 cannot sweep the entire border curve correctly.
    Some segments of the rail come out reversed, and I need to Flip the profile direction for different parts of the curve.

  2. The corner regions do not sweep correctly.
    At the rectangular corners, the profile orientation breaks and the geometry becomes distorted or incorrect.

I’m wondering:

  • Is Sweep1 the right tool for this kind of geometry?

  • Is there a better workflow to sweep a profile along a closed rectangular border without flipping directions?

  • Would tools like Sweep2 be more appropriate?

Any advice or example files would be greatly appreciated.

Thanks in advance!

railing.gh (24.6 KB)