3

I have some 3D points like [x,y,z] and their values like [Bx,By,Bz] . The convex hull of these points are generated by convhull or convexHull

convex hull

Now I want to interpolate the values of triangle vertices for N new points on the convex hull. What are the possible methods to do this?

Adriaan
  • 17,741
  • 7
  • 42
  • 75
NGS92
  • 31
  • 1
  • What do you mean interpolate the values of triagle vertices? Of the complex hull? – Ander Biguri Oct 22 '20 at 09:34
  • yes, each vertex point has a value. They must be interpolated for new points on the generated convex hull. – NGS92 Oct 22 '20 at 09:42
  • Right. So if you use `convhull` for example, it returns the triangulation.You just need to know how to get values in a 3D triangle, which is quite easy (hint: its just values on a surface, bounded by some limits) – Ander Biguri Oct 22 '20 at 10:18
  • Where the new points are placed? Inside ,outside or on the surface of the convex hull? What Interpolation method do you want to use? Should the interpolation method use just 3 vertices , 4 vertices or all of the vertices of the convex hull ? – rahnema1 Oct 22 '20 at 15:05
  • The new point must be on the surface of the convex hull. The interpolation must be applied for each triangle (3 vertices of each triangle of the convex hull). – NGS92 Oct 22 '20 at 17:18
  • If I correctly understand you want to generate random points on the surface of the convex hull and interpolate their values based on the vertices of the convex hull. – rahnema1 Oct 22 '20 at 18:29
  • yes exactly....But notice that, it must be done for each triangle on the convex hull. – NGS92 Oct 24 '20 at 07:55

1 Answers1

0

Suppose a given point is p=(x,y,z) and you have found that it's located in a triangle p1=(x1, y1, z1), p2=(x2, y2, z2), and p3=(x3, y3, z3) (on the convex hull). Now if I understand correctly, we want to compute three non-negative real-valued a, b, and c, such that a * p1 + b * p2 + c * p3 = p and a + b + c = 1 (linear combination of the triangle's vertices). It can be defined by a matrix like M = [p1;p2;p3] with an equation like [a b c] * M = p. Hence, [a b c] = p * inv(M). You can do it for all other points.

Notice that if p is not inside the triangle, the solved [a b c] will not satisfy the non-negativity or a + b + c = 1.

OmG
  • 18,337
  • 10
  • 57
  • 90