
import matplotlib.pyplot as plt from matplotlib.collections import LineCollection # container for line segments from matplotlib.text import Text, Annotation import matplotlib.cm as cm # colour mappings import random
This light was reflected in all the mirrors; but more especially from one great concave mirror in the middle of the front wall, which caught the rays of the light and threw them into the little mirrors, where they sparkled like so many diamonds.
Full of surprise Pancho approached that mirror and saw his own image reflected, although magnified into superhuman dimensions. While his attention was directed intensely toward that mirror, and while he was wondering about this strange phenomenon, his consciousness became suddenly centred in that image, and then it seemed to him as if he himself were that image, looking out of the mirror, and he beheld his figure reflected from all the little mirrors along the walls.
EdgeList = list[np.ndarray] # list of 2xdim arrays def get_cuts(N: Net) -> EdgeList: return np.concatenate([N.tope.meta[2][i]["cuts"] for i in range(len(N. ↪facets))]) def get_edges(N: Net) -> EdgeList: # apply to unfolded Net edges = [] for i, vertices in N.facets.items(): facet_template = N.tope.get_face(i) # has correct indices edges.extend((vertices[list(e)] for e in facet_template.faces[1])) return edges import itertools Net2d = None # new format of Net def iter_edges(N: Net2d) -> Iterable[np.ndarray[2,2]]: # apply to unfolded 2d␣ ↪Net return N.iter_faces_as_vertices(dim=1) FacetLabels = list[tuple[str, np.ndarray]] # label, position def get_facet_labels(N: Net) -> FacetLabels: labels = [] for i, vertices in N.facets.items(): labels.append((N.tope.meta[N.tope.dim-1][i]["index"], vertices. ↪mean(axis=0))) return labels def iter_facet_labels(N: Net2d, key: str) -> Iterable[str]: return zip(N.iter_meta(dim=2, key="index"), map(N.cells.values(), lambda x:␣ ↪x.vertices.mean(axis=0)))
from tope import Tope from tope.net import * from tope.orth import * from tests import normalize_polygon from typing import * import json, os, numpy as np rng = np.random.default_rng() with open("polys.json") as fd: polys = json.load(fd) logger.remove()