generateMolList function

List<Model3D<Model3D>> generateMolList(
  1. int n,
  2. Molecule mol
)

Implementation

List<Model3D> generateMolList(int n, Molecule mol) {
  final double scale = 20;
  List<Model3D> mols = [];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      for (int k = 0; k < n; k++) {
        mols.add(mol.moveAndClone(
            Vector3(i.toDouble(), j.toDouble(), k.toDouble()) * scale));
      }
    }
  }
  return mols;
}