Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
finding volume of irregular object

Subject: finding volume of irregular object

From: nman2084

Date: 22 May, 2011 20:21:04

Message: 1 of 6

I have irregular object's X, Y, Z (points).
Will it be ok for me to use delaunay3 and tetramesh to create the mesh. I also need to find the volume of this object, is there a function that i can use for it. I read something about convhulln function.

Subject: finding volume of irregular object

From: nman2084

Date: 23 May, 2011 14:25:22

Message: 2 of 6

I tried with this code, i find that v is very small for volume.

[fn,pn] = uigetfile('*.txt', 'Open the txt file to be read');
file=fullfile(pn,fn);
dat = load(file);

x = dat(:,1);
y = dat(:,2);
z = dat(:,3);

%[xi,I, J] = unique(x,'first');
%yi = y(I);
%zi = z(I);
verts = [x(:), y(:), z(:)];
faces = delaunay3(x, y, z);
tetramesh(faces, verts);
shading('flat');
[K, v] = convhulln(verts) ;

Data is like this so on about 25000 points:

1.53 22.60 -1.65
1.52 22.59 -1.61
1.53 22.59 -1.62
1.53 22.59 -1.63
1.53 22.59 -1.64
1.54 22.58 -1.64
1.54 22.58 -1.65
1.55 22.57 -1.66
1.57 22.55 -1.67
1.58 22.55 -1.67
1.57 22.56 -1.69
1.56 22.57 -1.70
1.55 22.58 -1.71
1.52 22.58 -1.60
1.53 22.57 -1.61
1.53 22.57 -1.62
1.54 22.57 -1.63
1.54 22.56 -1.63
1.57 22.55 -1.64
1.57 22.54 -1.65
1.58 22.54 -1.66
1.58 22.54 -1.67
1.58 22.54 -1.67
1.58 22.54 -1.68
1.58 22.54 -1.69
1.56 22.55 -1.70
1.55 22.57 -1.72
1.53 22.58 -1.73
1.51 22.57 -1.58
1.53 22.56 -1.59
1.54 22.55 -1.60
1.54 22.55 -1.61
1.55 22.54 -1.61
1.57 22.53 -1.62
1.57 22.52 -1.63
1.58 22.52 -1.64
1.58 22.52 -1.65
1.58 22.52 -1.66
1.58 22.52 -1.66
1.58 22.52 -1.67
1.58 22.52 -1.68
1.58 22.53 -1.69
1.57 22.53 -1.70
1.56 22.54 -1.71
1.55 22.55 -1.73
1.53 22.57 -1.74
1.51 22.56 -1.58
1.53 22.54 -1.59
1.54 22.54 -1.59
1.55 22.53 -1.60
1.56 22.53 -1.61
1.57 22.51 -1.62
1.58 22.51 -1.63
1.58 22.51 -1.63
1.58 22.51 -1.64
1.58 22.51 -1.65
1.58 22.51 -1.66
1.59 22.51 -1.67
1.58 22.51 -1.68
1.58 22.51 -1.69
1.58 22.52 -1.70
1.57 22.53 -1.71
1.55 22.54 -1.72
1.54 22.55 -1.73
1.53 22.56 -1.74
1.50 22.58 -1.76
1.48 22.60 -1.77
1.50 22.56 -1.57
1.52 22.55 -1.58
1.53 22.53 -1.58
1.54 22.52 -1.59
1.55 22.52 -1.60
1.56 22.51 -1.61
1.57 22.50 -1.61
1.58 22.50 -1.62
1.58 22.50 -1.63
1.58 22.50 -1.64
1.58 22.50 -1.65
1.58 22.50 -1.66
1.59 22.50 -1.67
1.59 22.50 -1.68
1.59 22.50 -1.69
1.58 22.50 -1.70
1.57 22.52 -1.71
1.56 22.52 -1.72
1.54 22.54 -1.73
1.54 22.54 -1.74
1.53 22.55 -1.75
1.49 22.58 -1.76
1.49 22.55 -1.56
1.51 22.54 -1.57
1.52 22.53 -1.58
1.53 22.52 -1.58
1.55 22.51 -1.59
1.55 22.50 -1.60
1.57 22.49 -1.61
1.57 22.49 -1.61
1.58 22.49 -1.62
1.58 22.48 -1.63
1.59 22.48 -1.64
1.59 22.48 -1.65
1.59 22.48 -1.66
1.59 22.48 -1.67
1.59 22.48 -1.68
1.59 22.48 -1.69
1.59 22.49 -1.70
1.58 22.50 -1.71
1.56 22.51 -1.72
1.55 22.52 -1.73
1.54 22.52 -1.74
1.54 22.53 -1.75
1.52 22.54 -1.76
1.52 22.55 -1.77
1.48 22.55 -1.56
1.51 22.53 -1.57
1.52 22.52 -1.57
1.53 22.51 -1.58
1.54 22.50 -1.59
1.55 22.49 -1.60
1.57 22.48 -1.60
1.57 22.48 -1.61
1.58 22.48 -1.62
1.58 22.47 -1.63
1.59 22.47 -1.64
1.59 22.47 -1.65
1.59 22.47 -1.66
1.59 22.47 -1.66
1.59 22.47 -1.67
1.59 22.47 -1.68
1.59 22.47 -1.69
1.59 22.48 -1.70
1.58 22.49 -1.71
1.57 22.49 -1.72
1.55 22.50 -1.73
1.54 22.52 -1.75
1.53 22.52 -1.76
1.50 22.55 -1.77
1.49 22.53 -1.56
1.51 22.52 -1.57
1.52 22.51 -1.58
1.53 22.50 -1.58
1.54 22.49 -1.59
1.55 22.48 -1.60
1.57 22.47 -1.61
1.57 22.47 -1.61
1.58 22.47 -1.62
1.58 22.46 -1.63
1.59 22.46 -1.64
1.59 22.46 -1.65
1.59 22.46 -1.66
1.59 22.46 -1.67
1.59 22.46 -1.67
1.59 22.46 -1.68
1.59 22.46 -1.69
1.59 22.46 -1.70
1.58 22.47 -1.71
1.57 22.48 -1.72
1.56 22.49 -1.74
1.55 22.50 -1.75
1.53 22.51 -1.76
1.50 22.54 -1.77
1.46 22.54 -1.56
1.50 22.51 -1.56
1.50 22.51 -1.57
1.52 22.50 -1.58
1.52 22.49 -1.58
1.54 22.48 -1.59
1.55 22.47 -1.60
1.56 22.46 -1.61
1.57 22.46 -1.61
1.58 22.45 -1.62
1.58 22.45 -1.63
1.58 22.45 -1.64
1.59 22.45 -1.65
1.59 22.45 -1.66
1.59 22.44 -1.66
1.59 22.44 -1.67
1.59 22.44 -1.68
1.59 22.45 -1.69
1.59 22.45 -1.70
1.59 22.45 -1.71
1.58 22.46 -1.72
1.57 22.47 -1.73
1.56 22.48 -1.74
1.53 22.50 -1.76
1.50 22.53 -1.77
1.44 22.54 -1.55
1.49 22.51 -1.56
1.50 22.50 -1.57
1.51 22.49 -1.57
1.52 22.49 -1.58
1.52 22.48 -1.59
1.54 22.47 -1.60
1.56 22.46 -1.60
1.57 22.45 -1.61
1.57 22.44 -1.62
1.58 22.44 -1.63
1.58 22.44 -1.64
1.59 22.43 -1.64
1.59 22.43 -1.65
1.59 22.43 -1.66
1.59 22.43 -1.67
1.60 22.43 -1.68
1.60 22.43 -1.69
1.59 22.43 -1.70
1.59 22.44 -1.71
1.59 22.44 -1.72
1.58 22.45 -1.73
1.57 22.46 -1.74
1.54 22.48 -1.75
1.45 22.53 -1.55
1.48 22.50 -1.56
1.50 22.49 -1.57
1.50 22.49 -1.57
1.51 22.48 -1.58
1.52 22.48 -1.59
1.53 22.46 -1.60
1.55 22.45 -1.60
1.56 22.44 -1.61
1.57 22.43 -1.62
1.58 22.43 -1.63
1.58 22.43 -1.64
1.58 22.43 -1.64
1.59 22.42 -1.65
1.59 22.42 -1.66
1.59 22.42 -1.67
1.59 22.42 -1.68
1.59 22.42 -1.69
1.60 22.42 -1.70
1.59 22.43 -1.71
1.59 22.43 -1.72
1.58 22.43 -1.73
1.58 22.44 -1.74
1.56 22.45 -1.75
1.47 22.53 -1.77
1.46 22.50 -1.55
1.48 22.49 -1.56
1.49 22.48 -1.57
1.50 22.48 -1.57
1.50 22.47 -1.58
1.51 22.47 -1.59
1.53 22.45 -1.60
1.55 22.44 -1.60
1.56 22.43 -1.61
1.57 22.42 -1.62
1.57 22.42 -1.63
1.58 22.41 -1.63
1.58 22.41 -1.64
1.59 22.41 -1.65
1.59 22.41 -1.66
1.59 22.41 -1.67
1.60 22.41 -1.68
1.59 22.41 -1.69
1.59 22.41 -1.70
1.59 22.42 -1.71
1.59 22.42 -1.72
1.58 22.42 -1.73
1.58 22.43 -1.74
1.56 22.44 -1.75
1.47 22.51 -1.77
1.52 22.48 -1.77
1.45 22.50 -1.55
1.47 22.49 -1.56
1.48 22.48 -1.56
1.49 22.47 -1.57
1.50 22.46 -1.58
1.51 22.45 -1.59
1.53 22.44 -1.59
1.55 22.43 -1.60
1.56 22.42 -1.61
1.56 22.42 -1.62
1.57 22.41 -1.63
1.58 22.41 -1.63
1.58 22.41 -1.64
1.58 22.40 -1.65
1.58 22.40 -1.66
1.59 22.40 -1.67
1.59 22.40 -1.68
1.59 22.40 -1.69
1.59 22.40 -1.69
1.59 22.40 -1.70
1.59 22.41 -1.71
1.58 22.41 -1.72
1.58 22.41 -1.73
1.58 22.42 -1.74
1.46 22.51 -1.77
1.51 22.48 -1.77
1.46 22.49 -1.55
1.47 22.48 -1.56
1.48 22.47 -1.57
1.49 22.46 -1.57
1.50 22.45 -1.58
1.51 22.45 -1.59
1.53 22.43 -1.60
1.54 22.42 -1.60
1.56 22.41 -1.61
1.56 22.41 -1.62
1.57 22.40 -1.63
1.58 22.40 -1.64
1.58 22.40 -1.64
1.58 22.39 -1.65
1.58 22.40 -1.66
1.59 22.39 -1.67
1.59 22.39 -1.68
1.59 22.39 -1.69
1.59 22.40 -1.70
1.59 22.40 -1.71
1.58 22.40 -1.72
1.58 22.40 -1.73
1.57 22.41 -1.74
1.57 22.41 -1.75
1.47 22.50 -1.77
1.51 22.46 -1.77
1.45 22.48 -1.55
1.46 22.47 -1.56
1.47 22.46 -1.57
1.48 22.45 -1.58
1.50 22.44 -1.58
1.51 22.43 -1.59
1.52 22.43 -1.60
1.54 22.41 -1.60
1.55 22.40 -1.61
1.56 22.40 -1.62
1.57 22.39 -1.63
1.57 22.39 -1.64
1.58 22.38 -1.64
1.58 22.38 -1.65
1.58 22.38 -1.66
1.59 22.38 -1.67
1.59 22.38 -1.68
1.59 22.38 -1.69
1.59 22.38 -1.70
1.58 22.39 -1.71
1.58 22.39 -1.72
1.58 22.39 -1.73
1.57 22.40 -1.74
1.57 22.40 -1.75
1.46 22.49 -1.77
1.51 22.45 -1.77
1.44 22.47 -1.55
1.45 22.47 -1.56
1.46 22.46 -1.57
1.47 22.45 -1.57
1.49 22.44 -1.58
1.50 22.43 -1.59
1.51 22.42 -1.60
1.53 22.41 -1.60
1.54 22.40 -1.61
1.55 22.39 -1.62
1.56 22.39 -1.63
1.57 22.38 -1.63
1.57 22.38 -1.64
1.58 22.37 -1.65
1.58 22.37 -1.66
1.59 22.37 -1.67
1.59 22.37 -1.68
1.59 22.37 -1.69
1.58 22.37 -1.70
1.58 22.38 -1.70
1.58 22.38 -1.71
1.58 22.38 -1.72
1.57 22.39 -1.73
1.57 22.39 -1.74
1.50 22.45 -1.77
1.43 22.47 -1.55
1.44 22.46 -1.56
1.45 22.45 -1.57
1.47 22.45 -1.58
1.48 22.44 -1.58
1.49 22.43 -1.59
1.50 22.42 -1.60
1.52 22.41 -1.60
1.53 22.40 -1.61
1.55 22.39 -1.62
1.55 22.38 -1.63
1.56 22.38 -1.63
1.57 22.37 -1.64
1.58 22.37 -1.65
1.58 22.37 -1.66
1.58 22.36 -1.67
1.58 22.36 -1.68
1.58 22.36 -1.69
1.58 22.37 -1.69
1.58 22.37 -1.70
1.58 22.37 -1.71
1.57 22.38 -1.72
1.57 22.38 -1.73
1.56 22.38 -1.74
1.55 22.39 -1.75
1.49 22.44 -1.77
1.43 22.46 -1.55
1.43 22.45 -1.56
1.45 22.45 -1.57
1.46 22.44 -1.57
1.47 22.43 -1.58
1.48 22.42 -1.59
1.49 22.41 -1.60
1.51 22.40 -1.60
1.52 22.39 -1.61
1.53 22.38 -1.62
1.54 22.37 -1.63
1.55 22.37 -1.63
1.56 22.36 -1.64
1.57 22.36 -1.65
1.57 22.36 -1.66
1.58 22.35 -1.67
1.58 22.35 -1.68
1.58 22.35 -1.68
1.58 22.35 -1.69
1.57 22.36 -1.70
1.57 22.36 -1.71
1.57 22.36 -1.72
1.56 22.37 -1.73
1.56 22.37 -1.74
1.55 22.38 -1.75
1.48 22.44 -1.77
1.43 22.45 -1.56
1.44 22.44 -1.57
1.45 22.43 -1.57
1.46 22.43 -1.58
1.47 22.42 -1.59
1.48 22.41 -1.60
1.50 22.40 -1.60
1.51 22.39 -1.61
1.52 22.38 -1.62
1.53 22.37 -1.63
1.54 22.37 -1.63
1.55 22.36 -1.64
1.56 22.36 -1.65
1.56 22.35 -1.66
1.57 22.35 -1.67
1.57 22.35 -1.67
1.57 22.35 -1.68
1.57 22.35 -1.69
1.57 22.35 -1.70
1.57 22.35 -1.71
1.57 22.35 -1.72
1.56 22.36 -1.73
1.56 22.36 -1.74
1.55 22.37 -1.75
1.49 22.42 -1.77
1.34 22.51 -1.56
1.42 22.44 -1.56
1.43 22.44 -1.57
1.44 22.43 -1.57
1.45 22.42 -1.58
1.46 22.42 -1.59
1.47 22.41 -1.60
1.49 22.40 -1.60
1.50 22.39 -1.61
1.51 22.38 -1.62
1.52 22.37 -1.63
1.53 22.36 -1.63
1.54 22.36 -1.64
1.55 22.35 -1.65
1.56 22.35 -1.66
1.56 22.35 -1.67
1.57 22.34 -1.67
1.57 22.34 -1.68
1.57 22.34 -1.69
1.57 22.34 -1.70
1.57 22.34 -1.71
1.57 22.34 -1.72
1.56 22.35 -1.73
1.56 22.35 -1.74
1.55 22.36 -1.75
1.50 22.40 -1.77
1.52 22.39 -1.77
1.30 22.53 -1.57
1.42 22.43 -1.56
1.43 22.43 -1.57
1.44 22.42 -1.58
1.45 22.42 -1.58
1.45 22.41 -1.59
1.46 22.41 -1.60
1.48 22.39 -1.61
1.49 22.38 -1.61
1.50 22.37 -1.62
1.52 22.36 -1.63
1.53 22.36 -1.64
1.54 22.35 -1.64
1.54 22.35 -1.65
1.55 22.34 -1.66
1.55 22.34 -1.67
1.56 22.34 -1.68
1.56 22.33 -1.69
1.56 22.34 -1.69
1.56 22.33 -1.70
1.56 22.34 -1.71
1.56 22.34 -1.72
1.55 22.34 -1.73
1.55 22.35 -1.74
1.54 22.36 -1.75
1.48 22.40 -1.77
1.29 22.52 -1.56
1.42 22.42 -1.57
1.43 22.41 -1.57
1.44 22.41 -1.58
1.45 22.40 -1.59
1.45 22.40 -1.60
1.46 22.39 -1.61
1.48 22.38 -1.61
1.50 22.37 -1.62
1.51 22.36 -1.63
1.52 22.35 -1.64
1.53 22.35 -1.64
1.53 22.34 -1.65
1.54 22.34 -1.66
1.55 22.33 -1.67
1.55 22.33 -1.68
1.55 22.33 -1.69
1.55 22.33 -1.69
1.56 22.33 -1.70
1.55 22.33 -1.71
1.55 22.33 -1.72
1.55 22.34 -1.73
1.54 22.34 -1.74
1.53 22.35 -1.75
1.50 22.38 -1.77
1.42 22.41 -1.57
1.43 22.41 -1.57
1.43 22.40 -1.58
1.44 22.40 -1.59
1.45 22.39 -1.60
1.46 22.38 -1.61
1.47 22.37 -1.61
1.49 22.36 -1.62
1.50 22.36 -1.63
1.51 22.35 -1.64
1.52 22.34 -1.64
1.53 22.34 -1.65
1.53 22.33 -1.66
1.54 22.33 -1.67
1.54 22.33 -1.68
1.54 22.33 -1.69
1.55 22.33 -1.69
1.55 22.33 -1.70
1.55 22.33 -1.71
1.54 22.33 -1.72
1.54 22.33 -1.73
1.54 22.34 -1.74
1.53 22.35 -1.75
1.49 22.38 -1.77
1.41 22.40 -1.57
1.42 22.40 -1.57
1.43 22.39 -1.58
1.44 22.38 -1.59
1.45 22.38 -1.60
1.46 22.37 -1.61
1.47 22.36 -1.61
1.49 22.35 -1.62
1.50 22.35 -1.63
1.50 22.34 -1.64
1.51 22.34 -1.65
1.52 22.33 -1.65
1.52 22.33 -1.66
1.52 22.33 -1.67
1.52 22.33 -1.68
1.52 22.33 -1.69
1.53 22.32 -1.70
1.54 22.32 -1.70
1.54 22.32 -1.71
1.53 22.33 -1.72
1.52 22.33 -1.73
1.52 22.33 -1.74
1.51 22.34 -1.75
1.45 22.39 -1.77
1.37 22.42 -1.56
1.41 22.40 -1.56
1.42 22.39 -1.57
1.43 22.38 -1.58
1.43 22.38 -1.59
1.44 22.37 -1.60
1.45 22.36 -1.60
1.47 22.36 -1.61
1.48 22.35 -1.62
1.49 22.34 -1.63
1.50 22.33 -1.63
1.50 22.33 -1.64
1.51 22.33 -1.65
1.51 22.33 -1.66
1.51 22.33 -1.67
1.51 22.33 -1.68
1.51 22.33 -1.69
1.52 22.32 -1.70
1.52 22.32 -1.70
1.52 22.32 -1.71
1.52 22.33 -1.72
1.51 22.33 -1.73
1.51 22.33 -1.74
1.50 22.34 -1.75
1.47 22.37 -1.77
1.41 22.39 -1.56
1.41 22.38 -1.57
1.42 22.38 -1.58
1.43 22.37 -1.59
1.44 22.37 -1.60
1.45 22.36 -1.60
1.46 22.35 -1.61
1.47 22.34 -1.62
1.48 22.33 -1.63
1.49 22.33 -1.64
1.49 22.33 -1.64
1.50 22.32 -1.65
1.50 22.32 -1.66
1.50 22.32 -1.67
1.50 22.32 -1.68
1.50 22.32 -1.69
1.51 22.32 -1.70
1.50 22.32 -1.71
1.51 22.32 -1.71
1.50 22.32 -1.72
1.50 22.33 -1.73
1.50 22.33 -1.74
1.49 22.34 -1.75
1.46 22.37 -1.77
1.40 22.38 -1.57
1.41 22.37 -1.57
1.42 22.36 -1.58
1.42 22.36 -1.59
1.43 22.36 -1.60
1.45 22.34 -1.61
1.46 22.34 -1.61
1.47 22.33 -1.62
1.47 22.33 -1.63
1.48 22.32 -1.64
1.48 22.32 -1.65
1.49 22.32 -1.65
1.49 22.32 -1.66
1.50 22.31 -1.67
1.50 22.32 -1.68
1.49 22.32 -1.69
1.50 22.31 -1.70
1.49 22.32 -1.71
1.49 22.32 -1.72
1.49 22.33 -1.73
1.49 22.33 -1.74
1.48 22.33 -1.75
1.48 22.33 -1.76
1.44 22.37 -1.77
1.29 22.45 -1.57
1.40 22.37 -1.57
1.40 22.37 -1.57
1.41 22.36 -1.58
1.42 22.36 -1.59
1.43 22.35 -1.60
1.44 22.34 -1.60
1.45 22.33 -1.61
1.46 22.33 -1.62
1.46 22.33 -1.63
1.47 22.32 -1.64
1.47 22.32 -1.65
1.48 22.31 -1.65
1.48 22.32 -1.66
1.48 22.31 -1.67
1.48 22.31 -1.68
1.48 22.32 -1.69
1.48 22.32 -1.70
1.48 22.32 -1.71
1.48 22.32 -1.72
1.48 22.32 -1.73
1.48 22.32 -1.74
1.48 22.32 -1.75
1.47 22.33 -1.76
1.43 22.36 -1.77
1.30 22.43 -1.57
1.39 22.37 -1.57
1.40 22.36 -1.57
1.41 22.35 -1.58
1.42 22.35 -1.59
1.42 22.34 -1.60
1.44 22.33 -1.61
1.45 22.33 -1.61
1.45 22.32 -1.62
1.46 22.32 -1.63
1.46 22.32 -1.64
1.46 22.32 -1.65
1.47 22.31 -1.66
1.47 22.31 -1.67
1.47 22.31 -1.67
1.47 22.31 -1.68
1.47 22.32 -1.69
1.47 22.32 -1.70
1.46 22.32 -1.71
1.47 22.32 -1.72
1.47 22.32 -1.73
1.47 22.32 -1.74
1.47 22.32 -1.75
1.45 22.33 -1.76
1.43 22.36 -1.77
1.30 22.42 -1.57
1.38 22.36 -1.57
1.39 22.35 -1.58
1.40 22.35 -1.58
1.41 22.34 -1.59
1.41 22.34 -1.60
1.43 22.33 -1.61
1.43 22.32 -1.62
1.44 22.32 -1.62
1.45 22.32 -1.63
1.45 22.31 -1.64
1.45 22.32 -1.65
1.45 22.31 -1.66
1.45 22.31 -1.67
1.45 22.31 -1.68
1.45 22.32 -1.69
1.45 22.32 -1.69
1.45 22.31 -1.70
1.45 22.32 -1.71
1.46 22.31 -1.72
1.46 22.31 -1.73
1.46 22.32 -1.74
1.45 22.33 -1.75
1.41 22.35 -1.77
1.27 22.43 -1.57
1.37 22.36 -1.57
1.38 22.35 -1.58
1.39 22.34 -1.58
1.40 22.34 -1.59
1.40 22.33 -1.60
1.41 22.33 -1.61
1.42 22.32 -1.62
1.43 22.32 -1.62
1.43 22.32 -1.63
1.44 22.31 -1.64
1.44 22.31 -1.65
1.44 22.31 -1.66
1.44 22.31 -1.67
1.44 22.31 -1.68
1.44 22.31 -1.69
1.45 22.31 -1.70
1.45 22.31 -1.70
1.45 22.31 -1.71
1.45 22.31 -1.72
1.45 22.31 -1.73
1.45 22.31 -1.74
1.43 22.33 -1.75
1.27 22.42 -1.57
1.36 22.35 -1.57
1.37 22.35 -1.58
1.38 22.34 -1.59
1.39 22.33 -1.59
1.40 22.33 -1.60
1.41 22.32 -1.61
1.41 22.32 -1.62
1.42 22.32 -1.63
1.42 22.31 -1.64
1.43 22.31 -1.64
1.43 22.31 -1.65
1.43 22.31 -1.66
1.43 22.31 -1.67
1.44 22.31 -1.68
1.44 22.31 -1.69
1.44 22.31 -1.70
1.44 22.30 -1.71
1.44 22.31 -1.72
1.44 22.30 -1.72
1.44 22.31 -1.73
1.43 22.32 -1.74
1.34 22.38 -1.77
1.34 22.36 -1.57
1.36 22.34 -1.58
1.37 22.34 -1.59
1.38 22.33 -1.59
1.38 22.33 -1.60
1.39 22.32 -1.61
1.39 22.32 -1.62
1.40 22.32 -1.63
1.40 22.31 -1.64
1.41 22.31 -1.64
1.42 22.30 -1.65
1.42 22.30 -1.66
1.42 22.30 -1.67
1.42 22.30 -1.68
1.43 22.30 -1.69
1.43 22.30 -1.70
1.43 22.30 -1.71
1.42 22.30 -1.72
1.42 22.31 -1.73
1.41 22.31 -1.74
1.33 22.36 -1.58
1.35 22.34 -1.59
1.36 22.33 -1.59
1.37 22.33 -1.60
1.38 22.32 -1.61
1.38 22.32 -1.62
1.38 22.32 -1.63
1.39 22.31 -1.64
1.40 22.31 -1.64
1.41 22.30 -1.65
1.41 22.30 -1.66
1.41 22.30 -1.67
1.41 22.30 -1.68
1.41 22.30 -1.69
1.41 22.30 -1.70
1.42 22.30 -1.70
1.41 22.30 -1.71
1.41 22.30 -1.72
1.39 22.32 -1.74
1.34 22.34 -1.59
1.35 22.33 -1.59
1.36 22.33 -1.60
1.37 22.32 -1.61
1.37 22.32 -1.62
1.37 22.32 -1.63
1.38 22.31 -1.64
1.39 22.30 -1.64
1.40 22.30 -1.65
1.40 22.30 -1.66
1.41 22.30 -1.67
1.40 22.30 -1.68
1.41 22.30 -1.69
1.40 22.30 -1.70
1.41 22.30 -1.71
1.40 22.30 -1.72
1.40 22.31 -1.73
1.34 22.32 -1.60
1.35 22.32 -1.61
1.35 22.32 -1.62
1.36 22.31 -1.63
1.36 22.31 -1.64
1.37 22.30 -1.64
1.38 22.30 -1.65
1.39 22.30 -1.66
1.39 22.29 -1.67
1.39 22.29 -1.68
1.39 22.29 -1.69
1.39 22.30 -1.70
1.39 22.30 -1.71
1.38 22.30 -1.72
1.45 22.32 -1.68
1.44 22.31 -1.68
1.42 22.60 -1.58
1.43 22.58 -1.57
1.38 22.56 -1.56
1.39 22.55 -1.56
1.35 22.55 -1.56
1.42 22.54 -1.55
1.39 22.54 -1.55
1.42 22.53 -1.55
1.41 22.53 -1.55
1.42 22.52 -1.55
1.28 22.49 -1.57
1.43 22.48 -1.55
1.27 22.49 -1.57
1.43 22.47 -1.55
1.27 22.48 -1.57
1.43 22.47 -1.55
1.27 22.47 -1.57
1.42 22.46 -1.55
1.43 22.46 -1.56
1.27 22.47 -1.57
1.43 22.45 -1.56
1.26 22.46 -1.57
1.42 22.45 -1.56
1.27 22.46 -1.57
1.42 22.44 -1.56
1.43 22.44 -1.56
1.26 22.45 -1.57
1.42 22.44 -1.56
1.43 22.44 -1.57
1.27 22.44 -1.57
1.42 22.43 -1.56
1.43 22.43 -1.57
1.28 22.43 -1.57
1.42 22.42 -1.56
1.43 22.42 -1.57
1.43 22.42 -1.57
1.41 22.42 -1.56
1.42 22.42 -1.57
1.43 22.42 -1.57
1.44 22.42 -1.58
1.41 22.41 -1.56
1.42 22.41 -1.57
1.43 22.41 -1.58
1.40 22.40 -1.56
1.41 22.40 -1.57
1.42 22.40 -1.57
1.43 22.40 -1.58
1.40 22.40 -1.56
1.41 22.40 -1.56
1.41 22.40 -1.57
1.42 22.40 -1.57
1.43 22.40 -1.58
1.39 22.39 -1.56
1.40 22.39 -1.56
1.41 22.39 -1.57
1.42 22.39 -1.58
1.43 22.39 -1.58
1.38 22.39 -1.56
1.40 22.39 -1.57
1.41 22.39 -1.57
1.42 22.39 -1.58
1.43 22.39 -1.58
1.44 22.39 -1.59
1.37 22.38 -1.56
1.39 22.38 -1.57
1.41 22.38 -1.57
1.41 22.38 -1.58
1.42 22.38 -1.58
1.43 22.38 -1.59
1.43 22.38 -1.59
1.37 22.38 -1.56
1.39 22.37 -1.57
1.41 22.37 -1.57
1.42 22.37 -1.58
1.42 22.37 -1.58
1.43 22.37 -1.59
1.43 22.38 -1.59
1.37 22.37 -1.57
1.38 22.37 -1.57
1.40 22.37 -1.57
1.41 22.37 -1.58
1.42 22.37 -1.58
1.42 22.37 -1.59
1.43 22.37 -1.60
1.44 22.37 -1.60
1.36 22.36 -1.57
1.38 22.36 -1.57
1.39 22.36 -1.58
1.41 22.36 -1.58
1.41 22.36 -1.59
1.42 22.36 -1.59
1.43 22.36 -1.60
1.44 22.36 -1.60
1.37 22.36 -1.57
1.39 22.36 -1.58
1.40 22.36 -1.58
1.41 22.36 -1.59
1.42 22.36 -1.59
1.43 22.36 -1.60
1.44 22.36 -1.60
1.35 22.35 -1.58
1.37 22.35 -1.58
1.39 22.35 -1.58
1.41 22.35 -1.59
1.42 22.35 -1.59
1.43 22.35 -1.60
1.44 22.35 -1.60
1.35 22.35 -1.58
1.37 22.34 -1.59
1.39 22.34 -1.59
1.41 22.34 -1.59
1.42 22.34 -1.60
1.43 22.34 -1.60
1.44 22.34 -1.61
1.36 22.34 -1.59
1.37 22.34 -1.59
1.39 22.34 -1.60
1.41 22.34 -1.60
1.42 22.34 -1.60
1.43 22.34 -1.61
1.37 22.33 -1.60
1.39 22.33 -1.60
1.41 22.33 -1.61
1.42 22.33 -1.61
1.43 22.33 -1.62
1.38 22.33 -1.61
1.40 22.33 -1.61
1.41 22.33 -1.62
1.42 22.33 -1.62
1.38 22.32 -1.62
1.40 22.32 -1.63
1.41 22.32 -1.63
1.44 22.32 -1.64
1.40 22.32 -1.64
1.43 22.31 -1.65
1.43 22.32 -1.65
1.44 22.32 -1.66
1.44 22.32 -1.66
1.44 22.32 -1.67
1.45 22.32 -1.67
1.41 22.31 -1.65
1.42 22.31 -1.65
1.43 22.31 -1.66
1.43 22.31 -1.66
1.43 22.31 -1.67
1.44 22.31 -1.68
1.41 22.31 -1.65
1.42 22.31 -1.66
1.42 22.31 -1.66
1.42 22.31 -1.67
1.43 22.31 -1.68
1.40 22.30 -1.68
1.41 22.30 -1.68
1.44 22.31 -1.69
1.44 22.31 -1.69
1.45 22.31 -1.70
1.45 22.32 -1.71
1.43 22.31 -1.68
1.43 22.31 -1.69
1.44 22.31 -1.69
1.44 22.31 -1.70
1.41 22.30 -1.69
1.52 22.61 -1.64
1.52 22.61 -1.65
1.52 22.61 -1.65
1.51 22.61 -1.66
1.50 22.61 -1.67
1.50 22.62 -1.68

