Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: volume, convex hull, 3d curve, trisurf
Replies: 0

 leo nidas Posts: 237 Registered: 11/24/07
volume, convex hull, 3d curve, trisurf
Posted: Jan 2, 2013 4:23 AM

Hi there,

I have a closed curve in 3d and its projection on the xy plane. It is like an ellipse. I want to calculate the volume enclosed between these two curves. The example is provided below. The red curve is the projection of the blue one.

As an attempt I tried to use convexhull but during the visualization I see a gap there.
I am not sure that the volume I end up with is correct..

close all
clear all
clc

M=[0.6668 0.8150 0 0.2565
0.6678 0.8192 0 0.2494
0.6694 0.8230 0 0.2420
0.6717 0.8264 0 0.2346
0.6745 0.8293 0 0.2274
0.6778 0.8315 0 0.2208
0.6814 0.8329 0 0.2151
0.6851 0.8335 0 0.2105
0.6888 0.8333 0 0.2072
0.6924 0.8323 0 0.2052
0.6957 0.8304 0 0.2048
0.6986 0.8279 0 0.2059
0.7009 0.8247 0 0.2084
0.7027 0.8210 0 0.2122
0.7037 0.8170 0 0.2172
0.7040 0.8128 0 0.2231
0.7036 0.8086 0 0.2297
0.7025 0.8046 0 0.2367
0.7006 0.8008 0 0.2439
0.6982 0.7976 0 0.2510
0.6952 0.7949 0 0.2578
0.6918 0.7929 0 0.2639
0.6882 0.7917 0 0.2691
0.6845 0.7913 0 0.2733
0.6808 0.7918 0 0.2763
0.6773 0.7931 0 0.2779
0.6741 0.7952 0 0.2781
0.6713 0.7979 0 0.2769
0.6691 0.8012 0 0.2743
0.6676 0.8050 0 0.2704
0.6667 0.8091 0 0.2653
0.6666 0.8133 0 0.2592
0.6668 0.8150 0 0.2565];
M1=M(:,1);
M2=M(:,2);
M3=zeros(length(M2),1);
z=M(:,4);
figure
plot3(M1,M2,z)
hold on
plot3(M1,M2,M3,'r')

%An attempt is the following:
MM1=[M1;M1];MM2=[M2;M2];MM3=[z;M3]
X=[MM1 MM2 MM3]
dt = DelaunayTri(X);
[ch v] = convexHull(dt);
trisurf(ch, X(:,1),X(:,2),X(:,3), 'FaceColor', 'cyan')
alpha(0.8)

%desired volume that might be wrong:
volume=v