Re: [math-fun] Hilbert(Hilbert)
Using this site http://image.online-convert.com/convert-to-svg I was able to convert the black and white Hilbert to svg, ( the red Hilbert came out black) The compressed file is here; http://www.squaring.net/downloads/hilbert_10.svg.zip uncompressed it is 20M, and is very slow to load in any browser or image viewer (only part of the image was viewable in Chrome and Firefox). Stuart
NB> (It's not impossible, though, and it'd be neat if someone came up with a version that actually followed the Hilbert curve) Julian Ziegler-Hunts came up with a method of interpolating between different depths which, based solely on the image he sent me, seems to work. However, I have yet to understand it. On the plus side of things, I did eventually come up with a way to convert slanted line segments to a sequence of three, shorter, orthogonal line segments: Given the two endpoints, p0 and p3, If the segment in question is pointing more vertically than horizontally (i.e. (p3-p0).{0,1}/||p3-p0||>1/sqrt(2)), insert the points p1={p0.x,(p0.y+p3.y)/2} and p2={p3.x,(p0.y+p3.y)/2}. Otherwise, do the same thing, but with p1={(p0.x+p3.x)/2,p0.y} and p2={(p0.x+p3.x)/2,p3.y}. where v.x and v.y represent the x and y components of v, respectively (or if you prefer, x={1,0} and y={0,1} and the period is a dot product) This certainly isn't new or novel, but it works in the case of connecting parts of multi-level Hilbert curves. It also doesn't work in some cases*, but none of these problems seem to occur in practice. Here's the resulting image: http://neilbickford.com/assets/hilbert-10-v2.png Additionally, an SVG file (6MB) automatically generated by the rendering program is at http://neilbickford.com/assets/hilbert.svg . Thanks again, --Neil Bickford *e.g. three line segments, at angles pi/4+epsilon, pi/4, and pi/4-epsilon, spaced closely together. I'm somewhat surprised nobody mentioned the obvious cop out: http://neilbickford.com/assets/hilbertcopout.png On Thu, May 16, 2013 at 9:06 PM, Stuart Anderson <stuart.errol.anderson@gmail.com> wrote:
Using this site http://image.online-convert.com/convert-to-svg
I was able to convert the black and white Hilbert to svg, ( the red Hilbert came out black) The compressed file is here; http://www.squaring.net/downloads/hilbert_10.svg.zip uncompressed it is 20M, and is very slow to load in any browser or image viewer (only part of the image was viewable in Chrome and Firefox).
Stuart _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
Stuart Anderson said: I was able to convert the black and white Hilbert to svg, ( the red Hilbert came out black)
You can't naively convert a PNG to an SVG. A native SVG would be better since it would just create a single continuous line element, as opposed to trying to vectorize a rasterized image. On Thu, May 16, 2013 at 9:06 PM, Stuart Anderson < stuart.errol.anderson@gmail.com> wrote:
Using this site http://image.online-convert.com/convert-to-svg
I was able to convert the black and white Hilbert to svg, ( the red Hilbert came out black) The compressed file is here; http://www.squaring.net/downloads/hilbert_10.svg.zip uncompressed it is 20M, and is very slow to load in any browser or image viewer (only part of the image was viewable in Chrome and Firefox).
Stuart _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
participants (3)
-
Neil Bickford -
quad -
Stuart Anderson