Equally divided truss

I would like to generate an equally divided truss over a curved surface I built in Rhino.
I used control points to make the surface curved, and then I rebuilt it again.
however, the division is not equal- some parts of the truss are streched along the Z axis.
since I want all of the panels between the pipes to have the same area and dimensions- what should I add to the code?