用于c ++的类似matlab的isosurface库

时间:2013-05-02 12:48:14

标签: c++ matlab geometry-surface

是否有任何C ++库具有类似isosurface的功能用于MatLab?

以下是我需要的例子:

clc
clear

n = 30;       

x = linspace(-125,125,n); 
y = linspace(-125,125,n); 
z = linspace(-260,25,n);

[X,Y,Z] = meshgrid(x,y,z);
[X2,Y2] = meshgrid(x,y);

quan=abs(3.15*exp(-(X2.^2+Y2.^2)/(2*(28.8)^2)));
Quan=repmat(quan,[1 1 n]);

P=-Z-10*Quan
pv=isosurface(X,Y,Z,P,0);

pa=patch(pv);
xi=pv.vertices(:,1);
yi=pv.vertices(:,2);
zi=pv.vertices(:,3);

[zn]=griddata(xi,yi,zi,X2,Y2);

surf(zn);

0 个答案:

没有答案