How to split a primitive in staggered order?

   1936   4   1
User Avatar
Member
11 posts
Joined: Dec. 2017
Offline
I'm making an acoustic panel generator for ue4. The idea is that the incoming geometry is divided into approximately square polygons that are replaced by a pre-modeled geometry:



After subdivision, I use group by range to get the chess pattern. Everything works fine.

The problem occurs in cases where the incoming geometry does not have the shape of a square.



In such cases, it is better to work with LOT subdivision, since the result is almost square polygons. However, the sequence of polygons changes as the incoming geometry rotates, so the pattern in breaking. I tried using SORT, but it doesn't solve the problem when rotating the geometry — the primitives order changes anyway.






Is there a more suitable solution for this task?
Edited by Precar_Dan - Feb. 28, 2021 15:19:38

Attachments:
rotation.jpg (61.9 KB)
notsquare.jpg (69.0 KB)
Result.jpg (37.9 KB)
no_rotation.jpg (61.5 KB)

User Avatar
Member
504 posts
Joined: July 2005
Offline
Hi,

if you want checker pattern, you can also try shortest distance node on the dual graph (primitive -> points) of your geometry. There are probably other ways as well, but in this one you don't have much extra work. Here is a file ...
Edited by Aizatulin - March 1, 2021 11:25:39

Attachments:
checker_by_shortestpath.hipnc (119.6 KB)

User Avatar
Member
9291 posts
Joined: July 2007
Offline
you can also use Group Expand + Group Expression Nodes

Group Expand:
- Group Name (you can delete as we don't need to output group)
- Base Group: 0 (or whichever poly you want to expand from)
- check both Require Prim to share edge + Flood Fill...
- check Step Attribute (this will output the @step attribute used in Group Expression)

Group Expression:
- VEXpression: i@step%2
Edited by tamte - March 1, 2021 11:47:09
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
718 posts
Joined: Sept. 2013
Offline
Graph color node set to 'Polygon edge'.
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
11 posts
Joined: Dec. 2017
Offline
Aizatulin, tamte, Konstantin, Thank you! I'll try those approaches.

Aizatulin, thanks for the file!
  • Quick Links