# Trying to connect two rectangles with sweep aloing the curve

I am trying to connect two rectangles with sweep aloing the curve.

``````reset
#{y0= 10}
#{z0= 15}
create surface rectangle width 5 height 7 xplane
create surface rectangle width 5 height 7 xplane
move Surface 2 x 0 y {y0} z {z0} include_merged
create vertex location 0 {y0/2} {z0/2}
create vertex location 0 0 0
create vertex location 0 {y0} {z0}
#{t=atan2(z0,y0)}
create curve arc center vertex 9 10 11 normal 0 {sin(t)} {-cos(t)}
sweep surface 2  along curve 9   keep  individual draft_angle {0}
``````

is what I have done so far. How do I sweep the surface with twisting?
I tried with draft_angle but what is something I did not expect.

hi @ksugahar,
a normal sweep unfortunately won’t work here. Normally i would suggest a loft volume for this, but that won’t work on parallel surfaces. You have to create such geometry somehow else.

One way would be to create a midplane and create tangent curves trough the edges. After that we can make a loft volume and use the curves as guides.

But you could also create surfaces out of the tangent curves and then a new volume with bounding surfaces.

``````reset
#{y0= 10}
#{z0= 15}
create surface rectangle width 5 height 7 xplane
create surface rectangle width 5 height 7 xplane
move Surface 2 x 0 y {y0} z {z0} include_merged
create vertex location 0 {y0/2} {z0/2}
create vertex location 0 0 0
create vertex location 0 {y0} {z0}
#{t=atan2(z0,y0)}
create curve arc center vertex 9 10 11 normal 0 {sin(t)} {-cos(t)}
#sweep surface 2  along curve 9   keep  individual draft_angle {0}

create surface rectangle width 5 height 7 xplane
rotate Surface 3 angle 90  about Y include_merged
move Surface 3 x {-Radius(9)} y {y0/2} z {z0/2} include_merged

create curve tangent vertex 3 14 start direction -1 0 0 end direction 0 {y0/2} {z0/2}
create curve tangent vertex 4 15 start direction -1 0 0 end direction 0 {y0/2} {z0/2}
create curve tangent vertex 2 13 start direction -1 0 0 end direction 0 {y0/2} {z0/2}
create curve tangent vertex 1 12 start direction -1 0 0 end direction 0 {y0/2} {z0/2}

create curve tangent vertex 19 7 start direction 0 {y0/2} {z0/2} end direction 1 0 0
create curve tangent vertex 14 8 start direction 0 {y0/2} {z0/2} end direction 1 0 0
create curve tangent vertex 12 6 start direction 0 {y0/2} {z0/2} end direction 1 0 0
create curve tangent vertex 21 5 start direction 0 {y0/2} {z0/2} end direction 1 0 0

create volume loft surface 1 3  guide curve 14 15 16 17
create volume loft surface 9 2  guide curve 18 19 20 21

unite vol all

delete curve all
delete vertex all
delete surface all
``````

Hi Norbert,
Thank you for your reply. I tried it and was able to implement the model.