POV-Ray : Newsgroups : povray.general : constructing a geometry Server Time
27 Nov 2024 08:35:25 EST (-0500)
  constructing a geometry (Message 1 to 10 of 10)  
From: Amir ni
Subject: constructing a geometry
Date: 4 Feb 2009 22:20:00
Message: <web.498a5a175c69b45c792c7d270@news.povray.org>
Hi,

I am trying to make a special shape in povray that is made by spheres, but
neither "intersection" nor "difference" commands cannot help me. This is the
problem: if the position of eight spheres are in a cubic form in a way that the
distance between neighbor sphere is less than 1.4 times the radius of spheres, a
cavity is formed in the center of cube. I want to make the shape of that cavity.
The following code contains the the coordinates of eight spheres. In advance, I
do appreciate your help.




global_settings {  assumed_gamma 1.0 }

#include "colors.inc"

//---------------------------------------
camera{ ultra_wide_angle
        angle 75
        right x*image_width/image_height
     location  <2 , 3 , -4>
        look_at   <0,0,0> }
//---------------------------------------
light_source{ <0,0,-2500>
              color rgb<1,1,1> }
//---------------------------------------
background {color  rgb<1,1,1>}
//---------------------------------------

#declare d=1;

union{

sphere { <d/2, d/2, d/2> ,  d/1.4}
sphere { <-d/2, -d/2, -d/2> ,  d/1.4}

sphere { <-d/2, d/2, d/2> ,  d/1.4}
sphere { <d/2, -d/2, -d/2> ,  d/1.4}

sphere { <d/2, -d/2, d/2> ,  d/1.4}
sphere { <-d/2, d/2, -d/2> ,  d/1.4}

sphere { <d/2, d/2, -d/2> ,  d/1.4}
sphere { <-d/2, -d/2, d/2> ,  d/1.4}


pigment{ color rgb<1,0,0> }
}


Post a reply to this message

From: stevenvh
Subject: Re: constructing a geometry
Date: 5 Feb 2009 01:55:00
Message: <web.498a8d0839783190c0721a1d0@news.povray.org>
Start with a cube whose vertices coincide with the sphere centers. Then subtract
the spheres from it:

difference {

  box { < -d/2, -d/2, -d/2 >, < d/2, d/2, d/2 > }

  sphere { <d/2, d/2, d/2> ,  d/1.4}
  sphere { <-d/2, -d/2, -d/2> ,  d/1.4}
  sphere { <-d/2, d/2, d/2> ,  d/1.4}
  sphere { <d/2, -d/2, -d/2> ,  d/1.4}
  sphere { <d/2, -d/2, d/2> ,  d/1.4}
  sphere { <-d/2, d/2, -d/2> ,  d/1.4}
  sphere { <d/2, d/2, -d/2> ,  d/1.4}
  sphere { <-d/2, -d/2, d/2> ,  d/1.4}

  pigment{ color rgb<1,0,0> }

}

HTH
Steven


Post a reply to this message

From: stevenvh
Subject: Re: constructing a geometry
Date: 5 Feb 2009 02:15:00
Message: <web.498a917639783190c0721a1d0@news.povray.org>
"Amir_ni" <nomail@nomail> wrote:
> Hi,
>
> I am trying to make a special shape in povray that is made by spheres, but
> neither "intersection" nor "difference" commands cannot help me. This is the
> problem: if the position of eight spheres are in a cubic form in a way that the
> distance between neighbor sphere is less than 1.4 times the radius of spheres, a
> cavity is formed in the center of cube. I want to make the shape of that cavity.

By the way, you already have a cavity when the distance is less than 1.73 times
the radius (sqrt(3)), because the distance from the center of a sphere to the
center of the cavity is sqrt(r^2 + r^2 + r^2). You have three dimensions here.


Post a reply to this message

From: Amir ni
Subject: Re: constructing a geometry
Date: 5 Feb 2009 04:00:01
Message: <web.498aaa2739783190792c7d270@news.povray.org>
Hi Steven, Thank you very much, I appreciate your help.


"stevenvh" <nomail@nomail> wrote:
> "Amir_ni" <nomail@nomail> wrote:
> > Hi,
> >
> > I am trying to make a special shape in povray that is made by spheres, but
> > neither "intersection" nor "difference" commands cannot help me. This is the
> > problem: if the position of eight spheres are in a cubic form in a way that the
> > distance between neighbor sphere is less than 1.4 times the radius of spheres, a
> > cavity is formed in the center of cube. I want to make the shape of that cavity.
>
> By the way, you already have a cavity when the distance is less than 1.73 times
> the radius (sqrt(3)), because the distance from the center of a sphere to the
> center of the cavity is sqrt(r^2 + r^2 + r^2). You have three dimensions here.


