POV-Ray : Newsgroups : povray.binaries.images : Wave function collapse algorithm Server Time
6 Nov 2024 00:27:26 EST (-0500)
  Wave function collapse algorithm (Message 1 to 9 of 9)  
From: BayashiPascal
Subject: Wave function collapse algorithm
Date: 14 Nov 2021 09:10:00
Message: <web.619117ad3ebd8fa0c7449d78e0f8c582@news.povray.org>
Hi,

Following the post from Bill Pragnell, I took time this week end to implement
the wave function collapse algorithm in a POV-Ray script. It's explained in
details in an article on my website:
https://baillehachepascal.dev/2021/pov_wave_collapse.php
and the code is available at the end of the article.
As an example of use, there is a random pendant generator (see image attached).
I hope it will be useful to someone here and hope to see some nice things made
with it. If help is needed I'll be happy to support.

Pascal


Post a reply to this message


Attachments:
Download 'wfcpendants.jpg' (16 KB)

Preview of image 'wfcpendants.jpg'
wfcpendants.jpg


 

From: jr
Subject: Re: Wave function collapse algorithm
Date: 16 Nov 2021 10:00:00
Message: <web.6193c740e205fdd1d6c295506cde94f1@news.povray.org>
hi,

"BayashiPascal" <bai### [at] gmailcom> wrote:
> Following the post from Bill Pragnell, I took time this week end to implement
> the wave function collapse algorithm in a POV-Ray script. It's explained in
> details in an article on my website:
> https://baillehachepascal.dev/2021/pov_wave_collapse.php
> and the code is available at the end of the article.
> As an example of use, there is a random pendant generator (see image attached).

elegant, bottom left is my "favourite".  read the web page, v interesting, hope
to find a "week end" to try :-) and sus how it all fits together.


regards, jr.


Post a reply to this message

From: Bill Pragnell
Subject: Re: Wave function collapse algorithm
Date: 16 Nov 2021 17:45:00
Message: <web.61943363e205fdd1b96893c06f35e431@news.povray.org>
"BayashiPascal" <bai### [at] gmailcom> wrote:
> the wave function collapse algorithm in a POV-Ray script.

Good writeup! Nice clear explanation, I shall have to come back to this at some
point.

Bill


Post a reply to this message

From: Paolo Gibellini
Subject: Re: Wave function collapse algorithm
Date: 18 Nov 2021 05:33:04
Message: <61962be0@news.povray.org>
Il 14/11/2021 15:05, BayashiPascal ha scritto:
 > Hi,
 >
 > Following the post from Bill Pragnell, I took time this week end to 
implement
 > the wave function collapse algorithm in a POV-Ray script. It's 
explained in
 > details in an article on my website:
 > https://baillehachepascal.dev/2021/pov_wave_collapse.php
 > and the code is available at the end of the article.
 > As an example of use, there is a random pendant generator (see image 
attached).
 > I hope it will be useful to someone here and hope to see some nice 
things made
 > with it. If help is needed I'll be happy to support.
 >
 > Pascal
 >

Interesting results, you can also develop a road network with your code.

Paolo


Post a reply to this message

From: Samuel B 
Subject: Re: Wave function collapse algorithm
Date: 18 Nov 2021 18:05:00
Message: <web.6196dafae205fdd1cb705ca46e741498@news.povray.org>
"BayashiPascal" <bai### [at] gmailcom> wrote:
> Hi,
>
> Following the post from Bill Pragnell, I took time this week end to implement
> the wave function collapse algorithm in a POV-Ray script. It's explained in
> details in an article on my website:
> https://baillehachepascal.dev/2021/pov_wave_collapse.php
> and the code is available at the end of the article.
> As an example of use, there is a random pendant generator (see image attached).
> I hope it will be useful to someone here and hope to see some nice things made
> with it. If help is needed I'll be happy to support.

Good work, Pascal. And a nice rundown regarding some contingencies one might
implement for contradicting cells.

I still wonder, though, if square/cube marching might not be more useful for
many similar scenarios. Used in combination with maze-finding algorithms, one
could get some reasonable results.

