Help Finding direction of piece. (avg PrimNormalJanky)

   1510   3   1
User Avatar
Member
193 posts
Joined: Dec. 2016
Offline
Hello i was wondering if annyone mioght b able 2 help me find a way to set the Direction the windows are facing.
( Just for the slanted part is ok i can not allow windows on the borders. )


I have a pscale atribute somewhere that in combination with a circle scale dicides the slanding and i was thinking maybe i can use that.

Attachments:
houdinifx_autaUyDb9L.png (439.8 KB)
Windmill_V2.hipnc (1.7 MB)

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

I'm not quite sure what you are trying to achieve, but if you want to rotate the red bars, you can set an up vector in the "AplyAvgN_ToCentroid" wrangle for example and rotate it around the normal.

Attachments:
Windmill_V2_mod.hipnc (1.7 MB)

User Avatar
Member
193 posts
Joined: Dec. 2016
Offline
Thx allot for the help i do wich i understood what is happening here.

I dont understand why rotating by 0 around the normal suddenly fixes orientation ?
Or is that not what is happening ?

THat also stil leaves the bugs on the Corners but Those windoes need to not b there annyway.
Edited by NicTanghe - May 31, 2021 13:24:11
User Avatar
Member
475 posts
Joined: July 2005
Offline
Sure

The orientation depends on both (normal ~ v@N and upvector ~ v@up). If you rotate the upvector around the normal the orientation changes.

You have calculated the normal as an average of primitives. In some cases the primitives are not planar, but you can get the normal from the centroid position using xyzdist() to closest prim for example.

Here is the file, if this was the issue.

Attachments:
Windmill_V2_modx.hipnc (1.7 MB)

  • Quick Links