def METHOD_NAME(rectangle: RotatedRectange,
               width_factor: float = 0.5,
               thickness: float = 0.001) -> Optional[np.ndarray]:
    ((cx, cy), (xwidth, ywidth), angle) = rectangle
    width = int(width_factor * min(xwidth, ywidth))
    kernel = np.zeros((width, width), dtype=np.uint8)
    try:
        kernel = cv2.cvtColor(kernel, cv2.COLOR_GRAY2BGR)
    except Exception:
        return None
    diagonal = width * np.sqrt(2)
    pos = (width // 2, width // 2)
    dim = (diagonal, thickness)
    if ywidth < xwidth:
        angle += 90
    element_rect: RotatedRectange = (pos, dim, angle)
    element_contour = cv2.boxPoints(box=element_rect)
    # https://stackoverflow.com/questions/48350693/what-is-numpy-method-int0
    element_contour = np.int0(element_contour)
    cv2.drawContours(
        image=kernel,
        contours=[element_contour],
        contourIdx=0,
        color=(1, 0, 0),
        # -1 means fill interior
        thickness=-1)
    kernel = kernel[:, :, 0]
    return kernel