(three_point_sets: Sequence[Tuple[Point23, Point23, Point23]], 
              orig_poly: OpenSCADObject, 
              fillet_rad: float, 
              remove_material: bool=True)
return poly
Return a polygon with arcs of radius `fillet_rad` added/removed (according to
    `remove_material`) to corners specified in `three_point_sets`. 

    e.g. Turn a sharp external corner to a rounded one, or add material
    to a sharp interior corner to smooth it out.
Return a polygon with arcs of radius `fillet_rad` added/removed (according to
    `remove_material`) to corners specified in `three_point_sets`.
Return a polygon with arcs of radius fillet_rad added / removed ( according to remove_material ) to corners specified in three_point_sets .
def fillet_2d(three_point_sets: Sequence[Tuple[Point23, Point23, Point23]], 
              orig_poly: OpenSCADObject, 
              fillet_rad: float, 
              remove_material: bool=True) -> OpenSCADObject:
    """
    Return a polygon with arcs of radius `fillet_rad` added/removed (according to
    `remove_material`) to corners specified in `three_point_sets`. 

    e.g. Turn a sharp external corner to a rounded one, or add material
    to a sharp interior corner to smooth it out.
    """
    arc_objs: List[OpenSCADObject] = []
    # TODO: accept Point3s, and project them all to z==0
    for three_points in three_point_sets:
        a, b, c = (project_to_2D(p) for p in three_points)
        ab = a - b
        bc = b - c

        direction = direction_of_bend(a, b, c)

        # center lies at the intersection of two lines parallel to
        # ab and bc, respectively, each offset from their respective 
        # line by fillet_rad
        ab_perp = perpendicular_vector(ab, direction, length=fillet_rad)
        bc_perp = perpendicular_vector(bc, direction, length=fillet_rad)
        center = offset_point(a,b,c, offset=fillet_rad, direction=direction)
        # start_pt = center + ab_perp
        # end_pt = center + bc_perp

        start_degrees = degrees(atan2(ab_perp.y, ab_perp.x))
        end_degrees   = degrees(atan2(bc_perp.y, bc_perp.x))

        # Widen start_degrees and end_degrees slightly so they overlap the areas
        # they're supposed to join/ remove.
        start_degrees, end_degrees = _widen_angle_for_fillet(start_degrees, end_degrees)

        arc_obj = translate(center.as_arr())(
            arc_inverted(rad=fillet_rad, start_degrees=start_degrees, end_degrees=end_degrees)
        )
        arc_objs.append(arc_obj)

    if remove_material:
        poly = orig_poly - arc_objs 
    else:
        poly = orig_poly + arc_objs 

    return poly
def fillet_2d ( three_point_sets : Sequence [ Tuple [ Point23 , Point23 , Point23 ] ] , orig_poly : OpenSCADObject , fillet_rad : float , remove_material : bool = True ) -> OpenSCADObject : arc_objs : List [ OpenSCADObject ] = [ ] # TODO: accept Point3s, and project them all to z==0 for three_points in three_point_sets : a , b , c = ( project_to_2D ( p ) for p in three_points ) ab = a - b bc = b - c direction = direction_of_bend ( a , b , c ) # center lies at the intersection of two lines parallel to # ab and bc, respectively, each offset from their respective  # line by fillet_rad ab_perp = perpendicular_vector ( ab , direction , length = fillet_rad ) bc_perp = perpendicular_vector ( bc , direction , length = fillet_rad ) center = offset_point ( a , b , c , offset = fillet_rad , direction = direction ) # start_pt = center + ab_perp # end_pt = center + bc_perp start_degrees = degrees ( atan2 ( ab_perp . y , ab_perp . x ) ) end_degrees = degrees ( atan2 ( bc_perp . y , bc_perp . x ) ) # Widen start_degrees and end_degrees slightly so they overlap the areas # they're supposed to join/ remove. start_degrees , end_degrees = _widen_angle_for_fillet ( start_degrees , end_degrees ) arc_obj = translate ( center . as_arr ( ) ) ( arc_inverted ( rad = fillet_rad , start_degrees = start_degrees , end_degrees = end_degrees ) ) arc_objs . append ( arc_obj ) if remove_material : poly = orig_poly - arc_objs else : poly = orig_poly + arc_objs return poly