【问题标题】:How to calculate the volume of the ship under a surface如何计算水面下船舶的体积
【发布时间】:2016-12-31 15:29:04
【问题描述】:

现在我正在计算船的体积,船在水下的形状可以描述如下:

    0 0 0
    -20 12 0
    -20 18 0
    0 30 0
    0 10 -5
    0 20 -5
    0 30 02
    20 0 0
    20 10 -5
    20 20 -5
    20 30 0
    40 0 0
    40 10 -5
    40 20 -5
    40 30 0
    60 0 0
    60 10 -5
    60 20 -5
    60 30 0
    80 0 0
    80 10 -5
    0 20 -5
    80 30 0
    00 0 0
    100 10 -5
    100 20 -5
    100 30 0
    101 15 0
    100 0 0

然后

    text = load('---.txt')
    x = text(:,1) ;
    y = text(:,2) ;
    z = text(:,3) ;
    tri = delaunay(x,y);
    tmp=trisurf(tri,x,y,z);

我得到了船的大致形状,但是如何计算它在 z=0 下的体积?

【问题讨论】:

  • 考虑使用griddata 对分散数据进行插值,然后对网格值求和。
  • 谢谢,我得到了线性插值的近似音量。

标签: matlab matlab-figure


【解决方案1】:

首先,您的 3d 对象在您提供顶点(您拥有的)和面之前并没有真正定义,这些顶点和面是由 delanuay 三角剖分近似的(为此目的很糟糕)。

使用正确的三角测量,您可以调用 Mathworks 文件交换处的 Volume of a triangulated surface mesh

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-16
    • 1970-01-01
    相关资源
    最近更新 更多