MATLAB Answers

Plot a surface with cross-section matrix

15 ビュー (過去 30 日間)
Mateo Landazuri Pachano
Mateo Landazuri Pachano 2020 年 9 月 2 日
編集済み: Bruno Luong 2020 年 9 月 3 日
Good day,
I am looking on how to create a 3D surface directly on matlab (to be converted to igs and exported to Fluent). Currently I have a portion of a missile-like shape and I have the crossections stored in a matrix. The matrix size for the angular values is 576x640, meaning there are 576 cross-sections and 640 points per cross-section. The radial values are stored in a matrix of equal size. The distance vector, or the one that dictates how far is one crossection from the other is of size 1x576. (one value per cross-section). I cannot share the code due to its lenght but hopefully my issue could be explained properly.
I currently need to make a surface out of these matrices, preferably a surface that can later be generated on Ansys or can be exported to Solidworks. Help is much appreciated.

  2 件のコメント

Asad (Mehrzad)  Khoddam
Asad (Mehrzad) Khoddam 2020 年 9 月 2 日
So, do you have 576 values for z axis and for each one 640 pairs of x and y? right ?
Mateo Landazuri Pachano
Mateo Landazuri Pachano 2020 年 9 月 2 日
Sorry, I do not know how to address you directly, but yes, I got 640 points for every crossection, and I got 576 crossections, also I got a z vector with 576. The way I have ordered the data is by having one matrix for angular values, and another for radial values. Each row of these matrices is one crossection, and each row has 640 columns, making both matrices 576x640. And then I have the z vector as 1x576, which I believe should be transposed...

サインインしてコメントする。

採用された回答

Bruno Luong
Bruno Luong 2020 年 9 月 2 日
編集済み: Bruno Luong 2020 年 9 月 3 日
theta = your_angle
r = your_radial
z = your_z
% wrap around to close the azimuthal patch
theta = theta(:,[1:end 1]);
r = r(:,[1:end 1]);
x = r.*cos(theta);
y = r.*sin(theta);
z = repmat(z(:),1,size(x,2));
surf(x,y,z)

  1 件のコメント

Asad (Mehrzad)  Khoddam
Asad (Mehrzad) Khoddam 2020 年 9 月 2 日
The coordinates are not polar.

サインインしてコメントする。

その他の回答 (0 件)

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by