2

I'm generating a world made of hexagons with dynamically varying heights.

To improve the performance, I'd like to remove all faces that are duplicates, i.e. that

  • are directly facing each other (opposing normals and no distance between)
  • have the same face area

I tried around with raycast and compare nodes but not to a satisfying result. Eventually I'd want it to look like below, that all same-height hexagons have no dividing walls, and only those that have variying heights have. Current Situation Target Design

simatao
  • 23
  • 4
  • 1
    pls provide blend file so we don't have to rebuild everything manually. thx. – Chris Dec 19 '23 at 13:19
  • 1
    Hello, have you tried instancing hexagons and then using the extrude node with the Individual Elements checkbox off ? – Gorgious Dec 19 '23 at 13:19
  • @Chris, how do I add a blend file? Sorry, I'm new to this exchange – simatao Dec 20 '23 at 08:04
  • Thanks @Gorgius, I just tried that but the "individual" checkbox seems to have no effect. – simatao Dec 20 '23 at 08:05
  • @Chris I've uploaded the file here: https://www.dropbox.com/scl/fi/lfwrigau9g7amar6uyroe/Hexworld_nodes_36_experimental.blend?rlkey=zz641184bmk57yw193jmk41zk&dl=0 – simatao Dec 20 '23 at 08:11
  • "To improve the performance" - first try with instances. Chances are the performance will be enough. https://blender.stackexchange.com/q/264036/60486 – Markus von Broady Dec 20 '23 at 09:56

2 Answers2

2

Another possibility:

enter image description here

Its made in two times:

Top part of the node tree: merge only the base vertices, then remove vertices that have more than 3 vertex neighbourg and more than four face neighbourgs.

This first result works well but also removes part of hexagons that are isolated by their height.

Bottom part: merge all and remove vertices that have more than 3 vertices and have 3 faces.

Also works well but also removes part of the contour.

So join the two and merge again by distance.

The result is also around 2.8k vertices.

enter image description here

lemon
  • 60,295
  • 3
  • 66
  • 136
  • lemon's approach seemed more intuitive and it worked on first try, thanks you both for coming up with fantastic solutions. I'm really impressed what geonodes can do with a little bit of fantasy and lots of math :P bravo! – simatao Dec 20 '23 at 22:40
1

you can try this setup here, although i am not sure whether it is very performant - maybe you try that out, i was too lazy ;)

enter image description here

result:

Faces shrink from 3.8k to 2.8k

visualized faces which were deleted:

enter image description here

Hope it helps.

Chris
  • 59,454
  • 6
  • 30
  • 84