Instance number of object on Mesh depending on its face length using Geometry node

I imported data of houses from GIS addon in blender. I am trying to assign windows to its face which can adjust to the face calculating its length. And also adjusting the gap between windows so it does not overlap or go outside of mesh
image
I tried to use instance on points with subdivision added before mesh to points. But it overlaps each other and distribution is huge on small and big mesh.


I tried to search online for the solution but I just could not find any tutorials. I did find one thread on this website but I could not understand any of that.
If anyone can provide solution to this, it would be really helpful.

I don’t know what your network shows… it doesn’t appear to relate to your screenshots…

Anyway…

The trick is to use the Duplicate Elements node to create as many points as there are windows per instance point… arranging those vertices to conform to the scaled dimensions and then instancing window cubes.

Then you can make a scene like this with a ground plane and 2 cubes (hence only 20 verts in this scene because it’s all instances.)

Good luck.

4 Likes

Thank you for pointing out Duplicate Elements node to me but I’m fairly new to geometry nodes and I don;t understand other than simple nodes. The pic i provided of nodes are basically me figuring out stuff watching tutorials and combining them if I could get desired result, which I did not get obviously.
I tried to use duplicate instance, but I do not have any knowledge of how to get dimension of object and project instances on faces.
with my small knowledge of geometry node, i tried to make it but I’m stuck, I could not get any info about it beside how the duplicate node works.
Duplicate elements.blend (116.8 KB)
I’m sure I have made 99% mistake on node setup
If its possible can you help me to understand how to make it work.

Sure!

Everyone new to GN should start here.

This network demonstrates the basic idea at its most simple:

  • make some points…
  • capture your dimensions on those points (remembering that a point is just a container for what will eventually be a cube).
  • use those dimensions plus some scaling to determine how many points you need per point.
  • make duplicates of the points
  • array them
  • place scaled versions

Here you can see that duplicated points inherit the attributes of the point they are duplicated from… this is what makes it all work…

This example will only make non-centered points usable for one of the XZ faces of the unrotated cube.

See if you can make a node-group to center the points and offset them to a face. Reuse this node-group to do the other faces. For rotation you’ll need to store the rotation and position so you can rotate the points later.

Good luck.

3 Likes

I finally understood how Fields work after reading from the link you provided. I am still having trouble with it, but I’m trying to figure it out on my own before asking more questions.
Thank you so much.

1 Like