之前我看过三维表面数据,但我不知道可以使用哪种软件来制作它。

我有3个系列的数据(X,Y,Z)基本上我希望桌子上的每一行都是3d空间中的一个点,所有这些都作为网格连接。数据目前是csv,但我可以更改格式,因为它是我自己生成的数据。

任何人都可以提供帮助

有帮助吗?

解决方案

如果你的x& y在拓扑上位于网格上,然后你可以使用MESH。它们不需要有均匀的间距;它们只需要组织起来,使得x(r:r + 1,c:c + 1)和y(r:r + 1,c:c + 1)在网格上定义一个四边形,对于每一行r和列角

如果您的数据不在网格上,但您知道面部应该是什么,请查看PATCH函数。

如果您只有点并且您对表面一无所知,则需要首先解决表面重建问题。我用过cocone;那里还有其他好的套餐。一旦有了重建曲面,就可以使用PATCH来显示它。

其他提示

您是否考虑过使用 vtk ?如果您有Matlab,那么您应该能够使用 plot3d 冲浪 meshgrid griddata 来生成3D曲面先生建议的情节或补丁 。福兹

gnuplot或 scilab

下面是我写了一段时间的SciLab脚本。它读入由制表符分隔的三列。您可以轻松地更改它以满足您的需求,非常不言自明。以下是 scilab中的读/写快速指南我在下面参考的是这里

function plot_from_file(datafile)
//
// Make a simple x-y-z plot based on values read from a datafile.
// We assume that the datafile has three columns of floating-point
// values seperated by tabs.

  // set verbose = 1 to see lots of diagnostics
  verbose = 1;

  // open the datafile (quit if we can't)
  fid = mopen(datafile, 'r');
  if (fid == -1) 
    error('cannot open datafile');
  end

  // loop over all lines in the file, reading them one at a time
  num_lines = 0;
  while (true)

    // try to read the line ...
    [num_read, val(1), val(2), val(3)] = mfscanf(fid, "%f\t%f\t%f");
    if (num_read <= 0)
      break
    end
    if (verbose > 0)
      fprintf(1, 'num_lines %3d  num_read %4d \n', num_lines, num_read);
    end
    if (num_read ~= 3) 
      error('didn''t read three points');
    end

    // okay, that line contained valid data.  Store in arrays
    num_lines = num_lines + 1;
    x_array(num_lines) = val(1);
    y_array(num_lines) = val(2);
    z_array(num_lines) = val(3);
  end

  // now, make the plot
  plot3d2(x_array, y_array, z_array);
  // close the datafile
  mclose(fid);

endfunction
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top