charly Posted July 21, 2016 Share Posted July 21, 2016 Hi, I'm a newbie in Houdini and vex, with basic knoledge of programming. I want to create vertex between points from 2 different objects, using vex. The look will be the Plexus style with the difference that I don't want the points to connect from each other when they are from the same geometry. I followed a tutorial from Entagma to help me. The question is : How do I get and compare an attribute from 2 points ? I tried to use pointattrib() to compare an attribute "myobj" that I created before but I don't have enought kwnolege yet to use it well. //__ List of the closest points int pnt_near[] = nearpoints(0, @P,dist, maxpoints); foreach(int pnt; pnt_near){ //__ condition if pnt and @ptnum do not share the same value of the attribute myobj if(pointattrib(0, myobj, pnt, 0) != pointattrib(0, myobj, @ptnum, 0) { int myprim = addprim(0,"polyline"); addvertex(0, myprim, pnt); addvertex(0, myprim, @ptnum); } } I don't know if it's the best way, so I'll be happy to hear any solution from you. Thanks, Charles plexus_attribute.hip Quote Link to comment Share on other sites More sharing options...
moedeldiho Posted July 22, 2016 Share Posted July 22, 2016 Hi Charles, one straightforward way would be to hook up one geo to the first input slot of your attribwrangle/pointwrangle, the other geo to the second one. Then perform a closest point search on the geo coming in through the second input only. After that you'd have to "copy" the found points into the first geo and use them to create the polylines: float searchradius = 0.15; int maxpoints = 5; int points[]; points = pcfind(1, "P", @P, 2*searchradius, maxpoints); foreach(int ptj; points) { int prim = addprim(geoself(), "polyline"); vector newpos = point(1, "P", ptj); int newpt = addpoint(geoself(), newpos); addvertex(geoself(), prim, @ptnum); addvertex(geoself(), prim, newpt); } Hope that helps, Cheers, Moritz 3 Quote Link to comment Share on other sites More sharing options...
charly Posted July 23, 2016 Author Share Posted July 23, 2016 Thanks heaps Moritz !!! I tried something similar, but couldn't find the proper syntax. Thanks again Charles 1 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.