# Align planes extrude along curve

Hi there,
I am having some trouble running an extrusion without distorting it along a curve. Its not the cleanest curve (for stair railing and side beam) and I am trying to set frames along the curves to loft them. I have a definition that I found from the discussions and tried to modify it a bit but haven been able to make it work. The goal is to have the x,y,z to match the image below.

but at some of the curves the planes start to twist and change directions. I’ve tried align plane but maybe I am using it wrong?

if you know any tutorials or discussions I can follow along to fix this please send over

AlignPlanes-ExtrudeAlongCurve_v1.3dm (33.6 KB)
AlignPlanes-ExtrudeAlongCurve_v1.gh (18.7 KB)

I think you can take the parameters t directly from the divide curve, instead of going through Curve Closest Point?

you can use Align Plane with a Direction vector, the component will rotate the planes around their Z axis, in such a way their x-axis is aligned with the Direction vector

here is before Align Plane:

this is after Align Plane with direction +Z :

AlignPlanes-ExtrudeAlongCurve_v1_Re.gh (10.9 KB)

consider that in this case all your planes are oriented with X-axis pointing at +Z, so when you build the loft section curves (maybe more a sweep1 ?) you need to take that into account and orient your curve in such a way their top will be along X-axis

if you end-up with planes that got aligned, but their Y-axis is pointing in opposite directions, then you need to use Flip Curve because the curve has to be reversed (a trick might be to join all the railing curves together into a single one, and use that directly, or maybe to explode it and get sub-curves which are all oriented in the very same direction…)

1 Like

dam, I was way off haha. thanks a ton
this is perfect