"""Hull surface only, projected onto the sheet's SIDE, TOP and FRONT (dots) beside the sheet's masks: a quick look.""" import sys; sys.path.insert(0, 'build') import numpy as np from PIL import Image import ae_lib as L A = np.asarray(Image.open('reference/user_blueprint.png')).copy() v = np.linspace(L.V_TIP, L.V_END, 700); phi = np.linspace(0, 1, 900, endpoint=False) V, P = np.meshgrid(v, phi, indexing='ij') X, _, Y = L.surf(V, P) def tox(t): return (L.TOP_CY - 0) + 0 * t out = A.copy() def plot(xs, ys, col): xs = np.round(xs).astype(int); ys = np.round(ys).astype(int) ok = (xs >= 0) & (xs < A.shape[1]) & (ys >= 0) & (ys < A.shape[0]) m = np.zeros(A.shape[:2], bool); m[ys[ok], xs[ok]] = True edge = m & ~(np.roll(m, 1, 0) & np.roll(m, -1, 0) & np.roll(m, 1, 1) & np.roll(m, -1, 1)) out[edge] = col plot(V, Y, (255, 60, 0)) # side plot(L.FRONT_CX + X, Y, (255, 60, 0)) # front tx = 228 + (V - 229) * 429 / 469 plot(tx, L.TOP_CY - X, (255, 60, 0)) # top (starboard up: -X up... symmetric) Image.fromarray(out).save('reference/_hullcheck.png') for v_ in (240, 260, 300, 400, 600): print(v_, [tuple(np.round(a, 1)) for a in zip(*[q.ravel() for q in L.surf(np.full(5, v_), np.array([0, .125, .25, .375, .5]))])][:5])