// This macro draws the Feret diameter of the current area selection. macro "Draw Feret" { requires("1.43a"); if (selectionType==-1) exit("Area selection required"); List.setMeasurements; length = List.getValue("Feret"); x1 = List.getValue("FeretX"); y1 = List.getValue("FeretY"); angle = List.getValue("FeretAngle"); drawFeret(x1, y1, angle, length); } function drawFeret(x1, y1, angle, length) { if (angle<=90) angle = -angle; else angle = 180-angle; angle = angle*(PI/180); getVoxelSize(w, h, d, unit); if (w!=h) exit("Square pixels required"); x1 /= w; y1 /= h; length /= w; x2 = x1 + length*cos(angle); y2 = y1 + length*sin(angle); drawLine(x1, y1, x2, y2); }