X0RD Posted November 24, 2015 Share Posted November 24, 2015 Is it possible to round off numbers, not only to hole numbers, but also a multiply of a numbers, for example 1.4, to the would snap on 1.4, 2.8, 4.2, 5.6, ect.? I could like to be able to snap curves to a current height, like this: Quote Link to comment Share on other sites More sharing options...
mestela Posted November 24, 2015 Share Posted November 24, 2015 a wrangle way is to divide P.y by your unit size, round, then multiply by the unit size again. a more likely way is to use the grid snapping options of the fuse sop. non_integer_snap.hipnc 1 Quote Link to comment Share on other sites More sharing options...
X0RD Posted November 24, 2015 Author Share Posted November 24, 2015 Thanks for your input, im able to do this by writing mine first python node = hou.pwd() geo = node.geometry() # Add code to modify contents of geo. # Use drop down menu to select examples. for point in geo.points(): #print 'My Number: %s' % point.number() yPosition = point.position()[1] print yPosition aPosition = round(yPosition, 3) print aPosition step = 1.1 bPosition = aPosition / step print bPosition cPosition = round(bPosition, 0) print cPosition dPosition = cPosition * step print dPosition point.setPosition((point.position()[0], dPosition, point.position()[2])) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.