bluemira.geometry.inscribed_rect ================================ .. py:module:: bluemira.geometry.inscribed_rect .. autoapi-nested-parse:: Function to find inscribed rectangle. In contained file because loop module imports geomtools and geombase modules Functions --------- .. autoapisummary:: bluemira.geometry.inscribed_rect.inscribed_rect_in_poly Module Contents --------------- .. py:function:: inscribed_rect_in_poly(x_poly: numpy.ndarray, z_poly: numpy.ndarray, x_point: float, z_point: float, aspectratio: float = 1.0, *, convex: bool = True, rtol: float = 1e-06, atol: float = 1e-08) -> tuple[float, float] Find largest inscribed rectangle in a given polygon. :param x_poly: x coordinates of the polygon :param z_poly: z coordinates of the polygon :param x_point: x coordinate of the centroid of the :param z_point: z coordinate of the centroid of the rectangle :param aspectratio: aspect ratio of rectangle :param convex: treat the loop as convex default:True :param rtol: The relative tolerance parameter (see Notes) :param atol: The absolute tolerance parameter (see Notes) :returns: * *dx* -- half width of inscribed rectangle * *dz* -- half height of inscribed rectangle .. rubric:: Notes See notes of https://numpy.org/doc/stable/reference/generated/numpy.isclose.html for an explanation of relative and absolute tolerances. The tolerances only affects non convex loops in certain complex situations. Setting either value to a very small value could cause the function to hang.