POV-Ray : Newsgroups : povray.newusers : A "realistic" plastic hemisphere. Server Time
25 Dec 2024 22:13:14 EST (-0500)
   A "realistic" plastic hemisphere. (Message 1 to 7 of 7)  
From: Dave VanHorn
Subject: A "realistic" plastic hemisphere.
Date: 4 Jul 2007 22:35:02
Message: <web.468c585a4bebde348cbc7040@news.povray.org>
I'm a little stuck with this..
 I'm trying to define a realistic plastic hemisphere.

 In other words, define a sphere with actual wall thickness, so that when I
clip it with a plane, or cylinder (as drilling a hole in it) the edges show
up, and it dosen't end up as two infinitely thin shells.

What CSG should I use for this?


Post a reply to this message

From: triple r
Subject: Re: A "realistic" plastic hemisphere.
Date: 4 Jul 2007 23:20:02
Message: <web.468c6263c3c45a2befa9f3280@news.povray.org>
"Dave VanHorn" <mic### [at] gmailcom> wrote:
> I'm a little stuck with this..
>  I'm trying to define a realistic plastic hemisphere.
>
>  In other words, define a sphere with actual wall thickness, so that when I
> clip it with a plane, or cylinder (as drilling a hole in it) the edges show
> up, and it dosen't end up as two infinitely thin shells.
>
> What CSG should I use for this?

I don't know that it's the most efficient way possible, but this sounds like
what you are talking about:

camera{location <1,3,3> look_at 0}
light_source{<25,25,25> rgb 1}
difference{
 difference{
  sphere{0,1}
  sphere{0,.95}
 }
 cylinder{0,y*2,0.3}
 plane{-z,0}
 pigment{rgb 1}
}


If you replace plane{-z,0} by clipped_by{plane{z,0}}, then it does give two
shells.  I had to look it up to remember, but the manual explains that
clipped_by removes surfaces and leaves an opening.

http://www.povray.org/documentation/view/3.6.1/322/

 - Ricky


Post a reply to this message

From: Trevor G Quayle
Subject: Re: A "realistic" plastic hemisphere.
Date: 4 Jul 2007 23:45:01
Message: <web.468c6935c3c45a2b5e73ab330@news.povray.org>
"triple_r" <rre### [at] hotmailcom> wrote:
> camera{location <1,3,3> look_at 0}
> light_source{<25,25,25> rgb 1}
> difference{
>  difference{
>   sphere{0,1}
>   sphere{0,.95}
>  }
>  cylinder{0,y*2,0.3}
>  plane{-z,0}
>  pigment{rgb 1}
> }
>

This works, but the extra difference is unnecessary, everything after the
first object in a difference is differenced from it:

difference{
  sphere{0,1}
  sphere{0,.95}
  cylinder{0,y*2,0.3}
  plane{-z,0}
  pigment{rgb 1}
}


Post a reply to this message

From: Alain
Subject: Re: A "realistic" plastic hemisphere.
Date: 5 Jul 2007 09:19:42
Message: <468cefee$1@news.povray.org>
Dave VanHorn nous apporta ses lumieres en ce 2007/07/04 22:32:
>  I'm a little stuck with this..
>  I'm trying to define a realistic plastic hemisphere.
> 
>  In other words, define a sphere with actual wall thickness, so that when I
> clip it with a plane, or cylinder (as drilling a hole in it) the edges show
> up, and it dosen't end up as two infinitely thin shells.
> 
> What CSG should I use for this?
> 
> 
> 
Don't clip!
Make your sphere out of 2 differenced concentric spheres. Then, use that in a 
difference or intersection with your plane, or difference it with a cylinder.
Sample:
#declare ShellSphere = difference{sphere{0,5} sphere{0,4.5}}//sphere with outer 
radius of 5 and a thickness of 0.5
With a hole in it:
difference{
	object{ShellSphere}
	cylinder{x+y*2-z, (x+y)*5, 2}
	texture{YourTexture}
	}

-- 
Alain
-------------------------------------------------
Rebellion against tyrants is obedience to God.
Benjamin Franklin


Post a reply to this message

From: Dave VanHorn
Subject: Re: A "realistic" plastic hemisphere.
Date: 6 Jul 2007 17:15:01
Message: <web.468eb0871c54420da08ed15e0@news.povray.org>
That got it.

I had to step back a bit though, as it wouldn't let me do the differencing
with pre-defined shapes.

IOW, the example you showed works fine, but if I declare a hole and try to
difference it as below, I wasn't able to get that to work:

