![]() So you can have 100 Iterations and get the distance pretty accuratly. This is a fairly good approximation as it is fast to compute. If you summ them up you get your final lenght. The Final distance is just the summ of all Distances in the final loop. From this point you then messure the distance to the surface and move it up by that amount.Īnd then it just repeats for all pieces. So each of the two has a point in the middle. These two Pieces then get subdivided again. You now KNOW that each of these pices is Half the Euclidian Distance. Then you take A and B and calculate the point in the middle. Step one is to calculate the Euclidian Distance between A and B So for example if the distance between two points on the sphere is sin(48) you know that the distance is 1/8 the Perimiter of your sphere.įor something with an Arbitrary surface you need to use something similar to Newtons methode and essentially approximate a solution. Remember, sin, cos and tan are just fractions of the Unicircle. Essentially you just messure the distance as a fraction of the Perimiter. U/Trakeen i dont think there is a mathematical way for arbitrary geometry. I mean the Euclidian distance is just a direct line from a to b. Setpointgroup(geoself(), group, pointNum, 1,"set") Printf("distance from point %i to closest is %f\n",pointNum,localDistance) Printf("closest point=%i\n",closestPoint) Setpointgroup(geoself(), group, pointNum, 0,"set") įloat localDistance=surfacedist(0, group, "P", pointNum, maxDistance, closestPoint, "surface") removes point from group when checking distance, otherwise will be zero since point is member of group ![]() string groupName=sprintf("group_%s",group) This is run from an attributewrangle node, with group containing all the points I want to check //check if a point within the group is within of any other point in the group, if so remove point from group Here is my Vex code, ignore the debugging code. I debugged my custom vex function and I know it is giving me zero because the closestpoint always returns the point I am trying to measure from (aka it is seeing itself as the closest point) I have tried using surfacedist Vex function and distancealonggeometry SoP and they both return zero. I am trying to measure the distance between points A and B on a surface and if point A is within a given distance of point B, remove point A from the group I think this is probably a basic misunderstanding on my part since I am new to Houdini.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |