POV-Ray : Newsgroups : povray.general : CSG Texturing Server Time
16 Nov 2024 11:17:23 EST (-0500)
  CSG Texturing (Message 1 to 5 of 5)  
From: Peter Popov
Subject: CSG Texturing
Date: 6 Sep 1998 18:22:02
Message: <35f2fcfa.0@news.povray.org>
I having the following problem: I have a very nice hand-coded CSG keyboard.
I want to make a cross-section of it by intersecting it with a plane. The
keys are gray and the body is white (roughly) and I want to see that in the
cross-section. However, either the cutting plane gets black (if I don't
apply texture to the intersection ) or it gets a solid color (if I *do*
apply texture to the intersection). Is there a way to do this without
separately intersecting each key with the cutting plane and them union them?

Peter


Post a reply to this message

From: Mike
Subject: Re: CSG Texturing
Date: 8 Sep 1998 07:39:35
Message: <35F5161B.8894FA29@aol.com>
I never have POV handy when I'm reading these groups, but I think clipped_by is
what will do what you want.  I recall having this problem...ugh, just wish if I
can remember is that one worked.

If that doesn't work, you could always create a union of the keys and a union of
the keyboard, then do a simple:

union {
object {keyboard clipped_by { plane { } } }
object {keys clipped_by { plane { ) } } }
}

If the planes are cutting the wrong side just use the inverse keyword.

-Mike

Peter Popov wrote:

> I having the following problem: I have a very nice hand-coded CSG keyboard.
> I want to make a cross-section of it by intersecting it with a plane. The
> keys are gray and the body is white (roughly) and I want to see that in the
> cross-section. However, either the cutting plane gets black (if I don't
> apply texture to the intersection ) or it gets a solid color (if I *do*
> apply texture to the intersection). Is there a way to do this without
> separately intersecting each key with the cutting plane and them union them?
>
> Peter


Post a reply to this message

From: Peter Popov
Subject: Re: CSG Texturing
Date: 8 Sep 1998 16:10:55
Message: <35f5813f.0@news.povray.org>
Mike wrote in message <35F5161B.8894FA29@aol.com>...
>I never have POV handy when I'm reading these groups, but I think
clipped_by is
>what will do what you want.  I recall having this problem...ugh, just wish
if I
>can remember is that one worked.
>
>If that doesn't work, you could always create a union of the keys and a
union of
>the keyboard, then do a simple:
>
>union {
>object {keyboard clipped_by { plane { } } }
>object {keys clipped_by { plane { ) } } }
>}
>
>If the planes are cutting the wrong side just use the inverse keyword.
>
>-Mike

Uh, clipped_by leaves a hole in the object and makes the wall infinitely
thin... since the cutting plane is normal to the viewing rays (orthographic
projection) I won't see a thing. I hoped bounded_by would work, by using it
"improperly" so the results are unpredictable, but it didn't. I'll go the
hard way (it works).

Peter


Post a reply to this message

From: J  L  Rose
Subject: Re: CSG Texturing
Date: 7 Oct 1998 02:04:52
Message: <361ACC38.2E5B@spamBgone.nbnet.nb.ca>
Peter Popov wrote:
> 
> Mike wrote in message <35F5161B.8894FA29@aol.com>...
> >I never have POV handy when I'm reading these groups, but I think
> clipped_by is
> >what will do what you want.  I recall having this problem...ugh, just wish
> if I
> >can remember is that one worked.
> >
> >If that doesn't work, you could always create a union of the keys and a
> union of
> >the keyboard, then do a simple:
> >
> >union {
> >object {keyboard clipped_by { plane { } } }
> >object {keys clipped_by { plane { ) } } }
> >}
> >
> >If the planes are cutting the wrong side just use the inverse keyword.
> >
> >-Mike
> 
> Uh, clipped_by leaves a hole in the object and makes the wall infinitely
> thin... since the cutting plane is normal to the viewing rays (orthographic
> projection) I won't see a thing. I hoped bounded_by would work, by using it
> "improperly" so the results are unpredictable, but it didn't. I'll go the
> hard way (it works).
> 
> Peter

I vote for something like (in pseudo-POV-Ray code):

 union of {
     intersection { WhiteKeys and plane } 
     intersection { BlackKeys and plane }
     }


provided that it's easy to separate the two different sets of keys out
from what he already has.

-jr- 
**********************************************
* Delete "spamBgone." to get my real address *
**********************************************


Post a reply to this message

From: Peter Popov
Subject: Re: CSG Texturing
Date: 9 Oct 1998 22:07:46
Message: <361eb362.0@news.povray.org>
J. L. Rose wrote in message <361### [at] spamBgonenbnetnbca>...
>> Peter
>
>I vote for something like (in pseudo-POV-Ray code):
>
> union of {
>     intersection { WhiteKeys and plane }
>     intersection { BlackKeys and plane }
>     }
>
>
>provided that it's easy to separate the two different sets of keys out
>from what he already has.
>
>-jr-
>**********************************************
>* Delete "spamBgone." to get my real address *
>**********************************************

Well, planes are infinite and I am almost certain that automatic bounding
does not handle intersections of infinite objects correctly, and all the
keys are intersections of at least six planes and some other stuff. So I
manually bounded each key, then each row of keys, and finally the keyboard.
It was a magnitude faster. This solution, of course, only left me with the
choice of going the hard way, but it worked. The question remains open,
since this was a specific case, and a general solution is needed. Maybe even
an addition in future POV that solves the problem. For example, it would be
nice if, in CSG, a keyword specifies that no texture really means no texture
and not black (i.e. use the texture of the other CSG object and not the on
with no texture, hope it's clear). Just an idea anyway.

Peter


Post a reply to this message

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