code: private IRenderingElement generatePolymerSgroup(Sgroup sgroup, Map<IAtom, AtomSymbol> symbolMap) {
          // draw the brackets
          List<SgroupBracket> brackets = sgroup.getValue(SgroupKey.CtabBracket);
          if (brackets != null) {
  
              SgroupType type = sgroup.getType();
  
              String subscript = sgroup.getValue(SgroupKey.CtabSubScript);
              String connectivity = sgroup.getValue(SgroupKey.CtabConnectivity);
  
              switch (type) {
                  case CtabCopolymer:
                      subscript = "co";
                      String subtype = sgroup.getValue(SgroupKey.CtabSubType);
                      if ("RAN".equals(subtype))
                          subscript = "ran";
                      else if ("BLK".equals(subtype))
                          subscript = "blk";
                      else if ("ALT".equals(subtype))
                          subscript = "alt";
                      break;
                  case CtabCrossLink:
                      subscript = "xl";
                      break;
                  case CtabAnyPolymer:
                      subscript = "any";
                      break;
                  case CtabGraft:
                      subscript = "grf";
                      break;
                  case CtabMer:
                      subscript = "mer";
                      break;
                  case CtabMonomer:
                      subscript = "mon";
                      break;
                  case CtabModified:
                      subscript = "mod";
                      break;
                  case CtabStructureRepeatUnit:
                      if (subscript == null)
                          subscript = "n";
                      if (connectivity == null)
                          connectivity = "eu";
                      break;
              }
  
              // connectivity doesn't matter if symmetric... which is hard to test
              // here but we can certainly ignore it for single atoms (e.g. methylene)
              // also when we see brackets we presume head-to-tail repeating
              if ("ht".equals(connectivity) || sgroup.getAtoms().size() == 1)
                  connectivity = null;
  
              return generateSgroupBrackets(sgroup,
                                            brackets,
                                            symbolMap,
                                            subscript,
                                            connectivity);
          } else {
              return new ElementGroup();
          }
      }
docs: Generates polymer Sgroup elements.
  
  @param sgroup the Sgroup
  @return the rendered elements (empty if no brackets defined)