Downloaded the source. I might just check out your code sometime in the future;
thanks for making it available!

Sam


Post a reply to this message

From: BayashiPascal
Subject: Re: Wave function collapse algorithm
Date: 19 Nov 2021 01:40:00
Message: <web.61974528e205fdd1c7449d78e0f8c582@news.povray.org>
Thanks to all for your comments.

Paolo, yes, a road network would be totally feasible. Managing crossroad at
various angles could be challenging though. The rules should rather be
procedurally generated in that case.

Samuel B., marching cube is interesting too. The two algorithms differ by the
way you describe the type of elements in each cell. If you have a function to
express the types according to the coordinates, marching cube is probably the
right solution. If you're in a case where there is no way to express them but to
explicitly list them, the wave function collapse algorithm seem
to me a more appropriate algorithm.

I had just a little more time to play with it and made a celtic knots generator
(code added to the article and result attached below). I'd like to find time for
a small 3D example too, for completion, but it seems improbable...

Pascal


Post a reply to this message


Attachments:
Download 'celticknots.jpg' (65 KB)

Preview of image 'celticknots.jpg'
celticknots.jpg


 

From: kurtz le pirate
Subject: Re: Wave function collapse algorithm
Date: 20 Nov 2021 05:41:24
Message: <6198d0d4$1@news.povray.org>
On 14/11/2021 15:05, BayashiPascal wrote:
> Hi,
> 
> Following the post from Bill Pragnell, I took time this week end to implement
> the wave function collapse algorithm in a POV-Ray script. It's explained in
> details in an article on my website:
> https://baillehachepascal.dev/2021/pov_wave_collapse.php
> and the code is available at the end of the article.
> As an example of use, there is a random pendant generator (see image attached).
> I hope it will be useful to someone here and hope to see some nice things made
> with it. If help is needed I'll be happy to support.
> 
> Pascal
> 

It looks really very interesting.
Unfortunately the demos don't work :( :(

 >> Possible Parse Error: Uncategorized error thrown at /Volumes
 >> /WDVrijstuk/PovRayUnofficial_3.8.0-alpha. 10013324-avx source/source
 >> /parser/parser_tokenizer.cpp line 2413.
 >>
 >> Fatal error in parser: Uncategorized error.
 >>
 >> Render failed

Is it specific to my version ?




-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

From: jr
Subject: Re: Wave function collapse algorithm
Date: 20 Nov 2021 07:10:00
Message: <web.6198e50be205fdd1ea8869266cde94f1@news.povray.org>
hi,

kurtz le pirate <kur### [at] gmailcom> wrote:
> ...
>  >> Possible Parse Error: Uncategorized error thrown at /Volumes
>  >> /WDVrijstuk/PovRayUnofficial_3.8.0-alpha. 10013324-avx source/source
>  >> /parser/parser_tokenizer.cpp line 2413.
>  >>
>  >> Fatal error in parser: Uncategorized error.
>  >>
>  >> Render failed
>
> Is it specific to my version ?

looks like it, works using alpha.9945627.  (there was a recommendation to revert
to earlier alpha if not using the newer beta)


regards, jr.


Post a reply to this message

From: BayashiPascal
Subject: Re: Wave function collapse algorithm
Date: 20 Nov 2021 20:30:00
Message: <web.6199a0eee205fdd1c7449d78e0f8c582@news.povray.org>
kurtz le pirate <kur### [at] gmailcom> wrote:
> It looks really very interesting.
> Unfortunately the demos don't work :( :(
>
>  >> Possible Parse Error: Uncategorized error thrown at /Volumes
>  >> /WDVrijstuk/PovRayUnofficial_3.8.0-alpha. 10013324-avx source/source
>  >> /parser/parser_tokenizer.cpp line 2413.
>  >>
>  >> Fatal error in parser: Uncategorized error.
>  >>
>  >> Render failed
>
> Is it specific to my version ?

I'm sorry for that. I'm using 3.8.0-beta.1.unofficial and haven't encountered
this error.

Pascal


Post a reply to this message

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