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:
volume

Subject: volume

From: David Edson

Date: 8 Feb, 2010 13:16:04

Message: 1 of 14

Dears,

I have a geometry defiend by a set of its x,y,z coordinates. I would like to calculate its volume. Is there a trick to use?


DE

Subject: volume

From: John D'Errico

Date: 8 Feb, 2010 14:04:03

Message: 2 of 14

"David Edson" <tojadeb@example.com> wrote in message <hkp2qk$ln8$1@fred.mathworks.com>...
> Dears,
>
> I have a geometry defiend by a set of its x,y,z coordinates. I would like to calculate its volume. Is there a trick to use?

If you do not know how those points are connected,
then the best answer is either a convex hull, or an
alpha shape if they are not convex.

John

Subject: volume

From: Luigi Giaccari

Date: 16 Mar, 2010 16:53:07

Message: 3 of 14

"David Edson" <tojadeb@example.com> wrote in message <hkp2qk$ln8$1@fred.mathworks.com>...
> Dears,
>
> I have a geometry defiend by a set of its x,y,z coordinates. I would like to calculate its volume. Is there a trick to use?
>
>
> DE


In the case you cloud is convex use convhulln, in the case is concave use one this to build the surface:

http://www.mathworks.com/matlabcentral/newsreader/create_message?reply_id=711429

http://www.advancedmcode.org/how-to-plot-a-coloured-surface-from-3d-scatter.html

http://www.advancedmcode.org/surface-recostruction-from-scattered-points-cloud-mycrustopen.html

http://www.advancedmcode.org/surface-recostruction-from-scattered-points-cloud-mycrust-robust.html

Then use this to get the volume

http://www.advancedmcode.org/volume-enclosed-by-a-triangulated-surface.html

Subject: volume

From: Guillaume

Date: 18 Aug, 2010 17:30:21

Message: 4 of 14

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <hkp5kj$fvq$1@fred.mathworks.com>...
> "David Edson" <tojadeb@example.com> wrote in message <hkp2qk$ln8$1@fred.mathworks.com>...
> > Dears,
> >
> > I have a geometry defiend by a set of its x,y,z coordinates. I would like to calculate its volume. Is there a trick to use?
>
> If you do not know how those points are connected,
> then the best answer is either a convex hull, or an
> alpha shape if they are not convex.
>
> John

Hello,

I wanted to compare the volume of the convex hull to the volume of the non convex hull, what would you propose to do ?

Subject: volume

From: Guillaume

Date: 18 Aug, 2010 17:34:23

Message: 5 of 14

Hello,

I have a set of points in an N-dimensional space. By means of convhulln, I computed the volume of the convex hull, but I would like now to compute the volume of the "non convex hull", and compare them to have a measure of convexity.

What would you propose?

Thanks per advance,

Guillaume

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <hkp5kj$fvq$1@fred.mathworks.com>...
> "David Edson" <tojadeb@example.com> wrote in message <hkp2qk$ln8$1@fred.mathworks.com>...
> > Dears,
> >
> > I have a geometry defiend by a set of its x,y,z coordinates. I would like to calculate its volume. Is there a trick to use?
>
> If you do not know how those points are connected,
> then the best answer is either a convex hull, or an
> alpha shape if they are not convex.
>
> John

Subject: volume

From: John D'Errico

Date: 18 Aug, 2010 17:50:30

Message: 6 of 14

"Guillaume " <fufubynight@free.fr> wrote in message <i4h5iv$nld$1@fred.mathworks.com>...
> Hello,
>
> I have a set of points in an N-dimensional space. By means of convhulln, I computed the volume of the convex hull, but I would like now to compute the volume of the "non convex hull", and compare them to have a measure of convexity.
>
> What would you propose?

How have you computed the "non-convex" hull?

Do you have a triangulated surface as generated by an
alpha shape? If so, it is quite easy. If not, then you still
need to define that non-convex hull in some way.

John

Subject: volume

From: Roger Stafford

Date: 18 Aug, 2010 17:59:08

Message: 7 of 14

