|
|
"Dave!" <orr### [at] no_spam_pleaseexcitecom> wrote in message
news:web.3f81b835ce1049d7f0000e6e0@news.povray.org...
> I'm brand new 'round these parts, and I'm afraid I have a ton of questions
> that are probably really basic.
Congrat's on your newness! Start asking...
> I'm working on a rendering that will feature surface detail on a sphere,
> similar to the way a cylinder (of opposing color) would intersect that
> sphere.
>
> #declare thingie = union {
> intersection {
> cylinder {<-4,0,-20>,<-4,0,-10>,4}
> sphere {<0,0,0>,15}
> pigment {rgb <.6,.6,.8>}
> sphere {<0,0,0>,15
> clipped_by {cylinder {<-4,0,-20>,<-4,0,-10>,4 inverse}}
> pigment {rgb <1,1,1>}
> }
>
> Does this make sense? Can anyone suggest a more streamlined method to
> accomplish the same thing? I intend to use more complicated interplays
than
> circle-and-cylinder, and my current route seems largely redundant. I'm
also
> not
> really interested in image mapping as a solution, since I'd rather stick
> with
> simple geometric forms at this point.
Yes, and unfortunately this is what CSG is all about. Only thing that might
prove simpler is to use a difference {} with 'inverse' instead. Not a great
improvement. Well, let's see:
union {
difference { // create curved faced cylinder end
cylinder {
<-4,0,-20>,<-4,0,-10>,4
}
sphere {
0,15
inverse // within is without, if you understand
}
pigment {rgb <.6,.6,.8>}
} // end difference
sphere { // sphere, of course
0,15
pigment {rgb <1,1,1>}
}
} // end union
Interestingly enough, this seems to work okay. No visible coincident
surfaces even though a hole wasn't removed from the sphere. I'd almost have
expected to see trouble with that surface (and it might, under other
viewpoints, scales, etc.).
There would need to be some kind of retainment which allows keeping of an
object after the CSG procedure. Might be a nice idea, if plausible. That
sphere would be reused without adding it in a second time, if such a thing
existed.
Maybe someone else has a thought on this.
Bob H.
Post a reply to this message
|
|