POV-Ray : Newsgroups : povray.newusers : How to get preserve color through an intersection call? : Re: How to get preserve color through an intersection call? Server Time
4 Jul 2024 13:42:41 EDT (-0400)
  Re: How to get preserve color through an intersection call?  
From: Brad
Date: 3 Oct 2010 13:50:00
Message: <web.4ca8c1c4627fd6a8881e51860@news.povray.org>
Jim Holsenback <jho### [at] povrayorg> wrote:
> On 10/03/2010 04:42 AM, Brad wrote:
> > #declare shell = difference{
> > sphere{<0,0,0> 6}
> > sphere{<0,0,0> 5}}
>
> try assigning a pigment to the above and that might better visualize
> whats going on here ...
>
> > // and this is putting the spherical shell with holes in it with the filled
> > //holes
> >
> > union{
> > object{shell_with_cylindercutouts texture {pigment{color rgb<0,0,0>}}}
> > object{cutouts}}
>
> then comment out the union stuff and look at the "cutouts" only ... I
> didn't try it but I think having the "bunch_of_cyclinders" extend beyond
> the outer skin of the "shell" is the problem.

I don't think there is a problem with this. If I add color to the
bunch_of_cylinders as a whole the image looks correct ( see
http://yfrog.com/nccodelp ).

I mean, I do know a way of fixing the problem, (by defining an intersection with
the shell and each individual cylinder, giving each a color attribute) but I
have to modify the code quite a bit and was hoping to that there was something
else I could do to preserve the color of the cylinders.

I don't think the cylinders extending outside the shell is a problem. I think
that's the way it should be done when taking a "difference". The tutorial that I
read said that if the two objects overlap perfectly on the boundary, then POVRAY
sometimes gets confused and I might not actually get a hole in the cylinder. So
I "difference" the entire cylinder to make sure that I get a hole in the shell.
Then I fill that hole with the correct size "cutout" which is generated via a
'intersection'.


NOTE: In my first code submitted it wouldn't have worked the way I wanted anyway
because I didn't give each color a transparency to it. But POVRAY does
explicitly say

"  0:00:00 Parsing
File: code.pov  Line: 142
Parse Warning: No pigment type given."

so that isn't the issue to my problem. Making each color transparent still gives
this error and doesn't give me what I expect.


Post a reply to this message

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