|
|
stevenvh wrote:
> In the past I always "differenced" objects, never a plane, and maybe that's why
> I never noticed this before. Say I want a sphere with the top cut off:
>
> difference {
> sphere { 0 1 }
> plane { y 0.8 }
> texture { T_Brass_1D }
> }
>
> Not what I want; only the top segment is kept. Logic holds that
>
> plane { -y -0.8 }
>
> should do the trick, cutting away the stuff above the (inversed) plane instead
> of below it. But POV-Ray doesn't seem to accept negative distances here!
> How do I do this?
> TIA
>
The key here is that, for CSG, the "inside" of a plane is the side
_opposite_ the normal. Also, the second parameter in the plane is the
distance from the origin _in the direction of_ the normal. (Plus, as
others here have pointed out, be sure to use the commas in these
expressions.) IOW:
difference {
sphere { 0, 1 }
plane { y, 0.8 }
texture { Whatever }
}
gives you the top "cap" of the sphere, and plane { -y, 0.8 } gives the
same "cap" but from the bottom of the sphere. What you're looking for
is plane { -y, -0.8 }. See the attached illustration.
Hope this clarifies things. :-)
-=- Larry -=-
Post a reply to this message
Attachments:
Download 'diff.png' (19 KB)
Preview of image 'diff.png'
|
|