Post a reply to this message

From: Nicolas George
Subject: Re: constructing a geometry
Date: 5 Feb 2009 05:07:43
Message: <498aba6f$1@news.povray.org>
"stevenvh"  wrote in message
<web.498a917639783190c0721a1d0@news.povray.org>:
> "Amir_ni" <nomail@nomail> wrote:
>> distance between neighbor sphere is less than 1.4 times the radius of spheres, a
>> cavity is formed in the center of cube. I want to make the shape of that cavity.
> By the way, you already have a cavity when the distance is less than 1.73 times
> the radius (sqrt(3)), because the distance from the center of a sphere to the
> center of the cavity is sqrt(r^2 + r^2 + r^2). You have three dimensions here.

In fact, if the radius is less than sqrt(2), there is no "cavity" at all,
since the spheres on the diagonal of a face do not intersect.


Post a reply to this message

From: stevenvh
Subject: Re: constructing a geometry
Date: 5 Feb 2009 07:35:01
Message: <web.498adc8f39783190c0721a1d0@news.povray.org>
Nicolas George <nicolas$george@salle-s.org> wrote:
> "stevenvh"  wrote in message
> <web.498a917639783190c0721a1d0@news.povray.org>:
> > "Amir_ni" <nomail@nomail> wrote:
> >> distance between neighbor sphere is less than 1.4 times the radius of spheres, a
> >> cavity is formed in the center of cube. I want to make the shape of that cavity.
> > By the way, you already have a cavity when the distance is less than 1.73 times
> > the radius (sqrt(3)), because the distance from the center of a sphere to the
> > center of the cavity is sqrt(r^2 + r^2 + r^2). You have three dimensions here.
>
> In fact, if the radius is less than sqrt(2), there is no "cavity" at all,
> since the spheres on the diagonal of a face do not intersect.

Well, they do intersect, but they "cavity" isn't a closed volume, i.e. it's open
to the six sides of the cube.


Post a reply to this message

From: Nicolas George
Subject: Re: constructing a geometry
Date: 6 Feb 2009 04:55:18
Message: <498c0906@news.povray.org>
"stevenvh"  wrote in message
<web.498adc8f39783190c0721a1d0@news.povray.org>:
>> In fact, if the radius is less than sqrt(2), there is no "cavity" at all,
>> since the spheres on the diagonal of a face do not intersect.
> Well, they do intersect,

The ones on diagonally opposed vertices do not.

>			   but they "cavity" isn't a closed volume, i.e. it's open
> to the six sides of the cube.

Which is not a cavity in the proper sense.


Post a reply to this message

From: Chris B
Subject: Re: constructing a geometry
Date: 6 Feb 2009 05:24:56
Message: <498c0ff8$1@news.povray.org>
"Nicolas George" <nicolas$george@salle-s.org> wrote in message 
news:498c0906@news.povray.org...
> "stevenvh"  wrote in message
> <web.498adc8f39783190c0721a1d0@news.povray.org>:
>>> In fact, if the radius is less than sqrt(2), there is no "cavity" at 
>>> all,
>>> since the spheres on the diagonal of a face do not intersect.
>> Well, they do intersect,
>
> The ones on diagonally opposed vertices do not.
>
>>    but they "cavity" isn't a closed volume, i.e. it's open
>> to the six sides of the cube.
>
> Which is not a cavity in the proper sense.

We're veering off onto semantics, but I'd say that an open cavity is equally 
proper.
A lot of cavities in teeth for example are open cavities.

Chris B.


Post a reply to this message

From: clipka
Subject: Re: constructing a geometry
Date: 6 Feb 2009 11:20:01
Message: <web.498c632639783190bdc576310@news.povray.org>
"Amir_ni" <nomail@nomail> wrote:
> if the position of eight spheres are in a cubic form in a way that the
> distance between neighbor sphere is less than 1.4 times the radius of spheres, a
> cavity is formed in the center of cube. I want to make the shape of that cavity.
> The following code contains the the coordinates of eight spheres. In advance, I
> do appreciate your help.

If I understand the problem correctly, that's an easy one:

- Create a shape with the spheres' center points as corners (should be a cube
from your description)
- Subtract the spheres
- Voila!

(BTW, I guess that 1.4 should in fact be sqrt(2)...)


Post a reply to this message

From: stevenvh
Subject: Re: constructing a geometry
Date: 10 Feb 2009 15:00:00
Message: <web.4991dba139783190c0721a1d0@news.povray.org>
"clipka" <nomail@nomail> wrote:
>
> If I understand the problem correctly, that's an easy one:
>
> - Create a shape with the spheres' center points as corners (should be a cube
> from your description)
> - Subtract the spheres
> - Voila!
>

That's what I suggested in my first reply.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.