首页 文章

近似球面上两个线段之间的相对角度

提问于
浏览
2

我需要一个想法!我想用3D模拟眼睛上的血管网络 . 我已经统计了与血管直径,长度等有关的分支行为 . 我现在所困的是可视化:

眼睛近似为球体 E ,其中心位于原点 C = [0, 0, 0] ,半径为 r .

What I want to achieve 是基于以下输入参数,它应该能够在 E 的表面/周长上绘制一个段:

输入:

  • 上一段结束的笛卡尔位置: P_0 = [x_0, y_0, z_0]

  • 段长: L

  • 段直径: d

  • 相对于上一段的所需角度: a (1)

输出:

  • 结果段结束的笛卡尔位置: P_1 = [x_1, y_1, z_1]

What I do now ,如下:

  • P_0 生成一个半径为 L 的球体,表示我们可能使用正确长度绘制的所有点 . 该集合称为 pool .

  • 限制 pool 仅包括 r*0.95r 之间距离 C 的点,因此仅包括眼周边的点 .

  • 仅选择将生成最接近所需角度 a 的相对角度(2)的点 .

The problem is ,无论我想要什么角度,实际上并不是点积所测量的 . 假设我想要一个0°的角度(即新的段跟随前一个方向相同的方向,我实际得到的是一个大约30度的角度,因为球体的曲率 . 我猜我想要的更多是2D从从球体到分支点的正交角度观察时的角度 . 请查看下面的屏幕截图以进行可视化 .

有任何想法吗?


(1)其原因是,具有最大直径的子节点通常遵循前一段的路径,而较小的子节点倾向于以不同的角度 .

(2)由 acos(dot(v1/norm(v1), v2/norm(v2))) 计算


解释问题的屏幕截图:

黄线:上一段红线:“新”段到其中一个点(不一定是正确的)蓝色x':池(文本=弧度角)

enter image description here

enter image description here

1 回答

  • 1

    我会用自己的符号重述这个问题:

    给定以C为中心且半径为r的球体表面上的两个点P和Q,找到一个新的点T,使得从PQ到QT的转弯角度为A,QT的长度为L.

    因为这些线段相对于球体很小,我们将在枢轴点Q处使用球体的局部平面近似 . (如果这不是一个好的假设,则需要在您的问题中更明确 . )

    然后,您可以按如下方式计算T.

    // First compute an aligned orthonormal basis {U,V,W}.
    //  - {U,V} should be a basis for the plane tangent at Q.
    //  - W should be normal to the plane tangent at Q.
    //  - U should be in the direction PQ in the plane tangent at Q
    W = normalize(Q - C)
    U = normalize(Q - P)
    U = normalize(U - W * dotprod(W, U))
    V = normalize(crossprod(W, U))
    
    // Next compute the next point S in the plane tangent at Q.
    // In a regular plane, the parametric equation of a unit circle
    // centered at the origin is:
    //     f(A) = (cos A, sin A) = (1,0) cos A + (0,1) sin A
    // We just do the same thing, but with the {U,V} basis instead
    // of the standard basis {(1,0),(0,1)}.
    S = Q + L * (U cos A + V sin A)
    
    // Finally project S onto the sphere, obtaining the segment QT.
    T = C + r * normalize(S - C)
    

相关问题