Jump to content

How to group polygons with more than 4 points?


Recommended Posts

Hello, sorry for that question but I cant find it somewhere. I saw that somewhere but my head :blink: , I starting modeling titanic for little project at work, and I want model as much procedural as I could. I want model it in maya, but, why not houdini? :rolleyes: so I have main body, There is a lot lot of little windows. I choose projecting circles copied on line. But triming create little artefact. So I choose polygons and cookie, works great. I create bounding group(for polycap), add polycap, but there I want little radius in windows for speculars to add measure of trunk. so I need extruding capped polys(12 ngon) how I could procedural select it? I mean, group polys with more than 4points Thanks a lot for help.

P.S.: Is there some easy way how to cup holes in mesh? I mean no groups, in maya I select model, choose hole, and maya automaticaly fill all holes. Houdini needs selected boundary edges or selected faces. (If I could get automaticaly group of new polygons, cups, will be great). Thanks BC.

Link to comment
Share on other sites

The key is that you want to group any faces that have more than 4 vertices. Since there is no expression that gives you the number of vertices for a polygon in hscript, you can either do it with a simple python expression, or using Attribute Promote. In the attached file there are setups doing this.

Using a python expression, you can compare the number of vertices for the currently iterating primitive and group if there are more than 4.

len(pwd().curPrim().vertices()) > 4

Or you can create a vertex attribute, set the value to $VTX + 1, then use an Attribute Promote to promote it from being a vertex attribute to a primitive attribute using the Maximum method then use that attribute to group by.

group_num_vertices.hipnc

Link to comment
Share on other sites

The key is that you want to group any faces that have more than 4 vertices. Since there is no expression that gives you the number of vertices for a polygon in hscript, you can either do it with a simple python expression, or using Attribute Promote. In the attached file there are setups doing this.

Using a python expression, you can compare the number of vertices for the currently iterating primitive and group if there are more than 4.

len(pwd().curPrim().vertices()) > 4

Or you can create a vertex attribute, set the value to $VTX + 1, then use an Attribute Promote to promote it from being a vertex attribute to a primitive attribute using the Maximum method then use that attribute to group by.

$NVTX > 4 works too :)

Link to comment
Share on other sites

That was what first came to mind, however for some reason my current Houdini build isn't playing so well with that so I had to suggest alternatives :(

Oh, :(

Dont have houdini in front of me so cant test it here right now.

Link to comment
Share on other sites

sigh. Further testing shows that the development build I have seems to have issues with local variable highlighting for lots of stuff. The first thing I tried was $NVTX > 4, but when I typed it in it came up red and I was like "Am I imagining that NVTX is a variable?". I should have hit Enter anyway since it works, even thoughn the input field saying it is invalid. I feel like a fool.

Link to comment
Share on other sites

  • 3 weeks later...

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...