optiwindnet.mesh ================ .. py:module:: optiwindnet.mesh Module Contents --------------- .. py:function:: make_planar_embedding(L: networkx.Graph, offset_scale: float = 0.0001, max_tri_AR: float = _MAX_TRIANGLE_ASPECT_RATIO) -> tuple[networkx.PlanarEmbedding, networkx.Graph] Triangulate a location and produce graphs P and A for it. P is the planar embedding mesh and A is the available-edges graph. TODO: change the name of this function. :param L: locations graph :param offset_scale: Fraction of the diagonal of the site's bbox to use as spacing between border and nodes in concavities (only where nodes are the border). :param max_tri_AR: maximum aspect ratio allowed for triangles on the hull of A as the algorithm removes flat triangles (higher values keep more). :returns: P - the planar embedding graph - and A - the available-edges graph. .. py:function:: delaunay(L: networkx.Graph, bind2root: bool = False) -> networkx.Graph DEPRECATED. Create the extended-Delaunay-based available-edges graph A. :param L: location :param bind2root: assign edge attribute 'root' (used by legacy heuristics) :returns: A - available-edges graph .. py:function:: planar_flipped_by_routeset(edges_G: set[tuple[int, int]], *, planar: networkx.PlanarEmbedding, VertexC: optiwindnet.geometric.CoordPairs, ST: int, diagonals: bidict.bidict | None = None) -> networkx.PlanarEmbedding Ajust `planar` to include the edges actually used by a routeset. Copies `planar` and flips the edges to their diagonal if the latter is an edge in `edges_G`. Ideally, the returned PlanarEmbedding includes all `edges_G` (an expected discrepancy are gates). `edges_G` is the set of routeset edges in prime-id form (i.e. clones already mapped through `fnT`), each as a normalized `(u, v)` pair with `u < v`. Gate edges have `u < 0`. `ST` is `T + B` (the boundary above which constraint vertices live). If `diagonals` is provided, some diagonal gates may become `planar`'s edges if they are not crossing any edge in `edges_G`. Otherwise gates are ignored. Important: the routeset must be free of edgeƗedge crossings.