POV-Ray : Newsgroups : povray.general : Hilbert curve Server Time
2 Dec 2024 02:35:22 EST (-0500)
  Hilbert curve (Message 1 to 10 of 10)  
From: Bald Eagle
Subject: Hilbert curve
Date: 26 Jun 2024 18:20:00
Message: <web.667c9393a46c8bcd1f9dae3025979125@news.povray.org>
I was playing a bit with the (pseduo)Hilbert curve, and got up to order 9, when
I started to get a bit of render degradation.  Some parts of my curve looked
fine, but others were corroded or missing entirely.

#declare AspectX = image_width;
#declare AspectY = image_height;
#declare Fraction = min (AspectX, AspectY);

camera {
 orthographic
 right     x*image_width
 up   y*image_height
 location <Fraction/2, image_height/2, -Fraction>
 look_at <Fraction/2, image_height/2, 0>

}

Fine.  I'll just increase the image size, that will "give me more resolution".
(1920x1080)
It looked worse.
Fiddled with antialiasing settings looked the same or worse. (+a0.01 +am2 +r3)
No antialiasing.   Poo.
Increased the line width.  Still looked like poo.

Rendered at order 4, and half my curve is missing.
Switched back to 1024x768, and it looks fine.

Something odd is afoot here, or this is another POV-Ray nuance that I'm not
aware of.


Post a reply to this message


Attachments:
Download 'pseudohilbert.pov.txt' (3 KB)