"Guillaume " <fufubynight@free.fr> wrote in message <i4h5bc$d9j$1@fred.mathworks.com>...
> "John D'Errico" <woodchips@rochester.rr.com> wrote in message <hkp5kj$fvq$1@fred.mathworks.com>...
> > "David Edson" <tojadeb@example.com> wrote in message <hkp2qk$ln8$1@fred.mathworks.com>...
> > > Dears,
> > >
> > > I have a geometry defiend by a set of its x,y,z coordinates. I would like to calculate its volume. Is there a trick to use?
> >
> > If you do not know how those points are connected,
> > then the best answer is either a convex hull, or an
> > alpha shape if they are not convex.
> >
> > John
>
> Hello,
>
> I wanted to compare the volume of the convex hull to the volume of the non convex hull, what would you propose to do ?
- - - - - - - - -
  You will first have to define what is meant by the points' "non convex hull". To demonstrate the ambiguity involved suppose you have five points in which one of these five lies in the interior of their convex hull. To get a "non convex" connection among them you could make a tetrahedral "dent" in one of the convex hull's faces into the interior point. However note that the resulting volume depends very much on which face you select to make a dent in. As you can see, the notion is very ambiguous.

Roger Stafford

Subject: volume

From: Guillaume

Date: 18 Aug, 2010 21:45:28

Message: 8 of 14

First of all, I apologize for the lack of exactness in my last message.

