Two-step magnetic self-alignment of folded membranes for 3D nanomanufacturing