Jump to content

grouping errors with $MAX


itriix

Recommended Posts

Just curious if anyone has run into this before... Grouping Points by expression using $MAX/$MIN won't work correctly in certain situations... but important for procedural grouping scenarios, like endpts

I first ran into it when i was following along with the procedural cities tutorials where there were a lot of grouping of points based on $ZMAX, $ZMIN, $YMAX... and I ended up just using some tweaked out expression to get it to work. The thing is, every once and a while, there would be points that would not go into the group... ON PERFECTLY SQUARE geometry.

Example:

Create a Poly Mesh Cube... Size: 7, 1, 1... Divisions: 50, 10, 10....

Group points by expression: $TX == $XMAX

Should get 100 points in the group... only getting 18!

however, if i change the scale in x a little bit, it picks them all up, or if i change the 50 to 51 or some other value it works also!

Anyways, my way around it for the time being was just doing $TX >= $XMAX - .01

however, that's still sketchy if i happened to get some super high res geo!

Anyone have any idea what's going on? Anyone run into this before? Seems like some precision error.

I'm using a Mac btw. Newest build of houdini but noticed it on earlier H10 builds also.

If anyone could check and verify if this is happening to them, that would be awesome also

Cheers,

Jonathan

Edited by itriix
Link to comment
Share on other sites

Works OK for me. I'm on Vista.

Hmmm, this is interesting. i'm wondering if it's a mac/houdini issue then. seems like it might be some kind of rounding error. however, this makes it seem like maybe it's not.

just curious, did you set up the exact same settings?

Poly Mesh Box

Quads

Size: 7, 1, 1

Center: 0, 0, 0

Axis Divisions: 50, 10, 10

Consolidate Corner Points: On

Then lay down a group node:

Entity: Points

Group by Expression: $TX == $XMAX

This results in 18 points in the group, instead of 100!

If I however change the expression to: $TX >= $XMAX - .001

The group will have 100!

Thanks for the efforts

Jonathan

Edited by itriix
Link to comment
Share on other sites

I'm currently using 2 x 2.8 GHz Quad-Core Intel Xeon Mac Pro, 10 GB 800 MHz DDR2 FB-DIMM Ram, OS X Leopard 10.5.8, NVIDIA GeForce 8800 GT, 512 RAM..

Hmmm, maybe it's a Mac/Houdini problem then.

Any others?

Edited by itriix
Link to comment
Share on other sites

I'm currently using 2 x 2.8 GHz Quad-Core Intel Xeon Mac Pro, 10 GB 800 MHz DDR2 FB-DIMM Ram, OS X Leopard 10.5.8, NVIDIA GeForce 8800 GT, 512 RAM..

Hmmm, maybe it's a Mac/Houdini problem then.

Any others?

I'm also on windows vista,but has the same problem with you,however,if set to the poly type,the problem is gone.

Link to comment
Share on other sites

Swann,

From your picture, it looks as though you are not using the same *scales* as I am... If we are using a Y up, Z facing towards camera, X facing to the right Axis system... The scale dimensions of the CUBE I created is: 7 x 1 x 1... So it's a rectangle.

In my example, this matters, because through my testing, different *dimensions* fixes the problem also... I noticed if I animated the *scale* in a particular dimension, it would have all 100 points... and then all of a sudden it would hit a particular X scale, and it would only have 18 points, but only at random particular values...

So if you have time, please try: 7 x 1 x 1... I'd be interested to see if you still are getting 100 points in that particular instance also.

Thanks,

Jonathan

Link to comment
Share on other sites

I'm also on windows vista,but has the same problem with you,however,if set to the poly type,the problem is gone.

Nature,

Thanks for testing for me... I've noticed that it happens at random values. So even though setting it to POLY may have fixed the issue, there might be a time when you are using a very specific scale of some dimension, or a different number of divisions and then all of a sudden the grouping will fail!

However, your observation of switching it to Polys does seem to work for all scales and dimensions i tried just now. However, you don't always want to just use a Poly with Divisions, and instead want a Poly Mesh... Therefore, it seems weird to me that it breaks down during the use of a poly mesh instead of poly.

Link to comment
Share on other sites

Swann,

From your picture, it looks as though you are not using the same *scales* as I am...

Upps, somehow I missed this. When I set it up, I got the same problem.

Sorry :).

Link to comment
Share on other sites

well at least now i don't have to worry about it being a "mac" issue! :)

I understand the idea behind the floating point comparison precision error but it still bugs me out that these points should all have the same exact translation value... *in this example* in $TX... even if they were 3.4999999999999999999 instead of 3.5... It seems that a comparison of: $TX == $XMAX should yield either a FULL grouping of the points or a full failure to group all the points... But not a mixed grouping of the points. That's the part where I get confused. In the SESI forum, where I was asking this question. I was suggested to run this script on the points to take a closer look at their values.

geo = hou.selectedNodes()[0].geometry() 
for pnt in geo.points(): 
 pos = pnt.position() 
 print "%d : %f, %f, %f" %(pnt.number(), pos[0], pos[1], pos[2])

Their $TX values were all 3.500000...

Anyways, can't wait to hear more about this one

Edited by itriix
Link to comment
Share on other sites

here is the new script, sorry for previous one, it was not precise enough

geo = hou.selectedNodes()[0].geometry()
for pnt in geo.points():
	pos = pnt.position()
	print "%d : %s, %s, %s" %(pnt.number(), pos[0], pos[1], pos[2])

details are here

http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=17175

Link to comment
Share on other sites

Ah okay thanks! That clarifies the "unprecise" values a bit better :) and why the expression wasn't working...

So I guess I just need to accept that even though those points should all have the same value, they just don't? ;)

Any ideas though WHY those $TX values ARE different?

Thanks so much for taking the time to explain and the script to verify it too

Jonathan

Edited by itriix
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...