Jump to content

Expression for delete faces


Recommended Posts

Hi, I'm learning Houdini expression.
Probably this is not the smarter way but for learning purpose.

The network is simple, a grid and connected a delete sop after the grid sop.
I want to delete every each other faces of the grid to make checker board pattern with an expression.

Expression is:
($PR%(ch("../grid1/rows")-1) +$PR/(ch("../grid1/cols")-1))%2

The result is looks working for half of the grid but another half potion is disappeared.

It was the same result on H15.5.56 and 16.0.55.

Possibly expression is wrong or missed some setting but I have no idea how to fix it.
Please give me an advice.

Thank you

2017-07-16_01h20_40.png

Link to comment
Share on other sites

this ? (or delete NON selected..whatever suits your purpose)

(the 2 is every 2nd.....3 would be every third....and so on)

hmm....if you have even number of columns...needs a bit more thinking...

checkerboard.jpg

Edited by Noobini
Link to comment
Share on other sites

Hi Noobini

Thank you for replay.

It looks very simple and I didn't know such way.

Definitely, I will learn that way next and I appreciate you sharing your idea.

But I'm trying to make an expression for any numbers of columns(EVEN number and ODD number ).

 

 

 

 

Link to comment
Share on other sites

Hi adrianr

Thank you for the file.

I'm sorry for late response but it took a little time to understand (I'm still new in Houdini, also)

I haven't thought such way to use sort1 and switch.

It is the good way to use Switching.

I had open your file and set the same number of rows and columns.

It wokrs Rows(and Columns) are 4,6,8.. but not works 3,5,7... .

I'd like to make it works for any numbers of rows(and columns).

(I should explain this at 1st.)

thank you.

2017-07-16_03h03_17.png

Link to comment
Share on other sites

yes I did say for EVEN cols only...(bear in mind houdini terminology deosn't help here...Grid columns are actually 'lines'...not a 'block'...so when the grid has 8 columns...it is 7 blocks....so when I say EVEN columns....I  meant BLOCKS...you know what I meant...)

Link to comment
Share on other sites

finally......If I can't demystify why ptnum works...I'll get rid of it....

Here's one where I insist on using primnum only...yes it's longer...but there's no 'mystery' about it

(now if I apply the same logic to the Group expression...it doesn't require the Int/Floor...interesting)

vu_Checkerboard3.hipnc

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