From 2620721e46ed8308eb3f0df901ae0ddf1fa83bdd Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Sat, 18 Jun 2022 09:33:26 +0200 Subject: [PATCH] direct: update birect.py --- direct/birect.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/direct/birect.py b/direct/birect.py index 438694d..a4742cb 100644 --- a/direct/birect.py +++ b/direct/birect.py @@ -26,7 +26,7 @@ def birect( max_iters=None, # exit when the optimization procedure iterates this many times by_longest=False, # measure by rects by longest edge instead of their diagonal pruning=0, - F=float, # can be float, np.float32, np.float64, decimal, or anything float-like + F=float, # can be float, decimal.Decimal, numpy.float64, or anything float-like ): assert len(lo) == len(hi), "dimensional mismatch" @@ -48,9 +48,9 @@ def birect( return res def ab_to_lu(w_a, w_b): # converts corner points to midpoints, also denominators - # (2 * a + b) / (den * 3) = point halfway between corner "a" and the center + # (2 * a + b) / (den * 3) = point inbetween corner "a" and the center w_l = [(a[0] + a[0] + b[0], (1 << a[1]) * 3) for a, b in zip(w_a, w_b)] - # (a + 2 * b) / (den * 3) = point halfway between corner "b" and the center + # (a + 2 * b) / (den * 3) = point inbetween corner "b" and the center w_u = [(a[0] + b[0] + b[0], (1 << b[1]) * 3) for a, b in zip(w_a, w_b)] return w_l, w_u @@ -202,9 +202,9 @@ def birect( # ↓b ↓b a↓b a↓ # ┌───────────┐←b ┌─────╥─────┐ ┌─────╥─────┐ ┌─────╥─────┐←a # │ │ │ ║ │ │ l ║ │ │ l ║ l │ - # │ ① u │ ⇒ │ u ② ║ u │ ⇒ │ u ③ ║ u │ ⇒ │ u ║ u │ + # │ ① u │ → │ u ② ║ u │ → │ u ③ ║ u │ → │ u ║ u │ # │ │ │ ║ │ b→╞═════╣←a │ b→╞═════╬═════╡←a - # │ l │ ⇒ │ l ║ l │ ⇒ │ l ║ l │ ⇒ │ l ║ l │ + # │ l │ → │ l ║ l │ → │ l ║ l │ → │ l ║ l │ # │ │ │ ║ │ │ u ║ │ │ u ║ u │ # a→└───────────┘ └─────╨─────┘ b→└─────╨─────┘ b→└─────╨─────┘ # ↑a ↑a ↑a ↑b @@ -318,7 +318,7 @@ def birect( v_new = split_rectangles(v_potential) for j in v_potential: - del v_active[j] # these were just split a moment ago, so remove them + del v_active[j] # these were just subdivided a moment ago, so remove them for j in v_new: if v_depth[j] < depth_limit: # TODO: is checking this late wasting evals? v_active[j] = True # these were just created, so add them