Problem with twisted curve subdivisions when trying to PerpFrame

I am trying to create a curved structure from a 2x8 wood. When trying to script this by PerpFrame it gets twisted at some point, I can’t figure out how to continue it smoothly. Rhino and script are attached, please help.


Rhino for curve.3dm (165.6 KB)

perpframe.gh (9.4 KB)

Maybe we can make life easier by sweeping it.

Thank you so much, this comes very close to solving the problem.

The only issue is that the structure will be turned into an actual bent wood model and the wood will need to be straight when it touches the ground like left base in the image I posted is touching the ground with with the 2 inch side perfectly level with the ground. The sweep in the new script bends the wood at the base.

perpframe edited v0.gh (19.6 KB)