# "square" scatter

## Recommended Posts

Hi.

I create a village and i need to create curved road. But this road must contains only square blocks of different sizes. Without empty spaces between...

You can see example in attachment...

But how to scatter that tiled road? Or generate it?

It's looks like a squared voronoi texture. But i'm don't have idea how to do it. I have a spline (road curve) and need to scatter this road with squared blocks.

Thanks

##### Share on other sites

Maybe a recursive subdivide can get you closer to your look?

• 1

##### Share on other sites

Here is another approach using Ben Watts Quick Tip 05, particle packing algorithm. I am also moving the result along a path so you can bend it into what ever shape you need.

ap_bw_qt05_packing_scale_by_age_H16.hiplc

##### Share on other sites
4 minutes ago, Atom said:

Here is another approach using Ben Watts Quick Tip 05, particle packing algorithm. I am also moving the result along a path so you can bend it into what ever shape you need.

that's have a intersections and holes... ((

##### Share on other sites

For a RECTANGULAR piece of road...ok, doable, not that I can. One option is maybe looking at the new UV packing algo in H17.

But for a CURVED road, to be filled with square blocks...with no gaps....how is it possible ? at some point, you're gonna have to 'turn' the blocks and therefore there MUST be gaps ? The only possible way out of this what they do in real life, the square blocks are 'shaped' to perfectly fit the turning angle....ie. no longer a squared block

##### Share on other sites

I'm wondering if you couldn't start with big blocks define a threshold of acceptable fitting and shatter and adjust the existing blocks until they fit the threshold.

There must be small gaps anyway, but yes, they can be minimized and that's what a mason can do.

Edited by probiner

##### Share on other sites

So this is a packing problem -- https://en.wikipedia.org/wiki/Packing_problems

The bad news is there's no silver bullet here. This is a type of optimization problem where we really only have essentially brute-force algorithms that improve solutions only by trying more variations and spending more time. And even with a lot of time spent a "perfect" pack is not likely outside of ideal conditions. That said if you can find a way to stand an imperfect pack (gaps, scaling variation) then I've attached another approach using UV Layout. This is like what Entagma posted a few weeks ago (http://www.entagma.com/houdini-17-quicktip-packing-geometry-using-the-uv-layout-sop/)

Using the Attribute Randomize SOP to vary pscale will improve results. If squares aren't a hard requirement you can do even better sometimes by varying a vector scale non-uniformly. Also the Island Rotation Step in the UV Layout SOP can have a dramatic impact at the cost of increased bake time and non-uniform square rotations. By varying the scaling, the number of squares, square rotation, or even making slight adjustments to the path you can improve the packing. The important takeaway is that this method does require massaging variables to achieve a better fit. Also UV Layout won't play nice if your path isn't planar.

Edited by mlmcgoogan

##### Share on other sites

How about just extruding a curve and using some of its own extrusion points on a voronoi fracture?

Granted the bricks are slightly trapezoidal, but depending on the scale you wont really notice.

Edited by konstantin magnus
• 1

##### Share on other sites

I gave it a go.  theres more than 1 way to skin a cat, but you can hack the points from volume sop to make irregular blocks

Also included a recursive subdivision option, its an OTL I made myself though so I didnt include it, you can find many threads about it on here though

as stated above, you will always get hols trying to fit square object into a non-square boundary. trick is to fill it up recursively in the gaps so that it becomes so dense you will never see it

Edited by Neon Junkyard
• 3

##### Share on other sites

Hi,

I know it's been a while since this thread has been active, but I'm curious to know how you ended up going about
solving this problem. I need to create almost the exact same pattern for a road. I don't need it to create a smooth
curve like in the last few posts, but more like scattered along a curve like in your opening picture. I'm guessing you
wanted yours to look like that as well.

Thanks!

## Create an account

Register a new account