compute correct ending point for miter and bevel join