Are you using the very latest release? I think it's an over site. Try bond.setDisplay(IBond.Display.Solid);
On Tue, 20 Aug 2019 at 16:40, Tim Dudgeon <[email protected]> wrote: > Hi, I'm wanting to depict a molecule without sterochemistry, but the > DepictionGenerator stubbornly seems to add it back. > What is the way to do this? In the example below a squiggle bond is > displayed even though all bonds have been set to Stereo.NONE and I have > already layed out the molecule. > > void "no stereo"() { > > IAtomContainer mol = ChemUtils.readSmiles("c1ccc(N=C2SCCN2c2ccccc2)cc1") > StructureDiagramGenerator sdg = new StructureDiagramGenerator(); > sdg.setMolecule(mol); > sdg.generateCoordinates(new Vector2d(0, 1)); > mol = sdg.getMolecule(); > for (IBond bond : mol.bonds()) { > bond.setStereo(IBond.Stereo.NONE); > } > DepictionGenerator g = new DepictionGenerator() > Depiction d = g.depict(mol) > > when: > def img = d.toImg() > ByteArrayOutputStream out = new ByteArrayOutputStream(); > ImageIO.write(img, "png", out); > out.close(); > byte[] png = out.toByteArray(); > Files.write(java.nio.file.Paths.get("/tmp/myimage5.png"), png) > > then: > png != null png.length > 0} > > > _______________________________________________ > Cdk-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/cdk-user >
_______________________________________________ Cdk-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/cdk-user

