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(G: networkx.Graph, *, planar: networkx.PlanarEmbedding, VertexC: optiwindnet.geometric.CoordPairs, diagonals: bidict.bidict | None = None) -> networkx.PlanarEmbedding Ajust `planar` to include the edges actually used by routeset `G`. Copies `planar` and flips the edges to their diagonal if the latter is an edge of `G`. Ideally, the returned PlanarEmbedding includes all `G` edges (an expected discrepancy are `G`'s gates). If `diagonals` is provided, some diagonal gates may become `planar`'s edges if they are not crossing any edge in `G`. Otherwise gates are ignored. Important: `G` must be free of edgeƗedge crossings.