I try to use geometry nodes to generate a procedural building (Width, Length, Height, random distribution (Windows, doors, balcony etc...)). With some tutorials, I am pretty happy with the result but i would like to add some balconies with conditions in order to link them together when they are on adjoining cells.
I used the grid node and instance on points node to generate the different faces of the building from different type of "cell" (of 3 meters height by 3 meters width).
When two balconies are side by side, i would like to replace them by another type to join them. To do this, I have decided to put in my instance collection just one type of balcony (Type A) and if it's next to another, I would like to change the instance object by another according to some conditions.
To sum up:
- Instance object to replace: n
- Instance object to the left of n: n-1
- Instance object to the right of n: n+1
- Istance collection of every balcony: Ac
- Standard balcony: A
- Left balcony: B
- Middle balcony: C
- Right balcony: D
If n = A:
- If n-1 and n+1 are Ac
- Then n = C
- If n-1 = Ac and n+1 =/= Ac
- Then n = D
- If n-1 =/= Ac and n+1 = Ac
- Then n = B
- Else n = A
Else n doesn't change.
I tried to use the different attribute nodes, but I have to admit that I don't really understand even with the blender 3.0 manual.
So first of all, I would like to know how i can get the instance objects (type Balcony A for example) from the final instance list (every instance objects that constitute the wall), and then how i can replace it. Finally I would like to know if it is possible to make a if/else condition. Maybe I can do this with the compare floats node, to compare the x and y position from every instances object?
I hope it will be clear for you, and you can help me!
Thank you for those who will try to find an answer or some tips! :)