Jump to content

[NEED HELP] Create a new group based on face area size?


neblina

Recommended Posts

Hello everyone, I'm learning Houdini and I'm very excited about it. The issues I had so far were manageable, except this one. Most tutorials aren't using version 16, and apparently a lot has changed. The major problem for me so far was working around the "Group Node", since it was split and it differs a lot from previous versions.

So for this issue I'm encountering right now, I've been researching for hours and just getting frustrated. Whenever I can't find any solution online, it might mean the solution is very simple and obvious, but who knows.

So here's the situation: I have a "Skin" Node which generates a closed geometry with 4 faces (imagine a cube without top and bottom). Since the shape is supposed to be altered later, what I'd would like to do is check which of the faces currently has the largest area, and separate it into a new group. Sounds simple.

The first half I managed to accomplish. After "Skin" I appended a "Measure" Node and set it to Area. Next came a "Attribute Promote", where i get the previously created "area" attrib, which was a Primitive, and turned it into a Detail class, with the Maximum Method. I checked "Change New Name" and called it "maxArea". So far so good. The geometry spreadsheet shows me this one detail "maxArea" with the largest area of the faces I had before. Perfect.

Now comes the the part where I'm sure my lack of knowledge cripples me. I still don't fully understand how these attributes interact, practically what does detail even mean. The tutorial instructs I should append a "Group" node and have this as Base Group (or Filter Expression, since it's deprecated): " $AREA == detail(".././attribpromote1/", maxArea, 0) ".

This does not work at all, and from what I researched, I'm supposed to maybe use @-syntax, but all of my attempts were failed. I tried appending a "Group Expression", tried all of the combinations that I could think of, no luck. Should I promote it back to primitives? I'm really lost.

In a nutshell, what would be the best method to accomplish this? Separate a face from a geometry into a new group based on its area size? Additionally, could anyone provide me some source where I could try and wrap my head around how to manipulate attributes?

Thanks in advance.

MAXAREA-ISSUE.jpg

Link to comment
Share on other sites

Thanks everyone for the replies, specially @Skybar that pointed me in the right direction. 

Fiddling further around, I managed to accomplish this not using the Group Node whatsoever, for my surprise and delight. It was indeed extremely simple, but isn't every problem after it's solved?

I simply appended a "Delete" node to the "Attribpromote1" node, with the following Filter Expression:  "@area==detail("../attribpromote1", maxArea, 0)". It was indeed necessary to uncheck the box on the previous node to avoid deleting the Original Geometry. Worked like a charm.

Hope this might be helpful also to other newbies that face this in the future. If you search in the internet for anything like "Houdini 16 @area detail" or similar you get practically nothing.

Cheers, and thank you all once again.

Link to comment
Share on other sites

13 hours ago, konstantin magnus said:

Use the sort node to sort your primitives reversely by attribute "area" and put 0 in a group or split node set to primitives.

Oh, yes! That does it too! 

I'll probably stick to my solution, but thanks for the reply. Always good to know alternative ways.

Thank you!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...