Thanks a lot for the comprehensive answer, Paolo. This also explains why changing the DrawingOptions.dash parameter does not change anything.
Kind regards, Axel On 26.03.19 16:12, Paolo Tosco wrote:
Dear Axel, looking at rdkit/Chem/Draw/cairoCanvas.py it appears that the DrawingOptions.dash parameter is ignored and dash is hardcoded to (3, 3). Please apply the following changes if you wish the DrawingOptions.dash to be honoured: --- ./third-party/Python/lib/python3.6/site-packages/rdkit/Chem/Draw/MolDrawing.py.orig 2019-03-26 15:05:54.371731743 +0000 +++ ./third-party/Python/lib/python3.6/site-packages/rdkit/Chem/Draw/MolDrawing.py 2019-03-26 15:06:16.683144329 +0000 @@ -203,7 +203,7 @@ if not dash: self.canvas.addCanvasPolygon(poly, color=color) elif self.drawingOptions.wedgeDashedBonds and self.canvas.addCanvasDashedWedge: - self.canvas.addCanvasDashedWedge(poly[0], poly[1], poly[2], color=color) + self.canvas.addCanvasDashedWedge(poly[0], poly[1], poly[2], color=color, dash=dash) else: self.canvas.addCanvasLine(pos, nbrPos, linewidth=width * 2, color=color, dashes=dash) --- ./third-party/Python/lib/python3.6/site-packages/rdkit/Chem/Draw/cairoCanvas.py.orig 2019-03-26 15:06:25.459913254 +0000 +++ ./third-party/Python/lib/python3.6/site-packages/rdkit/Chem/Draw/cairoCanvas.py 2019-03-26 15:06:30.853771245 +0000 @@ -402,7 +402,7 @@ def addCanvasDashedWedge(self, p1, p2, p3, dash=(2, 2), color=(0, 0, 0), color2=None, **kwargs): self.ctx.set_line_width(kwargs.get('linewidth', 1)) self.ctx.set_source_rgb(*color) - dash = (3, 3) + #dash = (3, 3) pts1 = self._getLinePoints(p1, p2, dash) pts2 = self._getLinePoints(p1, p3, dash) However, you might be disappointed as spacing between dashes may become uneven (which is probably why spacing was hardcoded): Cheers, p. On 03/26/19 11:20, Axel Pahl wrote:Hi, is there an option to set the spacing of the dashes in a downward wedge bond using Draw.MolToImage()? In the depiction I am currently getting (attached), the dashes are very close to each other, I would like to increase the spacing. Changing the values in the tuple `Draw.DrawingOptions.dash` does not change the depiction for me. Many thanks in advance. Kind regards, Axel _______________________________________________ Rdkit-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
_______________________________________________ Rdkit-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

