[Sidefx-houdini-list] rounding off in expression

John Coldrick jc at axyzfx.com
Fri Feb 13 08:36:23 EST 2009

On Thursday 12 February 2009 21:57, Robert D.M. Smith wrote:
> Just bumping this to see if anyone has any ideas on how to solve this

	Hey Rob, apologies, I haven't been following this thread, but I can't repro 
anything you've posted(from trying to glean all the material ;) ).

	Here's what I thought you've asked:

> On Wed, Feb 11, 2009 at 12:31 PM, Robert D.M. Smith <

> >> Can you get me a command script which fails like this?  Perhaps it's
> >> treating $VAR as a string?  So, maybe if you used atof($VAR)?
> >
> > There is AttributeCreate SOP generating a float point attribute - call it
> > 'custom'. The next SOP is a group that uses a filter expression 
> > if($CUSTOM
> >
> > > 90, 1, 0). A point with the value of 89.9564 gets missed.
> >
> > I tried if(atof($CUSTOM) > 90, 1, 0)) and if(atof($CUSTOM) > 90.0, 1, 0))
> > but no luck.

	You've lost me there...if $CUSTOM is *greater* than 90, it should be added to 
the group...and it's *not* in tests I've done with 89.9564, which is 
correct - true then '1', false then '0' according to your if.  I've fiddled 
around with creating a float attribute using that value and membership to 
point groups based on > < work for me, as expected.  If I've missed the 
actual question, please reiterate.  ;)   If I've not and you're getting 
different results, there must be something different between our specific 


John Coldrick                  www.axyzfx.com        Axyz Animation
416-504-0425                                         477 Richmond St W
                                                     Toronto, ON Canada
jc at axyzfx.com                                        M5V 3E7
Lies are like children: they're hard work, but it's worth it because the 
future depends on them.
  - Pam Davis

More information about the Sidefx-houdini-list mailing list