Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:57:17) [MSC v.1600 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
?xml version="1.0" encoding="iso-8859-1"?>
!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="400pt" height="400pt" viewBox="0 0 400 400">
g fill="none" stroke="blue">
line x1="1" y1="1" x2="1" y2="399" />
line x1="1" y1="399" x2="399" y2="399" />
line x1="399" y1="399" x2="399" y2="1" />
line x1="399" y1="1" x2="1" y2="1" />
line x1="200" y1="1" x2="200" y2="399" />
line x1="1" y1="200" x2="399" y2="200" />
line x1="100" y1="1" x2="100" y2="200" />
line x1="1" y1="100" x2="200" y2="100" />
line x1="50" y1="1" x2="50" y2="100" />
……
复制输出的结果,命名为 .svg,.html 也行,用浏览器打开,会呈现下图:
图 5 一个 8*8 大小的点四叉树区域
看这个图,从左上角开始,顺时针。你可以当做“根据需要,是否要点,不断按 4 个分裂其中一个方块”。
下载 Point Qudatree Python 演示