Subject: finding volume of irregular object

From: Sean de

Date: 23 May, 2011 15:15:21

Message: 3 of 6

"nman2084" wrote in message <irdqoi$e7c$1@newscl01ah.mathworks.com>...
> I tried with this code, i find that v is very small for volume.
> [K, v] = convhulln(verts) ;

Is the object actually convex? If it's not there are volume approximation tools by Luigi Giaccara that will do what you want I believe.

http://www.mathworks.com/matlabcentral/fileexchange/authors/31779

Subject: finding volume of irregular object

From: Steven_Lord

Date: 23 May, 2011 15:24:19

Message: 4 of 6



"nman2084 " <ng2084@yahoo.com> wrote in message
news:irdqoi$e7c$1@newscl01ah.mathworks.com...
> I tried with this code, i find that v is very small for volume.
>
> [fn,pn] = uigetfile('*.txt', 'Open the txt file to be read');
> file=fullfile(pn,fn);
> dat = load(file);
>
> x = dat(:,1);
> y = dat(:,2);
> z = dat(:,3);
>
> %[xi,I, J] = unique(x,'first');
> %yi = y(I);
> %zi = z(I);
> verts = [x(:), y(:), z(:)];
> faces = delaunay3(x, y, z);
> tetramesh(faces, verts);
> shading('flat');
> [K, v] = convhulln(verts) ;

