Jump to content

Filling an area tightly with pre-made assets


filipw

Recommended Posts

Hi, I'm new here (and new to houdini as well) and have a very similar problem to what I have aleady seen here considering scattering and tiling. I have not been able to solve it yet so I take the chance of asking:

I want to distribute/tile objects over an area without changing scale and orientations. Lets say the object are rectangular tiles of slight variations. Like taken from at stack for real planks or marble tiles. Basically laying down a floor like a craftsman would do it.

Using the UV-layout SOP solves it on a technical level but it is not possible for me to art direct it or randomize the placements of planks in a satisfying manner.

So what other approaches are there? If I would write this in pseudo-code it would be something like:

// variables given at start
Rect areaBounds;
Rect tileBounds[10];

// a list of placed tiles
Rect placedTiles[MAX_TILES];
// availble space 
Rect availableSurface = areaBounds;

while (AreaOf(availableSurface)>0)
{
	Rect tileToTest = tileBounds[randomChoice(10)];
	if (DoesTileFit(areaBounds, tileToTest)
	{
		AppendTile(placedTiles, tileToTest);
		ReduceAvailableArea(availableSurface, tileToTest);
	}
}

But I just assume this is one of more common operations that people do and there is an easy to use solution in Houdini that I just don't know about...

 

 

 

Link to comment
Share on other sites

I got something basic "working" but it feels wrong since I have to write a lot of code and use very few nodes. Ideas on how to make this the "correct houdini way" are very welcome!

I wrote most as a detail VEX wrangle that uses more or less the example code above to create some targets points/origins for assets to be copied to. I also set an attribute so that the copy SOP can make choice later.

For the test it copies some very basic "fake tiles" to the destinations.

 

vex_tile_floor.hipnc

 

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...