# Geometry nodes to distribute houses along edge normals

I need some urgent help to distribute these houses inside each block and rotate them accordingly to the edge normals of the block. All houses are already in a collection. The houses at the outside will face 90 degree with their front edges. For the ones inside the blocks I’m okay with any direction they might face, but preferably following 1 of the 4 of the edges normal like the outside ones so it won’t look weird. The houses should have a slight distance with e/o like on the image and randomize a bit in scale. I know only a (very) few geometry nodes so if anyone can help with the full steps to do this, I’d be very much grateful.

• It might be helpful to people trying to help you if you uploaded an example blend file of what you have to the site blend-exchange.giantcowfilms.com and add that link in the question. Commented Apr 11, 2022 at 3:54
• Could you please upload your file? There are too many possibilities to solve that issue and i need to know what your specific situation is. Commented Apr 13, 2022 at 16:21
• @quellenform this is the file, I tried with some nodes but the result is not so efficient as the houses keep clashing with e/o. I tried to fix that by adding verts to the block shape to randomize the geometry (seed doesn't work for all blocks at once, I had to do it manually). If you can take a look it'd be great, thank you in advance! <img src="https://blend-exchange.com/embedImage.png?bid=M40MlQQX" /> Commented Apr 14, 2022 at 2:31
• @RickT thanks for the headsup! Commented Apr 14, 2022 at 2:31

If I understand you correctly, it's not actually about aligning the houses along an edge (or not only), but primarily about avoiding that the houses intersect each other. Right?

Then I have bad news for you: You won't get that easily with Geometry Nodes, because with this technique you can't manage a size-dependent distribution.

The main problem is that you can instantiate objects with GN, but you can't align the instances depending on their properties (dimensions). Currently there is the option Poison Disk in the node Distribute Points on Faces, but with this you can only get partially usable results, because your houses are of different length.

And exactly this length cannot be included in the distribution. Therefore, you will always get a halfway acceptable result with this technique by trial and error.

However, there is a way to make the whole structure a bit clearer and achieve a bit more influence on this distribution (and aligning as well):

1. First, convert your house plane to curves in the editor (right click on the object and then Convert to -> Curve) so you get rid of the inside edges, because they interfere here.

2. Then convert these clean curves into a mesh using the Fill Curve node. You will notice that the rotation is now better than before.

3. Add the Geometry Proximity node. With this you have the possibility to influence the instances that are further away from the edges (e.g. the rotation). Furthermore, you could also use it to calculate the alignment, which you currently calculate directly over the two points of your edge.

4. Subsequently, with the value that Geometry Proximity provides, it would also be possible for you to create a mask based on the distance to the edge, with which you could, for example, use objects of a different collection in the inner area of the faces, which would cause fewer problems with regard to the size.

However, one trick might be to construct your objects to be instantiated in a manner similar to a computer game. Think of Civilization, for example. There, all building blocks are divided into hexagons, so they can be lined up evenly on a grid. For example, if you design your houses this way (e.g. combine two buildings into one object), and create your points more evenly on the surface, you may get a result with fewer intersections.

I'm sorry that I couldn't give you such a great help here, but this is Blender, not Houdini...

Here is your modified blend file:

• Thank you so much for your help! I actually tried another temporary nodes but the result is not effective as the houses keep clashing with e/o. I made a temporary solution by adding verts to the block base so the geometry can be randomized until I got the least-clashing result and move on to other blocks, repeating the same steps. I need to make several more versions of this landscape (different houses) so it would be very time consuming to manually modify for each time. Commented Apr 14, 2022 at 2:41
• Here's my file, I'd be grateful if you can take a look and help me with the clashing problem. I'll try your solution also, thank you again for your help! <img src="https://blend-exchange.com/embedImage.png?bid=M40MlQQX" /> Commented Apr 14, 2022 at 2:41
• Thanks a ton for your help! A bit of clashing is fine since the landscape is supposed to look at from afar, not up close anyway. I'm really a noob at geometry nodes so any instruction is absolutely helpful for me. I'll try your solution, again I'm very grateful for your help and explanation. Commented Apr 16, 2022 at 6:08