code: private void ensure2dLayout(IReaction rxn) throws CDKException {
          if (!GeometryUtil.has2DCoordinates(rxn)) {
              StructureDiagramGenerator sdg = new StructureDiagramGenerator();
              sdg.setAlignMappedReaction(alignMappedReactions);
              sdg.generateCoordinates(rxn);
          }
      }
docs: Automatically generate coordinates if a user has provided reaction without them.
  
  @param rxn reaction
  @throws CDKException coordinates could not be generated