# Building a molecule using the pen - Benzene

# Variables
int n;
double lcc,lch;

# The variables 'lcc' and 'lch' contain the bond lengths to use
lcc = 1.39;
lch = 1.00;

# Create a new model
newModel("benzene");

# Draw the molecule in the XY plane - all our rotations will be about the z axis
# Pen starts at the origin but the first carbon will be at {0 lch 0}
for (n=0; n<6; ++n)
{
	move(0.0,lcc,0.0);
	newAtom("C");
	rotZ(-60.0);
	move(0.0,lch,0.0);
	newAtom("H");
	move(0.0,-lch,0.0);
	rotZ(120.0);
}

# Calculate bonding and automatically add multiple bonds
rebond();
augment();




