Jump to content
alex.torn

"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

 

 

2018-11-08_18-59-34.png

Share this post


Link to post
Share on other sites

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

 

  • Like 1

Share this post


Link to post
Share on other sites

but for a CURVED road, I think it's already dead in the water.

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 this post


Link to post
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.
hqdefault.jpg

Edited by probiner

Share this post


Link to post
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.

 

Capture.thumb.JPG.608557f30c025ca3eeb2fca4a3aaf6ad.JPG

 

packing.hiplc

Edited by mlmcgoogan
Added preview image.

Share this post


Link to post
Share on other sites

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

path_pattern.thumb.jpg.5a53e4a4624b0566eb9589b385d354cf.jpg

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

path_pattern.hiplc

Edited by konstantin magnus
  • Like 1

Share this post


Link to post
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

 

road_city_large.JPG

road_city_tiny.JPG

object_packing_city_road.hip

Edited by Neon Junkyard
  • Like 3

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×