Jump to content

Opus Pattern Grid


deadpixel

Recommended Posts

Hi Houdini hive-mind

new here (sort of)

looking for some advice on how I might be able to create a grid where the cells are arranged in an opus pattern.

I have a cell of a minimum dimension (lets say 200x200), I want to be able to have the other cells multiple dimension of that in x and y.  (400x800, 600x400 or even 200x2000 for example).

Crucially there are no L shaped/tetris type arrangments.

Im fairly sure it involves making a grid of cells with the minimum size, and making random selections to delete and build bigger patches, but not sure the best way to go about it without creating odd shapes.

I've reached my intelligence limit, and I defer to clever folk here for any kind suggestions (or of course, solutions posted elsewhere)

Thanks

CY9QScd.jpg

opus.png

19_76randompattern.gif

  • Like 2
Link to comment
Share on other sites

I'm very curious, about this too. I'm moving today so I don't have access to phone. One I know bad idea would be to copy boxes to the point with random scale, the biggest one select first and remove from the group, and you can perform a check for over lap. And then correspondingly add smaller boxes.... A better idea is to use the same vine growth method with food, but in vex... A third idea would be to use a noise function and clamp to 5-6 tiers. I think there is a function in vex(math in general) that does this. No guarantee there would be not be an L, but you may be able to pick an appropriate noise function for the variety like a small perlin. Good luck. Hope u solve it.

  • Like 1
Link to comment
Share on other sites

Hi,

I don't know how to make it mathematically.

Here you can find different Opus Pattern:

https://www.mandarinstone.com/advice-and-support/stone-layouts/

As you can see most pattern are based on a 7x7 grid layout. There are mostly 4 different tile types with a aspect ratio relationship. (A=3x2 units, B=2x2 units, C=2x1 units, D=1x1 units). So you can use the points of  7x7 grid and assign scaling attributes to the points according to the type of opus pattern and copy a 1x1 tile to the points with the scaling attributes.

Hope that helps...

 

OpusPatternTool.hiplc

  • Like 1
Link to comment
Share on other sites

I guess you could check for every patch if the area is equal to the width*height, if not its an "L" shape and should be split.
Fixing the corner shapes is probably the biggest challenge of this pattern, while also maintaining the larger block shapes.

  • Like 1
Link to comment
Share on other sites

1 hour ago, acey195 said:

I guess you could check for every patch if the area is equal to the width*height, if not its an "L" shape and should be split.
Fixing the corner shapes is probably the biggest challenge of this pattern, while also maintaining the larger block shapes.

this is the logic I'm trying to work with (get 'box' of section, measure area of box vs section, if not equal then it is an irregular shape, then also must be equal or less than 6 times a 'unit' area) but..struggling with recursive coding...(clustering into 2 smaller pieces)

Edited by Noobini
  • Like 1
Link to comment
Share on other sites

wow, thanks so much to everyone for all these great ideas, I have been playing with them all and I really appreciate it.

 

I have tried a few things now.

I had started by using using a voronoi cluster and fracture similar to the method as outlined on @mestela's cgwiki , but I could never quite get the level of control vs randomness I wanted.  I also struggled to get rid of the L/Tetris shape, although I did try a similar approach as outlined by some of you.

However I recently stumbled upon a thread with a brilliant solution from @trandzik which absolutely nails what I am trying to achieve  and I can adapt it very well to my particular needs.  Thank you so much Peter.

A super-cute and most unexpected side-effect of playing about with his setup today, (and throwing in some symmetry and random deletion) - I inadvertently ended up with a pretty excellent space invader generator!

See attached :D

 

 

spaceInvaders2.gif

Edited by deadpixel
smaller gif size
  • Like 3
Link to comment
Share on other sites

  • 1 month later...
On 6/22/2017 at 10:33 PM, deadpixel said:

wow, thanks so much to everyone for all these great ideas, I have been playing with them all and I really appreciate it.

 

I have tried a few things now.

I had started by using using a voronoi cluster and fracture similar to the method as outlined on @mestela's cgwiki , but I could never quite get the level of control vs randomness I wanted.  I also struggled to get rid of the L/Tetris shape, although I did try a similar approach as outlined by some of you.

However I recently stumbled upon a thread with a brilliant solution from @trandzik which absolutely nails what I am trying to achieve  and I can adapt it very well to my particular needs.  Thank you so much Peter.

A super-cute and most unexpected side-effect of playing about with his setup today, (and throwing in some symmetry and random deletion) - I inadvertently ended up with a pretty excellent space invader generator!

See attached :D

 

 

spaceInvaders2.gif

You are welcome! I am really happy to see it helped someone :) By the way that gif is just great :D

Peter

  • Like 1
Link to comment
Share on other sites

Even though @trandzik already has an amazing solution for creating these patterns, I wanted to take a shot at it myself and ended up with the following.

I didn't clean up any of the code, so this is just a mess but it works ;) .

divide_plane.PNG

 

 

divide_grid_2.hipnc

Edited by Gorrod
changed the code to make a bit more sense ;)
  • Like 7
Link to comment
Share on other sites

  • 1 month later...

Hey @Gorrod,

had a play with your latest today, thats really great!

..one thing I was curious:

min/max Height range seems to do exactly as expected (if you set between '1 to 1', or '1 to 3' there will be a variety of primitives at this scale in height)

however minLength doesn't seem to do the same...setting '1 to 1' there will still be some larger in length.

I have absolutely no vex experience, but I messed about and adjusted the line:

if(primNumbers[j] == primNumbers[j-yAmount] || primNumbers[j] == primNumbers[j+yAmount] || len(thisPrims)-1 > maxLength) break;

to

if(primNumbers[j] == primNumbers[j-yAmount] || primNumbers[j] == primNumbers[j+yAmount] || len(thisPrims)+1 > maxLength) break;

and it seems to do the right thing?  any thoughts?

J

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...