@@ -242,24 +242,27 @@ public static Point3d[] calculate3DCoordinatesForLigands(IAtomContainer atomCont
242242 * @return Point3d[] nwanted points (or zero if failed)
243243 */
244244 public static Point3d [] calculate3DCoordinates0 (Point3d aPoint , int nwanted , double length ) {
245- Point3d points [] = new Point3d [ 0 ] ;
245+ Point3d [] points ;
246246 if (nwanted == 1 ) {
247247 points = new Point3d [1 ];
248248 points [0 ] = new Point3d (aPoint );
249249 points [0 ].add (new Vector3d (length , 0.0 , 0.0 ));
250250 } else if (nwanted == 2 ) {
251+ points = new Point3d [2 ];
251252 points [0 ] = new Point3d (aPoint );
252253 points [0 ].add (new Vector3d (length , 0.0 , 0.0 ));
253254 points [1 ] = new Point3d (aPoint );
254255 points [1 ].add (new Vector3d (-length , 0.0 , 0.0 ));
255256 } else if (nwanted == 3 ) {
257+ points = new Point3d [3 ];
256258 points [0 ] = new Point3d (aPoint );
257259 points [0 ].add (new Vector3d (length , 0.0 , 0.0 ));
258260 points [1 ] = new Point3d (aPoint );
259261 points [1 ].add (new Vector3d (-length * 0.5 , -length * 0.5 * Math .sqrt (3.0 ), 0.0f ));
260262 points [2 ] = new Point3d (aPoint );
261263 points [2 ].add (new Vector3d (-length * 0.5 , length * 0.5 * Math .sqrt (3.0 ), 0.0f ));
262264 } else if (nwanted == 4 ) {
265+ points = new Point3d [4 ];
263266 double dx = length / Math .sqrt (3.0 );
264267 points [0 ] = new Point3d (aPoint );
265268 points [0 ].add (new Vector3d (dx , dx , dx ));
@@ -269,7 +272,8 @@ public static Point3d[] calculate3DCoordinates0(Point3d aPoint, int nwanted, dou
269272 points [2 ].add (new Vector3d (-dx , -dx , dx ));
270273 points [3 ] = new Point3d (aPoint );
271274 points [3 ].add (new Vector3d (-dx , dx , -dx ));
272- }
275+ } else
276+ points = new Point3d [0 ];
273277 return points ;
274278 }
275279
0 commit comments