Actually, I have defined mathematically two sets that not convex : all the signals that respect a given contiguous spectrum mask (let's say 0 between 0 and 1 MHz, and 1 between 1 to 5Mhz) with 20 active carriers, and all the signals that follow a random spectrum mask with the same number of active carriers.

I want to show that the set of signals respecting a random spectrum is "less convex" than the one respecting a contiguous spectrum.

So, my idea is to take 100 different points for each set, compute the volume of the convex hull that contains all the points, compute the volume of the smallest set containing all the initial points (also, I want to compute the volume of the initial set, the one I called "non convex hull").

I assume that building the convex hull of a given set of points will automatically include other points that were not belonging to the set. The more points are added in the hull, the "less the set is convex".

If you need any further explanation, don't hesitate, I hope these lines were understandable!

Greetings

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <i4h71c$kr$1@fred.mathworks.com>...
> "Guillaume " <fufubynight@free.fr> wrote in message <i4h5bc$d9j$1@fred.mathworks.com>...
> > "John D'Errico" <woodchips@rochester.rr.com> wrote in message <hkp5kj$fvq$1@fred.mathworks.com>...
> > > "David Edson" <tojadeb@example.com> wrote in message <hkp2qk$ln8$1@fred.mathworks.com>...
> > > > Dears,
> > > >
> > > > I have a geometry defiend by a set of its x,y,z coordinates. I would like to calculate its volume. Is there a trick to use?
> > >
> > > If you do not know how those points are connected,
> > > then the best answer is either a convex hull, or an
> > > alpha shape if they are not convex.
> > >
> > > John
> >
> > Hello,
> >
> > I wanted to compare the volume of the convex hull to the volume of the non convex hull, what would you propose to do ?
> - - - - - - - - -
> You will first have to define what is meant by the points' "non convex hull". To demonstrate the ambiguity involved suppose you have five points in which one of these five lies in the interior of their convex hull. To get a "non convex" connection among them you could make a tetrahedral "dent" in one of the convex hull's faces into the interior point. However note that the resulting volume depends very much on which face you select to make a dent in. As you can see, the notion is very ambiguous.
>
> Roger Stafford

Subject: volume

From: ImageAnalyst

Date: 18 Aug, 2010 22:32:54

Message: 9 of 14

On Aug 18, 5:45 pm, "Guillaume " <fufubyni...@free.fr> wrote:
> So, my idea is to take 100 different points for each set, compute the volume of the convex hull that contains all the points, compute the volume of the smallest set containing all the initial points (also, I want to compute the volume of the initial set, the one I called "non convex hull").
>
> I assume that building the convex hull of a given set of points will automatically include other points that were not belonging to the set. The more points are added in the hull, the "less the set is convex".
>
---------------------------------------------------------------------------------------------
Guillaume:
Sounds reasonable to me. In fact MATLAB's regionprops function in the
Image Processing Toolbox has essentially the same thing, if I
understood you correctly, called "Solidity":

"'Solidity' — Scalar specifying the proportion of the pixels in the
convex hull that are also in the region. Computed as Area/ConvexArea.
This property is supported only for 2-D input label matrices."

although you're talking 3D and it only does it in 2D. But the concept
is similar.

Subject: volume

From: Roger Stafford

Date: 18 Aug, 2010 22:41:04

Message: 10 of 14

"Guillaume " <fufubynight@free.fr> wrote in message <i4hk9o$oec$1@fred.mathworks.com>...
> First of all, I apologize for the lack of exactness in my last message.
>
> Actually, I have defined mathematically two sets that not convex : all the signals that respect a given contiguous spectrum mask (let's say 0 between 0 and 1 MHz, and 1 between 1 to 5Mhz) with 20 active carriers, and all the signals that follow a random spectrum mask with the same number of active carriers.
>
> I want to show that the set of signals respecting a random spectrum is "less convex" than the one respecting a contiguous spectrum.
>
> So, my idea is to take 100 different points for each set, compute the volume of the convex hull that contains all the points, compute the volume of the smallest set containing all the initial points (also, I want to compute the volume of the initial set, the one I called "non convex hull").
>
> I assume that building the convex hull of a given set of points will automatically include other points that were not belonging to the set. The more points are added in the hull, the "less the set is convex".
> ........
- - - - - - -
  You are still lacking a valid definition for "the volume of the smallest set containing all the initial points". A finite set of points does not define a volume until you define the infinite set of points that lie in the region of the volume. One way to do that is to construct the connections between the finite set as defining the edges and faces of a polyhedron which is to then constitute your region (your volume.) You have yet to lay out any systematic method of determining such connections. In the five-point example I gave earlier how would you define the polyhedron connecting them in some canonical way that avoids the ambiguity I pointed out?

Roger Stafford

Subject: volume

From: Guillaume

Date: 19 Aug, 2010 08:28:12

Message: 11 of 14

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message
> You are still lacking a valid definition for "the volume of the smallest set containing all the initial points". A finite set of points does not define a volume until you define the infinite set of points that lie in the region of the volume. One way to do that is to construct the connections between the finite set as defining the edges and faces of a polyhedron which is to then constitute your region (your volume.) You have yet to lay out any systematic method of determining such connections. In the five-point example I gave earlier how would you define the polyhedron connecting them in some canonical way that avoids the ambiguity I pointed out?
>
> Roger Stafford
Hello Roger
Thanks for your answer, I understand the ambiguity you raised.

I had a look on the alpha shapes mentioned by John, and looks like it would fit my expectations, without any hole. for example, it would be the lower left image in http://cgm.cs.mcgill.ca/~godfried/teaching/projects97/belair/alpha.html

I just have now to figure out how to generate this alpha shape. If you had any suggestions, don't hesitate :-)

Furthermore, I initially planned to deal with N-D complex points, but is it possible to compute the convex hull of N-D complex points?

By the way, I think that the "Solidity" scalar in Image Processing does fit with what I want to do. Thanks for the reference ImageAnalyst

Regards

Subject: volume

From: ImageAnalyst

Date: 19 Aug, 2010 12:05:17

Message: 12 of 14

On Aug 19, 4:28 am, "Guillaume " <fufubyni...@free.fr> wrote:
> I just have now to figure out how to generate this alpha shape. If you had any suggestions, don't hesitate :-)

> Regards
---------------------------------------------------------------------------------------------------------------
You might look at us's alpha shape submission to the File Exchange:
http://www.mathworks.com/matlabcentral/fileexchange/6760-ashape-a-pedestrian-alpha-shape-extractor
(a file from his "pedestrian" collection)

Subject: volume

From: Guillaume

Date: 19 Aug, 2010 12:38:04

Message: 13 of 14

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <73239358-ea9d-4738-a57a-5ccfd5cb361a@g17g2000yqe.googlegroups.com>...
> You might look at us's alpha shape submission to the File Exchange:
> http://www.mathworks.com/matlabcentral/fileexchange/6760-ashape-a-pedestrian-alpha-shape-extractor
> (a file from his "pedestrian" collection)

It seems only working in 2D. I am using N dimensions ;-)

Subject: volume

From: Guillaume

Date: 23 Aug, 2010 15:10:04

Message: 14 of 14


> You are still lacking a valid definition for "the volume of the smallest set containing all the initial points". A finite set of points does not define a volume until you define the infinite set of points that lie in the region of the volume. One way to do that is to construct the connections between the finite set as defining the edges and faces of a polyhedron which is to then constitute your region (your volume.) You have yet to lay out any systematic method of determining such connections. In the five-point example I gave earlier how would you define the polyhedron connecting them in some canonical way that avoids the ambiguity I pointed out?
>
> Roger Stafford

I think I would take the Jarvis March method and take limit the distance between the current point and the next one. Howver, Jarvis March requires a notion of angle, which I can't adapt in N-Dimensional space. Do you know how to adapt this algorithm ?

Thanks per advance,

Guillaume

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