Got Questions? Get Answers.
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:
How can I find spheres' neighbors of a sphere ?

Subject: How can I find spheres' neighbors of a sphere ?

From: mahdi roozbhani

Date: 24 Dec, 2010 05:20:24

Message: 1 of 7

How can I find spheres' neighbors of a sphere ?

Subject: How can I find spheres' neighbors of a sphere ?

From: Walter Roberson

Date: 24 Dec, 2010 05:25:13

Message: 2 of 7

On 23/12/10 11:20 PM, mahdi roozbhani wrote:
> How can I find spheres' neighbors of a sphere ?

I think you should probably explain your question in more detail.

What is your representation of the spheres, for one thing?

Have you considered using octtrees ?

Subject: How can I find spheres' neighbors of a sphere ?

From: mahdi roozbhani

Date: 24 Dec, 2010 05:35:21

Message: 3 of 7

Walter Roberson <roberson@hushmail.com> wrote in message <_8WQo.13111$lL1.4752@newsfe21.iad>...
> On 23/12/10 11:20 PM, mahdi roozbhani wrote:
> > How can I find spheres' neighbors of a sphere ?
>
> I think you should probably explain your question in more detail.
>
> What is your representation of the spheres, for one thing?
>
> Have you considered using octtrees ?

=====================================================
 What is your representation of the spheres, for one thing?
 
the center of sphere and the radius. for example every sphere has the [x y z r] that x,y and z are the centre of spheres.

 Have you considered using octtrees ?
my friend, I am not familiar with octtrees and as I know the available function code of octtrees is in the mex.file and I am going to write a simple code by myself to take this action.

Subject: How can I find spheres' neighbors of a sphere ?

From: ImageAnalyst

Date: 24 Dec, 2010 05:50:21

Message: 4 of 7

Come on, you can do better than that. Each sphere has a "neighbor"
that is non-sphere, or void space. Void space is the thing that is
right next to the sphere, unless another sphere is touching it or
overlapping it. Further away than the void space are other spheres.
ALL those other spheres are "neighbors" unless you define neighbors in
a more restricted definition, like you only want to find the centers
of other spheres that are closer than 50 units, or something like
that.

You need to put some time into your reply, so we don't have to put so
much time into our replies.

Subject: How can I find spheres' neighbors of a sphere ?

From: mahdi roozbhani

Date: 24 Dec, 2010 08:37:04

Message: 5 of 7

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <056c2e97-a301-41a0-ba26-74391ace83e6@o14g2000yqe.googlegroups.com>...
> Come on, you can do better than that. Each sphere has a "neighbor"
> that is non-sphere, or void space. Void space is the thing that is
> right next to the sphere, unless another sphere is touching it or
> overlapping it. Further away than the void space are other spheres.
> ALL those other spheres are "neighbors" unless you define neighbors in
> a more restricted definition, like you only want to find the centers
> of other spheres that are closer than 50 units, or something like
> that.
>
> You need to put some time into your reply, so we don't have to put so
> much time into our replies.

--------------------------------------------------------------------------------------------------------------------------
Dear dude, for expanding a subject ,I simple my question for u to better understanding.

My code is about un-equal sphere packing in cylinder container and knowing the positions of neighbors is very important for me.

Subject: How can I find spheres' neighbors of a sphere ?

From: ImageAnalyst

Date: 24 Dec, 2010 14:44:57

Message: 6 of 7

On Dec 24, 3:37 am, "mahdi roozbhani" <m.m.roozbah...@gmail.com>
wrote:
> Dear dude, for expanding a subject ,I simple my question for u to better understanding.
>
> My code is about un-equal sphere packing in cylinder container and knowing the positions of neighbors is very important for me.
----------------------------------------------------------------------

But we asked for a *more* detailed, complete explanation not a more
brief one. Okay, I'll give you a simple brief answer in return:
threshold your image
erode if necessary to separate any touching objects
call bwlabel or bwconncomp
call regionprops
examine the centroid locations for the info you need.


If you need a more detailed answer (like we did from you) then you can
look at my demo where I do that (but in 2D, for coins):
http://www.mathworks.com/matlabcentral/fileexchange/25157

Subject: How can I find spheres' neighbors of a sphere ?

From: Walter Roberson

Date: 24 Dec, 2010 17:54:33

Message: 7 of 7

On 24/12/10 2:37 AM, mahdi roozbhani wrote:

> My code is about un-equal sphere packing in cylinder container and
> knowing the positions of neighbors is very important for me.

Every one of the other spheres is a neighbour, and you already know
their positions.

Tags for 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