void calculateStructures(boolean rebuild) {
		if (rebuild) {
			for (int i = JmolConstants.SHAPE_MAX_SECONDARY; --i >= JmolConstants.SHAPE_MIN_SECONDARY;)
				shapes[i] = null;
			clearPolymers();
			mmset.clearStructures();
			initializeGroupBuild();
			for (int i = 0; i < atomCount; i++)
				checkNewGroup(i);
			finalizeGroupBuild();
			buildPolymers();
			structuresDefined = false;
			moleculeCount = 0;
		}
		if (!structuresDefined)
			mmset.calculateStructures();
		mmset.freeze();
	}