*snip large data*

When I ran this code on the data you posted, the image that appeared was of
basically a portion of a ball. The axes limits were between 1.26 and 1.6,
between 22.29 and 22.62, and between -1.77 and -1.55. If the "ball" took up
the entire axes then its volume would be:

(1.6-1.26)*(22.62-22.29)*(-1.55-(-1.77))

or approximately 0.0247. The value I obtained for v was 0.0122, which is
about half the total volume of the axes. Looking at the image that was
displayed, I could believe that is an approximation of the volume of the
ball.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: finding volume of irregular object

From: nman2084

Date: 23 May, 2011 19:04:05

Message: 5 of 6

Thanks.
does the file format should be changed if i have multiple objects which needed to meshed at same time?

Also is there a way to find the object among other objects in a scene f i have done the above analysis?

Subject: finding volume of irregular object

From: Marc

Date: 9 Aug, 2013 09:56:09

Message: 6 of 6

 
> When I ran this code on the data you posted, the image that appeared was of
> basically a portion of a ball. The axes limits were between 1.26 and 1.6,
> between 22.29 and 22.62, and between -1.77 and -1.55. If the "ball" took up
> the entire axes then its volume would be:
>
> (1.6-1.26)*(22.62-22.29)*(-1.55-(-1.77))
>
 Very strange. When I do a surfc(large data) I get romething like a roof of a house. If that is true I would limit the data to the real corner points and go the following:

verts = [x(:), y(:), z(:)];
faces = delaunay(x, y, z);
tetramesh(faces, verts);
shading('faceted')
[K, v] = convhulln(verts) ;


 v is basically the volume

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us