# Create an ethylene helix of some length and twist

# Setup
# Number of ethylene fragments per loop (circumference)
int nperloop = 10;
# C-C bond length is given by rcc
double rcc = 1.39;
# Number of ethylene units to draw in total
int nunits = 50;
# Rotation increment around circumference is deltaz
double deltaz = 360.0/(nperloop*2.0);

# Create model
newModel("helix");
for (int n=1; n<=nunits; ++n)
{
	chain(C);
	move(rcc*cos(30.0), 0.0, rcc*sin(30.0));
	rotZ(deltaz);
	chain(C,"double");
	move(rcc*cos(30.0), 0.0, -rcc*sin(30.0));
	rotZ(deltaz);
	rotX(5.0);
}

addHydrogen();
