low level utils for polyline miter joins