From: jr
Subject: Re: Hilbert curve
Date: 26 Jun 2024 19:20:00
Message: <web.667ca157d908a432c7a7971d6cde94f1@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> I was playing a bit with the (pseduo)Hilbert curve, ...
> camera {
>  orthographic
>  right     x*image_width
>  up   y*image_height

(_weird_)

> ...
> Switched back to 1024x768, and it looks fine.
> Something odd is afoot here, or this is another POV-Ray nuance that I'm not
> aware of.

attached three curves known to work, how do they compare to the "home grown" ?


regards, jr.


Post a reply to this message


Attachments:
Download 'be.zip' (6 KB)

From: Bald Eagle
Subject: Re: Hilbert curve
Date: 26 Jun 2024 20:05:00
Message: <web.667caca8d908a4321f9dae3025979125@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:

> attached three curves known to work, how do they compare to the "home grown" ?

Pretty fast work, there, Speedy Gonzalez.

Well, they're Hilbert curves.
And they're surprisingly slow to render.

I also had no real frame of reference for how to place them, and it took me a
bit to figure out how to even get them to show up (x-z plane, object {}, etc)

I think it's just a matter of the antialiasing not picking up enough sub-pixel
object, and so it disappears.   I just thought that effect would look a lot more
consistent.

I doubled the line width, and it's all there now, just without the nice
inter-line spacing that I was going for.  Maybe I'll experiment with some more
settings.

I've read some interesting blogs and papers, and it's intriguing that one can
calculate where a certain point along the curve will end up.

I'm wondering if there's a way to make this a procedural pattern or something
that can somehow be mapped to a plane with a unit square and warp, repeat, flip.


Post a reply to this message


Attachments:
Download 'pseudohilbert.png' (1213 KB)

Preview of image 'pseudohilbert.png'
pseudohilbert.png


 

From: jr
Subject: Re: Hilbert curve
Date: 27 Jun 2024 01:55:00
Message: <web.667cfe42d908a432c7a7971d6cde94f1@news.povray.org>
hi,

> > attached ...
> Pretty fast work, there, Speedy Gonzalez.

Arriba, arriba ...



> Well, they're Hilbert curves.
> ...
> I've read some interesting blogs and papers, and it's intriguing that one can
> calculate where a certain point along the curve will end up.

plus "niche" use in database indexing, and (I just read) in process
"scheduling".


> I'm wondering if there's a way to make this a procedural pattern or something
> that can somehow be mapped to a plane with a unit square and warp, repeat, flip.

the Wikipedia page does have a L-system "algorithm"[*]; they used to show a 'C'
implementation too, my 'hilbert2d' uses that code, also based on a "rinse &
repeat" method.
<https://en.wikipedia.org/wiki/Hilbert_curve#Representation_as_Lindenmayer_system>


regards, jr.


Post a reply to this message

From: Bald Eagle
Subject: Re: Hilbert curve
Date: 27 Jun 2024 12:20:00
Message: <web.667d90e1d908a4327b170db125979125@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:

> > camera {
> >  orthographic
> >  right     x*image_width
> >  up   y*image_height
>
> (_weird_)

Nope.
That makes every pixel exactly one pov unit each.
Which makes doing full screen stuff super easy, since I don't have to do any
unnecessary arithmetic.

https://news.povray.org/povray.advanced-users/thread/%3Cweb.584856137c1309eec56c0b2c0%40news.povray.org%3E/

- BE


Post a reply to this message

From: Bald Eagle
Subject: Re: Hilbert curve
Date: 27 Jun 2024 12:50:00
Message: <web.667d971dd908a4329274a88425979125@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:

> plus "niche" use in database indexing, and (I just read) in process
> "scheduling".

And now it's one of those things that I keep repeatedly running into while
looking into other stuff:

https://people.csail.mit.edu/jaffer/Color/CSDR


Post a reply to this message

From: jr
Subject: Re: Hilbert curve
Date: 27 Jun 2024 13:30:00
Message: <web.667da11ed908a432c7a7971d6cde94f1@news.povray.org>
hi,

> > >  right     x*image_width
> > >  up   y*image_height
> > (_weird_)
>
> Nope.
> That makes every pixel exactly one pov unit each.
> Which makes doing full screen stuff super easy, since I don't have to do any
> unnecessary arithmetic.
>
> {...}
> - BE

wow, cool.  "I stand corrected" :-).  big thank you (and Alain !).


> And now it's one of those things that I keep repeatedly running into ...

so .. "typical of the world".  (and nice, I think)


regards, jr.


Post a reply to this message

From: Bald Eagle
Subject: Re: Hilbert curve
Date: 28 Jun 2024 09:15:00
Message: <web.667eb66dd908a432e21e5c0b25979125@news.povray.org>
So, if you really want your mind blown,  check out the interrelationship between
binary, Gray code, and N-dimensional Hilbert curves.

https://corte.si/posts/code/hilbert/portrait/

https://github.com/cortesi/scurve

https://www.grant-trebbin.com/2017/03/calculating-hilbert-curve-coordinates.html

https://en.wikipedia.org/wiki/Gray_code

The following makes me suspect that it might be possible to make a procedural
function-based pattern that can infinitely tile the plane and not require an
iterative-type solution.  Then one could pick any region of the plane for the
camera to look, and you'd have a proper Hilbert curve that was simple (and fast)
to calculate.

https://rantonse.org/art/hilbert-tiles

Very much like the Direct Stochastic Tiling:
https://news.povray.org/povray.advanced-users/thread/%3Cweb.650ba428c90fe1dd1f9dae3025979125%40news.povray.org%3E/

(Somewhat related / of interest:)
https://spacefillingcurves.wordpress.com/category/tiling/

- BE


Post a reply to this message

From: jr
Subject: Re: Hilbert curve
Date: 28 Jun 2024 10:15:00
Message: <web.667ec4b6d908a432c7a7971d6cde94f1@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> So, if you really want your mind blown,  ...

"hilbert-tiles" - "Celtic Paper Hilbert Curve".  _wow_.


regards, jr.


Post a reply to this message

From: Bald Eagle
Subject: Re: Hilbert curve
Date: 28 Jun 2024 14:30:00
Message: <web.667f00b8d908a432e21e5c0b25979125@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> hi,
>
> "Bald Eagle" <cre### [at] netscapenet> wrote:
> > So, if you really want your mind blown,  ...
>
> "hilbert-tiles" - "Celtic Paper Hilbert Curve".  _wow_.

Thought that was cool?

https://pure.tue.nl/ws/portalfiles/portal/87629728/haverhow2016.pdf


the C++ sources of a tool to search the curves. .... The tool then searches the
space of 10,694,807 three-dimensional Hilbert curves for matching curves,

details for one or all of these curves. Such details may include whatever could
be given as input
(the name of the curve, the order in which subcubes in a grid are visited etc.),
as well a POV-Ray [38] file for an illustration of the curve in the style of,
for example, Figure 5c, and additional information if known (nickname,
references)."


I also left this one out from the previous post:
https://adamrowe.com/surface-tiling-curves/

- BW


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.