#declare Hole = object { cylinder {
0,(x*Ball_Dia),((Cam_Lens_Dia+(30*Mil))/2)
                         rotate <0,0,(0 - Cam_Angle)>
                         rotate <0,180,0>   //Around the vertical axis
                       }

#declare Top = difference { sphere { <0,0,0>, (Ball_Dia/2) }
                            sphere { <0,0,0>, ((Ball_Dia/2) - Wall_Thick)}
                            Hole
                            plane{-y,0}
                            material { White_Plastic }
                            photons { target 1.0 refraction on reflection on
}
                         }


I'm also not convinced that I have the photons working right..  Photons seem
to behave differently for a union or difference than they do if I take the
objects that would have been in the union, and do them separately.


Post a reply to this message

From: Tim Attwood
Subject: Re: A "realistic" plastic hemisphere.
Date: 7 Jul 2007 18:34:44
Message: <46901504$1@news.povray.org>
> That got it.
>
> I had to step back a bit though, as it wouldn't let me do the differencing
> with pre-defined shapes.
>
> IOW, the example you showed works fine, but if I declare a hole and try to
> difference it as below, I wasn't able to get that to work:
>
> #declare Hole = object { cylinder {
> 0,(x*Ball_Dia),((Cam_Lens_Dia+(30*Mil))/2)
>                         rotate <0,0,(0 - Cam_Angle)>
>                         rotate <0,180,0>   //Around the vertical axis
>                       }
>
> #declare Top = difference { sphere { <0,0,0>, (Ball_Dia/2) }
>                            sphere { <0,0,0>, ((Ball_Dia/2) - Wall_Thick)}
>                            Hole
>                            plane{-y,0}
>                            material { White_Plastic }
>                            photons { target 1.0 refraction on reflection 
> on
> }
>                         }

The syntax for using #declared objects is object{Name}. For example...
#declare Holes = union{cylinder{...}cylinder{...}...};
#declare Top = difference{sphere{...}sphere{...}plane{...}};
#declare HoledTop = difference{object{Top}object{Holes}};
object{HoledTop} // draw it

> I'm also not convinced that I have the photons working right..  Photons 
> seem
> to behave differently for a union or difference than they do if I take the
> objects that would have been in the union, and do them separately.

Unions don't remove the internal surfaces, use merge to remove the internal
surfaces for partially transparent objects. Also you must make sure that
you don't have coincident surfaces, even in a difference.


Post a reply to this message

From: Alain
Subject: Re: A "realistic" plastic hemisphere.
Date: 8 Jul 2007 11:20:48
Message: <469100d0$1@news.povray.org>
Dave VanHorn nous apporta ses lumieres en ce 2007/07/06 17:13:
> That got it.
> 
> I had to step back a bit though, as it wouldn't let me do the differencing
> with pre-defined shapes.
> 
> IOW, the example you showed works fine, but if I declare a hole and try to
> difference it as below, I wasn't able to get that to work:
> 
> #declare Hole = object { cylinder {
> 0,(x*Ball_Dia),((Cam_Lens_Dia+(30*Mil))/2)
>                          rotate <0,0,(0 - Cam_Angle)>
>                          rotate <0,180,0>   //Around the vertical axis
>                        }
> 
> #declare Top = difference { sphere { <0,0,0>, (Ball_Dia/2) }
>                             sphere { <0,0,0>, ((Ball_Dia/2) - Wall_Thick)}
>                             Hole
>                             plane{-y,0}
>                             material { White_Plastic }
>                             photons { target 1.0 refraction on reflection on
> }
>                          }
> 
> 
> I'm also not convinced that I have the photons working right..  Photons seem
> to behave differently for a union or difference than they do if I take the
> objects that would have been in the union, and do them separately.
> 
> 
> 
> 
When you have a solid spherical object, it cause the light to converge. If you 
have one that have a hole in it's center, the cause light to DIVERGE.
So, if in this case photons apears to act that way, it's the physicaly correct 
behaviour.
Light coming trough the edges without encountering the empty space will converge.
Light that encounter the inner space at a low angle will get reflected outward 
by total internal reflection.
Light that enter that space will be affected as by a divergent lense. ( I did 
make extensive testing of that case )

If you use an union, photons will be affected by the interior surfaces, use a 
merge to remove those.

In every cases, make sure that you don't have coincident surfaces. Make a 
differenced or intersecting object slightly larger so that it protude slightly 
from the parent object.

-- 
Alain
-------------------------------------------------
Episcopalian: It's not so bad if shit happens, as long as you serve the right 
wine with it.


Post a reply to this message

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