Point4f hklParameter(int i) throws ScriptException {
		Point3f offset = viewer.getCurrentUnitCellOffset();
		if (offset == null)
			evalError(GT._("No unit cell"));
		Vector3f vAB = new Vector3f();
		Vector3f vAC = new Vector3f();
		Point3f pt = getCoordinate(i, true, false, true);
		Point3f pt1 = new Point3f(pt.x == 0 ? 1 : 1 / pt.x, 0, 0);
		Point3f pt2 = new Point3f(0, pt.y == 0 ? 1 : 1 / pt.y, 0);
		Point3f pt3 = new Point3f(0, 0, pt.z == 0 ? 1 : 1 / pt.z);
		// trick for 001 010 100 is to define the other points on other edges

		if (pt.x == 0 && pt.y == 0 && pt.z == 0) {
			evalError(GT._("Miller indices cannot all be zero."));
		}
		else if (pt.x == 0 && pt.y == 0) {
			pt1.set(1, 0, pt3.z);
			pt2.set(0, 1, pt3.z);
		}
		else if (pt.y == 0 && pt.z == 0) {
			pt2.set(pt1.x, 0, 1);
			pt3.set(pt1.x, 1, 0);
		}
		else if (pt.z == 0 && pt.x == 0) {
			pt3.set(0, pt2.y, 1);
			pt1.set(1, pt2.y, 0);
		}
		else if (pt.x == 0) {
			pt1.set(1, pt2.y, 0);
		}
		else if (pt.y == 0) {
			pt2.set(0, 1, pt3.z);
		}
		else if (pt.z == 0) {
			pt3.set(pt1.x, 0, 1);
		}
		viewer.convertFractionalCoordinates(pt1);
		viewer.convertFractionalCoordinates(pt2);
		viewer.convertFractionalCoordinates(pt3);
		pt1.add(offset);
		pt2.add(offset);
		pt3.add(offset);
		Vector3f plane = new Vector3f();
		float w = Graphics3D.getPlaneThroughPoints(pt1, pt2, pt3, plane, vAB, vAC);
		Point4f p = new Point4f(plane.x, plane.y, plane.z, w);
		Logger.info("defined plane: " + p);
		return p;
	}