Skip to content

Commit 3816509

Browse files
committed
Additional ring template.
1 parent 93cad42 commit 3816509

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

tool/sdg/src/main/java/org/openscience/cdk/layout/IdentityTemplateLibrary.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,14 @@ static Point2d[] decodeCoordinates(String str) {
255255
String coord = strs[i];
256256
int first = coord.indexOf(',');
257257
int second = coord.indexOf(',', first+1);
258-
points[i] = new Point2d(Double.parseDouble(coord.substring(0, first)),
259-
Double.parseDouble(coord.substring(first + 1, second)));
258+
String x = coord.substring(0, first);
259+
String y = coord.substring(first + 1, second);
260+
if (x.isEmpty())
261+
x = "0";
262+
if (y.isEmpty())
263+
y = "0";
264+
points[i] = new Point2d(Double.parseDouble(x),
265+
Double.parseDouble(y));
260266
}
261267
return points;
262268
} else {

tool/sdg/src/main/resources/org/openscience/cdk/layout/custom-templates.smi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ C1CC2CCC3CCC1C23 |(-1.6,-1.46,;-2.9,0.79,;-1.6,1.54,;-1.6,3.04,;0.99,3.04,;0.99,
1010
C1CC2CCC3CCC4CCC1C243 |(-7.59,6.15,;-5.47,6.15,;-5.47,4.65,;-3.97,4.65,;-3.97,2.53,;-5.47,2.53,;-5.47,1.03,;-7.59,1.03,;-7.59,2.53,;-9.09,2.53,;-9.09,4.65,;-7.59,4.65,;-6.53,3.59,)|
1111
C1C2CC1C2 |(-7.46,4.51,;-8.52,5.57,;-9.58,4.51,;-8.52,3.44,;-8.28,4.54,)|
1212
C1CC2CCC1CC2 |(0,0,;0,1.5,;1.3,2.25,;2.6,1.5,;2.6,0,;1.3,-0.75,;1.55,0.25,;1.55,1.25,)|
13-
C1CCC23CCCCC3CCCC2C1 |(-2.58,1.88,;-1.28,2.63,;0.5,1.73,;-0.01,0.37,;-0.52,1.69,;1.29,2.62,;2.59,1.87,;2.59,0.37,;1.29,-0.38,;1.28,-1.88,;-0.02,-2.63,;-1.31,-1.88,;-1.31,-0.38,;-2.59,0.38,)|
13+
C1CCC23CCCCC3CCCC2C1 |(-2.58,1.88,;-1.28,2.63,;0.5,1.73,;-0.01,0.37,;-0.52,1.69,;1.29,2.62,;2.59,1.87,;2.59,0.37,;1.29,-0.38,;1.28,-1.88,;-0.02,-2.63,;-1.31,-1.88,;-1.31,-0.38,;-2.59,0.38,)|
14+
C1CC23CCCC3(C1)CCC2 |(-2.31,-0.02,;-1.43,1.2,;,0.73,;1.43,1.2,;2.31,-0.02,;1.43,-1.23,;,-0.77,;-1.43,-1.23,;0.79,-1.45,;1.37,-0.02,;0.77,1.45,)|

0 commit comments

Comments
 (0)