DIAG: clean up squares function
This commit is contained in:
parent
ecf203c825
commit
da5b0a17f0
@ -170,21 +170,17 @@ convexHStepsLs = GifDiag chs
|
|||||||
(strokeTrail . fromVertices $ vt') # moveTo (head vt') # lc col
|
(strokeTrail . fromVertices $ vt') # moveTo (head vt') # lc col
|
||||||
|
|
||||||
|
|
||||||
-- FIXME: hardcoded dimensions
|
-- |Create a diagram that shows all squares of the RangeSearch algorithm
|
||||||
|
-- from the quad tree.
|
||||||
squares :: Diag
|
squares :: Diag
|
||||||
squares = Diag f
|
squares = Diag f
|
||||||
where
|
where
|
||||||
f p (Object []) = mempty
|
f p (Object []) = mempty
|
||||||
f p (Object vt) =
|
f p (Object vt) =
|
||||||
mconcat
|
mconcat
|
||||||
$ (\((xmin, xmax), (ymin, ymax)) -> rect (xmax - xmin) (ymax - ymin) #
|
$ (\((xmin, xmax), (ymin, ymax)) -> rect (xmax - xmin) (ymax - ymin)
|
||||||
moveTo (p2 (
|
# moveTo (p2 ((xmax + xmin) / 2, (ymax + ymin) / 2)) # lw ultraThin)
|
||||||
((xmax + xmin) / 2),
|
<$> (quadTreeSquares (dX p, dY p) . quadTree vtf $ (dX p, dY p))
|
||||||
((ymax + ymin) / 2)
|
|
||||||
)
|
|
||||||
) #
|
|
||||||
lw ultraThin)
|
|
||||||
<$> (quadTreeSquares ((0,500), (0,500)) . quadTree vtf $ (dX p, dY p))
|
|
||||||
where
|
where
|
||||||
vtf = filterValidPT p vt
|
vtf = filterValidPT p vt
|
||||||
f _ _ = mempty
|
f _ _ = mempty
|
||||||
|
Loading…
Reference in New Issue
Block a user