计算两个 3d 轨迹之间表面积的可靠方法?

Reliable way of calculating the surface area between two 3d trajectories?

给定两个不均匀的 3d 序列,找到它们之间表面积的最佳方法是什么?我想用三角形来近似表面积,但我对此并不那么兴奋。

你有什么建议吗?

我跟进了使用三角形的想法。结果对我来说似乎是正确的。

def heron(a, b, c): 
    s = (a+b+c)/2
    return (s*(s-a)*(s-b)*(s-c))**.5

def euclidean_dist(p1, p2): 
    return ((p2[0]-p1[0])**2 + (p2[1]-p1[1])**2 + (p2[2]-p1[2])**2)**.5
​
def surface_area(p, q):
    triangles = []
    bound = min(len(p), len(q))
    i, j, k = 0, 0, 1
    total_area = 0
    while k < bound:
        triangle = (p[i], q[j], p[k]) if sum([i, j])%2 else (q[i], p[j], q[k])
        sides = [euclidean_dist(*l) for l in combinations(triangle, 2)]
        area = heron(*sides)
        if isinstance(heron, complex): 
            continue 
        total_area += area
        triangles.append(triangle)
        if sum([i, j])%2:
            i = j 
            j = k 
            k += 1
        else: 
            i = j 
            j = k
    return triangles, total_area

p = list(zip(*[fp.x.values, fp.y.values, -fp.z.values]))
q = list(zip(*[lp.x.values, lp.y.values, -lp.z.values]))
triangles, area = surface_area(p, q)
​
# plot surface 
fig = plt.figure()
ax = fig.add_subplot(projection='3d')
for triangle in triangles: 
    triangle = list(triangle)
    triangle.append(triangle[0])
    xs, ys, zs = zip(*triangle)
    ax.plot(xs, ys, zs, color='red', alpha=.69)

希望这能帮助那些四处游荡的人找到一个起点。