def test_basic(points: List[PortedPoint], holes: List[int], is_external: bool) -> None: result = PortedContour(points, holes, is_external) assert result.points == points assert result.holes == holes assert result.is_external == is_external
def to_bound_with_ported_contours_pair( bound_with_ported_vertices_pair: Tuple[List[BoundPoint], List[PortedPoint]], holes: List[int], is_external: bool) -> Tuple[BoundContour, PortedContour]: bound_vertices, ported_vertices = bound_with_ported_vertices_pair return (BoundContour(bound_vertices, holes, is_external), PortedContour(ported_vertices, holes, is_external))
def test_basic(points_lists_pair: Tuple[List[BoundPoint], List[PortedPoint]], holes: List[int], is_external: bool) -> None: bound_points, ported_points = points_lists_pair bound, ported = (BoundContour(bound_points, holes, is_external), PortedContour(ported_points, holes, is_external)) assert are_bound_ported_contours_equal(bound, ported)
def test_basic(contour: PortedContour) -> None: result = contour.set_counterclockwise() assert result is None
def test_reversed(contour: PortedContour) -> None: reversed_contour = PortedContour(contour.points[::-1], contour.holes, contour.is_external) assert implication(bool(contour.points), contour.is_clockwise is not reversed_contour)
def test_basic(contour: PortedContour) -> None: result = contour.clear_holes() assert result is None
def test_properties(contour: PortedContour) -> None: contour.clear_holes() assert not contour.holes
def test_basic(contour: PortedContour, hole: int) -> None: result = contour.add_hole(hole) assert result is None
def test_properties(contour: PortedContour, hole: int) -> None: contour.add_hole(hole) assert len(contour.holes) > 0 assert contour.holes[-1] == hole