function generateDepthAnnotation(anchor, ps) {
function drawAnnotation() {
let factor = 3;
let mlWidth = 5;
let cutSpan = 40;
let topBottomCutSpan = 20;
let cutWidth = 1;
let mlHeight = mutable machineState.thickness * UPSCALE * factor;
let mlFrom = new ps.Point(anchor.x + mlWidth * 2, anchor.y);
let mlTo = new ps.Point(anchor.x + mlWidth * 2, anchor.y + mlHeight);
let mainline = new ps.Path.Line(mlFrom, mlTo);
mainline.strokeWidth = mlWidth;
mainline.strokeColor = "white";
let drawHorizLine = (depth, spanWidth, isDashed) => {
let dFrom = new ps.Point(
anchor.x + mlWidth * 2,
anchor.y + mlHeight + depth * factor * UPSCALE
);
let dTo = new ps.Point(
anchor.x + mlWidth * 2 + spanWidth,
anchor.y + mlHeight + depth * factor * UPSCALE
);
let cutline = new ps.Path.Line(dFrom, dTo);
cutline.strokeWidth = cutWidth;
cutline.strokeColor = "white";
if (isDashed) {
cutline.dashArray = [2, 1];
}
};
parsedDepths.forEach((depth) => drawHorizLine(depth, cutSpan, true));
drawHorizLine(0, topBottomCutSpan, false);
drawHorizLine(-mutable machineState.thickness, topBottomCutSpan, false);
}
return drawAnnotation;
}