def get_triangle_angles(triangle: plt.Polygon) -> tuple: points = triangle.get_xy() a, b, c = points[:-1] abc = rustic.get_angle(a, b, c) bac = rustic.get_angle(b, a, c) bca = rustic.get_angle(b, c, a) return abc, bac, bca
def clone_patch(init_patch): if init_patch is None: return None else: result = Polygon(xy=dummy_xy, closed=init_patch.get_closed()) result.update_from(other=init_patch) result.set_xy(np.copy(init_patch.get_xy())) init_patch.axes.add_patch(result) assert is_the_same_contour(p1=result.get_xy(), p2=init_patch.get_xy()) return result