Jump to content

"square" scatter


alex.torn

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

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

Link to comment
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
Link to comment
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.
Link to comment
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
Link to comment
Share on other sites

  • 10 months later...

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!

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