2008-11-05 75 views
0

我已經看過3D曲面的數據之前,但我不知道我可以使用什麼軟件來製作它。我有3個系列的數據(X,Y,Z),基本上我希望桌子上的每一行都是三維空間中的一個點,它們都作爲一個網格物體連接起來。數據目前是csv,但我可以改變格式,因爲它是我自己生成的數據。繪製一個3軸圖作爲網格

誰能幫

+0

我希望它適用於X,Y,Z的任何值。 當我使用matlab進行研究時,它希望X和Y(每次差異相同)的系列和z作爲x&y – 2008-11-06 00:11:58

+0

您是否已經知道點的連通性,還是您希望軟件從一組無序點推斷網格結構? – 2008-11-06 00:28:12

回答

5

如果你的X &Ÿ點在網格拓撲謊言,那麼你可以使用網格。他們不需要有間隔;他們只需要進行組織,使得x(r:r + 1,c:c + 1)和y(r:r + 1,c:c + 1)定義網格上的四邊形,對於每行r和列C。

如果您的數據不在網格上,但您知道面部應該是什麼,請查看PATCH功能。

如果您只有積分,而且對錶面不瞭解,則需要先解決surface reconstruction問題。我用過cocone;還有其他好的軟件包。一旦你有了重建的表面,那麼你可以使用PATCH來顯示它。

1

你看着使用vtk?如果你有Matlab的,那麼你應該能夠使用PLOT3D格式衝浪meshgrid的GridData生成三維表面圖或補丁通過Mr. Fooz的建議。

+0

這對我來說看起來太複雜了,我有權訪問matlab,但我沒有經驗。如果我玩了一下,nlucaroni的劇本看起來就像是我需要的一切。 感謝:D – 2008-11-06 00:08:39

+0

授予vtk可能太強大,你需要什麼。 Matlab/Scilab/Octave都非常簡單。 – Azim 2008-11-06 00:31:05

0

的gnuplot或scilab

下面是SciLab的一個腳本,我寫了一段時間回來。它讀取由製表符分隔的三列。你可以很容易地改變這個以適應你的需求,很不言自明。這是一個快速指導,reading/writing in scilab,我引用下面的一個是here

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