How to find distance between two points in a primitive

   31260   15   6
User Avatar
Member
29 posts
Joined: May 2011
Offline
Guys,
Is there any preset expression to find the distance between two points in a primitive. I want to find the distance between two points in a primitve. I guess there must be some preset expression to do it, but i am not able to find the right one in the help.

Regards,
nittin
User Avatar
Member
257 posts
Joined: Nov. 2010
Offline
Yo,

have you tried the “Measure SOP”? i don't use it exceedingly but read the help docs, try it. hehe.

eitht.
User Avatar
Member
29 posts
Joined: May 2011
Offline
Hi eitht,
i have tried that i am not able to do that with measure SOP. Even the perimeter option in measure SOP is not able to do it.

Regards,
nittin
User Avatar
Member
700 posts
Joined: March 2009
Offline
Have you tried with expressions?! Check the example file.

Cheers

Attachments:
dist_between_points.hipnc (50.2 KB)

Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
330 posts
Joined: July 2007
Offline
.. and this version to justify the Measure SOP .




.cheers

Attachments:
measure.hipnc (35.8 KB)

except the things that cannot be seen , nothing is like it seems .
User Avatar
Member
700 posts
Joined: March 2009
Offline
here's quick and dirty measuring tool, kinda like Maya's

Attachments:
utils.otl (10.5 KB)

Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
257 posts
Joined: Nov. 2010
Offline
I love both methods of measuring the distance, but i'm leaning towards zarti's since i'm not an expression/function fanatic!

eitht.
User Avatar
Member
700 posts
Joined: March 2009
Offline
Of course, but I suggest you make a move to learn some basic expressions cause it'll make your life really easy. Imagine you want to use the distance between 2 points to drive the scale of another object or the amount particles generated in a POP net… even with the measure SOP you'll still need a bit of expression writing to get that distance value outta there and procedurally into another node or attribute. Unless, of course, you just need to know the distance for your own sake.
I haven't gotten into python as it pertains houdini, so I still use a lot of Hscript expressions and all. If you want to learn more I found this series to be quite helpful:

http://www.sidefx.com/index.php?option=com_content&task=view&id=1500&Itemid=132 [sidefx.com]

cheers
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
29 posts
Joined: May 2011
Offline
Guys,
Thanks a lot for your help your examples helped me a lot in resolving my problem. Thank you so much

Regards,
nittin
User Avatar
Member
1 posts
Joined: Feb. 2012
Offline
You can find distance between two points using distance calculator [distancebetweencities.us], To calculate distance between two points Google maps are the best option. So, try Google maps.
User Avatar
Member
11 posts
Joined: March 2008
Offline
You can find distance between two points using distance calculator, To calculate distance between two points Google maps are the best option. So, try Google maps.

CG DOES NOT WORK THAT WAY!!!
All humans are vermin in the eyes of Morbo!
User Avatar
Member
512 posts
Joined: July 2009
Offline
or you can do it in Python:


node = hou.node('/obj/curve_object1/merge1')
geo = node.geometry()
point1 = geo.points()
point1.position()
<hou.Vector3 >
pos1 = point1.position()
pos1.distanceTo(geo.points().position())


regards,

Manuel
http://vimeo.com/user2522760 [vimeo.com]
http://stormbornvfx.com/ [stormbornvfx.com]
Manuel Tausch
User Avatar
Member
258 posts
Joined:
Offline
Here is an asset that I made that has an embedded OTL that will take any object and calculate the distance between two points that the user inputs and return a value. It will also create a line between those two points if you would like.

Attachments:
distance_between_two points.hip (61.1 KB)

User Avatar
Member
9 posts
Joined: May 2016
Offline
rafaels
here's quick and dirty measuring tool, kinda like Maya's
But what unit does it measure in? I imported it and it works fantastically, but when I altered the scene's default Unit, the numbers didn't change to reflect the new units…
User Avatar
Member
700 posts
Joined: March 2009
Offline
It should be in whatever the default unit is… so if you altered the default unit to 1Km instead of the default metre, then you get the value in Kms.
Shouldn't be too hard to add controls to convert measurements, I might do that later on tonight

Cheers
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
327 posts
Joined: May 2016
Offline
rafaels
Of course, but I suggest you make a move to learn some basic expressions cause it'll make your life really easy. Imagine you want to use the distance between 2 points to drive the scale of another object or the amount particles generated in a POP net… even with the measure SOP you'll still need a bit of expression writing to get that distance value outta there and procedurally into another node or attribute. Unless, of course, you just need to know the distance for your own sake.
I haven't gotten into python as it pertains houdini, so I still use a lot of Hscript expressions and all. If you want to learn more I found this series to be quite helpful:

http://www.sidefx.com/index.php?option=com_content&task=view&id=1500&Itemid=132 [www.sidefx.com]

cheers

that link did not work. I just started learning Houdini, would this link be pertaining to expressions or python?
  • Quick Links