Skip to content

Commit

Permalink
fixed angle labeling in 3D
Browse files Browse the repository at this point in the history
  • Loading branch information
jemmybutton committed Oct 4, 2023
1 parent 70b99b5 commit f30a70d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion byrne.mp
Original file line number Diff line number Diff line change
Expand Up @@ -3201,10 +3201,18 @@ vardef byNamedAngleSidesFull (text anglesList)(text linesList)=
enddef;

vardef byLabelAngleSide(suffix centerPoint, targetPoint) =
save labelVector;
pair labelVector;
image(
if (textLabels):
if (attributeExists("point", "XYZ", str centerPoint)
and attributeExists("point", "XYZ", str targetPoint)):
labelVector := projectPointIfInSpace(unitvectorXYZ(pointXYZ.targetPoint - pointXYZ.centerPoint));
else:
labelVector := unitvector(targetPoint-centerPoint);
fi;
draw byTextLabel(pointLabel)(str targetPoint,
centerPoint + (unitvector(targetPoint-centerPoint)*1/2angleSize*angleScale)/scaleFactor, angle(targetPoint - centerPoint), textLabelShift);
centerPoint + (labelVector*1/2angleSize*angleScale)/scaleFactor, angle(targetPoint - centerPoint), textLabelShift);
fi;
)
enddef;
Expand Down

0 comments on commit f30a70d

Please sign in to comment.