How to present OBJ file (read as a mesh file) in a contour plot?

조회 수: 30 (최근 30일)
Colin Hollar
Colin Hollar 2018년 10월 10일
편집: Colin Hollar 2018년 10월 10일
I have collected some scans (file format of model from the scanner: .obj, .mtl and .jpg). I am able to read the files as a 3D mesh, and am looking for ways I can create a contour plot under the mesh

답변 (2개)

ANKUR KUMAR
ANKUR KUMAR 2018년 10월 10일
An example of creating a mesh is here,
[X,Y] = meshgrid(-5:.2:5);
R = sqrt(X.^2 + Y.^2);
Z = sin(R)./R;
mesh(X,Y,Z)
  댓글 수: 2
KSSV
KSSV 2018년 10월 10일
@ ANKUR KUMAR the user already able to plot the mesh..he wants the contour plot.
@ Colin Hollar attach one sample file...it can be done.
ANKUR KUMAR
ANKUR KUMAR 2018년 10월 10일
Ops. I misread the question.

댓글을 달려면 로그인하십시오.


KSSV
KSSV 2018년 10월 10일
This should work out:
obj = readObj(fname) ;
p = obj.v ;
t = obj.f ;
N = 10 ;
[c,h]=tricontour(t,p(:,1),p(:,2),p(:,3),N) ;
  댓글 수: 1
KSSV
KSSV 2018년 10월 10일
I think you should draw mesh for that, try:
trisurf(t,p(:,1),p(:,2),p(:,3))
As your question was plotting contours...I gave code for contours. Also change the value of N and try. Increase the value of N.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by