how to generate planar projections from a 3d model

13 ビュー (過去 30 日間)
luca antonioli
luca antonioli 2019 年 7 月 15 日
コメント済み: darova 2020 年 2 月 7 日
hi, I have this model of an eye with different points that represent different structures... ( MATLAB figure)
I want to plot a projection along the z plane (like the first figure).
my idea is to generate different contours,for each structure,with the same z-coordinate and then, with polyftit/polyval ( or also b-spline) interpolate and generate the the contour in different planes,and at the end select the plane in which the x and y coordinates are bigger in modulus. is the idea correct?
are there other easer ways to generate contours?? any other methods able to generate isolines or isosurfaces?
should I consider contour3?
thanks

回答 (1 件)

darova
darova 2019 年 7 月 16 日
You want crossection of a surface in Z and other planes. Here is an example:
clc,clear
[X,Y,Z] = peaks(40);
figure(1)
contour3(X,Y,Z,-7:7) % create crossections in Z direction
hold on
% i don't know how extract contour
% without plotting
% so i just plot in the other figure
figure(2)
C = contour(Z,Y,X,-3:3); % extract contour in X direction
figure(1) % switch to the first figure
k = 1;
for i = 1:length(-3:3)
n = C(2,k); % number of points in the contour group
x = C(1,k); % x level
x = x +(1:n)*0;
z = C(1,(1:n)+k);
y = C(2,(1:n)+k);
plot3(x,y,z)
k = k+n+1; % index of the next contour group
end
hold off
Read more about Contour Matrix
contour_matrix_diagram.png
  2 件のコメント
yang zhang
yang zhang 2020 年 2 月 7 日
I want to achieve multi-dimensional model projection, how to operate?
darova
darova 2020 年 2 月 7 日
What do you mean? Can you show?

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

カテゴリ

Help Center および File ExchangeContour Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by