|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> 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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
|
|