connecting points with smallest distance
33171 15 2- hidahanyu
- Member
- 3 posts
- Joined: 9月 2010
- Offline
- ultraharmonizer
- Member
- 63 posts
- Joined: 9月 2009
- Offline
- alsegura
- Member
- 24 posts
- Joined: 12月 2008
- Offline
- rafaels
- Member
- 700 posts
- Joined: 3月 2009
- Offline
alternatively you can try to use the Point Cloud tools, I think…
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
- pclaes
- Member
- 257 posts
- Joined: 11月 2007
- Offline
Or you use the best of both worlds, you use pointclouds to detect the pointnumber of the closest point. And then you use a python sop to loop over the points and create a polygon (line) between those two points.
Cg Supervisor | Effects Supervisor | Expert Technical Artist at Infinity Ward
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
- rafaels
- Member
- 700 posts
- Joined: 3月 2009
- Offline
pclaes
Or you use the best of both worlds, you use pointclouds to detect the pointnumber of the closest point. And then you use a python sop to loop over the points and create a polygon (line) between those two points.
how would you store the closest point info for later recovery from python node? can we create array-like attributes for points?!
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
- rafaels
- Member
- 700 posts
- Joined: 3月 2009
- Offline
nevermind… I figured you can just create a comma separated string and then convert it to a list using python…
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
- Enrise
- Member
- 22 posts
- Joined: 11月 2010
- Offline
pclaes
Or you use the best of both worlds, you use pointclouds to detect the pointnumber of the closest point. And then you use a python sop to loop over the points and create a polygon (line) between those two points.
Hi Peter,
I'm trying to figure out how to make work something similar to what you suggested, but I'm quite lost..
Of course the issues that I'm facing could be more because of my lack of knowledge about VOP's, so may I ask you any example of what you mentioned? Any links or papers?
Thank you for any help
- grayOlorin
- Member
- 1799 posts
- Joined: 10月 2010
- Offline
- Enrise
- Member
- 22 posts
- Joined: 11月 2010
- Offline
Hi Gray,
thank you for your replay. Actually triangulate2D is exactly what I'm using now (I'm trying also ClothRefine..) and it does a good job by connecting each point multiple times with the nearest ones.
But because for the final aesthetic I will use the wireframe of the topology, I was wondering if there could be a way to get a less uniform triangulation by connecting the points similarly to triangulate2D but say a little more randomly.
Basically like it happens in cobweb
thank you for your replay. Actually triangulate2D is exactly what I'm using now (I'm trying also ClothRefine..) and it does a good job by connecting each point multiple times with the nearest ones.
But because for the final aesthetic I will use the wireframe of the topology, I was wondering if there could be a way to get a less uniform triangulation by connecting the points similarly to triangulate2D but say a little more randomly.
Basically like it happens in cobweb
- grayOlorin
- Member
- 1799 posts
- Joined: 10月 2010
- Offline
A few things you may try:
-put a pointJitter SOP in your points before you add geo to it
-you could generate something like a cobweb using a voronoi fracture on a mesh. Then you can create a cobweb geo using a polywire or wireframe SOP
-after your triangulate2D, try adding a divide, turn off convex polygons and turn on compute dual.
I think one or a combination of these may do the trick
-put a pointJitter SOP in your points before you add geo to it
-you could generate something like a cobweb using a voronoi fracture on a mesh. Then you can create a cobweb geo using a polywire or wireframe SOP
-after your triangulate2D, try adding a divide, turn off convex polygons and turn on compute dual.
I think one or a combination of these may do the trick
-G
- pclaes
- Member
- 257 posts
- Joined: 11月 2007
- Offline
Enmi
Hi Peter,
I'm trying to figure out how to make work something similar to what you suggested, but I'm quite lost..
Of course the issues that I'm facing could be more because of my lack of knowledge about VOP's, so may I ask you any example of what you mentioned? Any links or papers?
Thank you for any help
Hey,
Use a pointcloud to get the closest point (if you do not know how to use pointclouds, then do a search here or on odforce for pointclouds - and you can put my username: pclaes in there as well as I've shared some examples on pointclouds in the past), add that to an attribute called “closest_point”.
In regards to the python, it will be a python sop that reads that closest point attribute and creates a new polygon between the current point and the closest point. There is a cookbook example that can show you how to generate some of that geometry.
http://www.sidefx.com/docs/houdini11.1/hom/cookbook/surface_wires/ [sidefx.com]
I have done this in the past and made interesting spiderweb like shapes. The tricky bit is not so much straight wires, but curved wires. What starts out in a spiderweb as a straight wire can become a curved wire after it is pulled in different directions due to the tension in the web. Each segment is still straight though.
The cool bit is when you then use that “triangulate 3d” tool in a loop. As a little extra you can resample the newly generated polygons, potentially apply some noise and retriangulate using a shorter lookup distance. You then start to get a fractal nature into your patterns which is what makes it look cool.
Cg Supervisor | Effects Supervisor | Expert Technical Artist at Infinity Ward
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
- Enrise
- Member
- 22 posts
- Joined: 11月 2010
- Offline
- Mikal
- Member
- 15 posts
- Joined: 9月 2009
- Offline
I've just had to do something similar to this as I needed to create a neural network of sorts.
I created a python SOP that iterates through each point and evaluates the distance to other points in the group. If the distance falls below a threshold it creates geometry between both points - subdivisions of the line are also possible.
Not very fast, you wouldn't want to use it on more than 1000 points
Thought i would include it here as it might be of use to someone… somewhere. Hope the file works.
I created a python SOP that iterates through each point and evaluates the distance to other points in the group. If the distance falls below a threshold it creates geometry between both points - subdivisions of the line are also possible.
Not very fast, you wouldn't want to use it on more than 1000 points
Thought i would include it here as it might be of use to someone… somewhere. Hope the file works.
- matthias_k
- Member
- 483 posts
- Joined: 12月 2006
- Offline
- twelveplusplus
- Member
- 194 posts
- Joined: 8月 2011
- Offline
-
- Quick Links